Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8478763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:50:12+00:00 2026-06-10T18:50:12+00:00

Basically, I am using NASM to create simple .COM files to use. For one

  • 0

Basically, I am using NASM to create simple .COM files to use. For one of the files(ttcb.asm), it starts out by clearing the screen. This is done by calling a routine in another file, so I used %include 'video.asm'. This includes the file as expected. When I include this file, nothing else following the %include statement in the original file(the file that included video.asm) will be executed, even if I don’t call the separate routine. I also see that the code in video.asm is automatically getting executed. But when I remove the %include statement, everything runs properly. I’ve even tried removing everything in video.asm, but it still did not work. Then I tried making video.asm a blank file, and it worked, but that will be pointless. Then I tried moving the include statement around, but that failed as well. Is there any solution to this, or do I have to insert the subroutine directly into the original file?

ttcb.asm:

[BITS 16]


section .text

%include 'video.asm'

call screen_clear

jmp $    ;should've frozen the .COM, but it didn't, meaning it failed to execute.


section .data

welcomeMsg db 'Welcome to the TitaniumCube ©.',13,10,0,'$'

section .bss

video.asm:

;===================================
;-----------------------------------
;Clears the screen to black
;No input or output
;-----------------------------------

screen_clear:
mov ah,0Fh
int 10h
push ax
mov ah,00
mov al,00
int 10h
pop ax
mov ah,00
int 10h
ret

;-----------------------------------
;===================================
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:50:14+00:00Added an answer on June 10, 2026 at 6:50 pm

    For COM files, use org 100h to specify the binary base address. The .text section will be the code start address. So put all functions after the main program block ends.

    Below is the code. Compile with: nasm -fbin -o ttcb.com ttcb.asm

    [BITS 16]
    
    
    org 100h ;set base address. must be 100h for COM files
    
    
    section .text ;start of code is always start address for COM files
    
    call screen_clear
    
    mov ax, word welcomeMsg ;put welcomeMsg offset in register AX
    ;if above "org 100h" isn't specified, the above instruction would produce:
    ;"mov ax, 001Ch" instead of "mov ax, 011Ch"
    
    ;jmp $    ;should've frozen the .COM, but it didn't, meaning it failed to execute.
    int 20h ;terminate program
    
    %include 'video.asm'
    
    
    section .data
    
    welcomeMsg db 'Welcome to the TitaniumCube ©.',13,10,0,'$'
    
    
    section .bss
    

    PS) Under pure DOS, there’s no © (copyright) character.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the JQuery DropdownChecklist as available from here: http://code.google.com/p/dropdown-check-list/ Basically I'm using some
I am using the following method to basically create a JSON string. var saveData
I'm just starting to use mysql, and I'm basically using it to store and
I'm basically using a plug-in that makes use of the jQuery load(url) function. Since
Hi I've made my igoogle app simple though it is basically using an xml/php
I'm having a little trouble figuring out what to do. Basically using java I'm
I'm using python with matplotlib to create plots out of data, an I'd like
I am trying to use another third party application into my application. Basically using
Given an app called ExampleApp, I want to find ~/Library/Logs/ExampleApp basically without using hard
Basically I am using some open source code called OrderedDictionary that is derived from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.