Re: Using tasm
From: Jim Carlock (anonymous_at_127.0.0.1)
Date: 03/13/04
- Next message: Jim Carlock: "Re: Using tasm"
- Previous message: PlasmaDragon: "Using tasm"
- In reply to: PlasmaDragon: "Using tasm"
- Next in thread: Bx.C: "Re: Using tasm"
- Reply: Bx.C: "Re: Using tasm"
- Reply: D: "Re: Using tasm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Mar 2004 23:15:50 +0000 (UTC)
I just recreated the DOS program myself.
Its calling a DOS character writing function (ie, Function 2h of
Interrupt 21). In other words it's a DOS program. The
Interrupt 20h is used to end a DOS program.
All that app does is displays the letter A on the next line of a
DOS prompt screen. If you click on it through windows, it's
likely that you won't even see it display the letter A being
drawn.
If you run the program from inside a DOS prompt though, you
should see the letter 'A' printed to a blank line and then the DOS
prompt returns.
To assemble that using DEBUG, open a DOS prompt and then
type the following at the DOS prompt, the dashes are the DEBUG
prompts.
C:\>DEBUG
-n test.com
-rcx
-200
a 100
mov ah, 2
mov dl, 41
int 21
int 20
<press the enter key to make a blank line and get out of assembly>
-w
-q
C:\>
The commands for debug can be found by typing a ? at the - prompt.
The - is the standard prompt seen while using DEBUG.
Here's a brief commentary of the commands used above:
-a 100
This command tells debug to start assembling at line 100.
Line 100 is the default start line used in all .com programs.
The lines are all hex based numbers, as you'll see when using debug.
-n test.com
This command names the file as test.com.
-rcx
The RCX command is the way to put a number into the CX register.
The CX register needs a number because the next command uses
the CX to tell how many bytes to write to the drive.
-w
This command needs a number in the CX register so it knows how
many bytes are in the program and how many bytes need to be
written to the disk drive.
It also requires the file to have a name, thus you use the -n command
to name the file.
Int 21h is an old DOS function number. It is simply called Interrupt 21
and there are a ton of functions defined by placing a Function Number
into the AH register and using the other registers to specify various
parameters. In the Interrupt 21h, Function 2h, it requires a character
code to be placed into the DL register. This character code is
displayed on a blank line when Int 21 is called.
Int 20 is the DOS End command. It means the program is done doing
what it does, and it's used to return control to the DOS prompt.
Hope that helps.
-- Jim Carlock http://www.microcosmotalk.com/ Post replies to the newsgroup.
- Next message: Jim Carlock: "Re: Using tasm"
- Previous message: PlasmaDragon: "Using tasm"
- In reply to: PlasmaDragon: "Using tasm"
- Next in thread: Bx.C: "Re: Using tasm"
- Reply: Bx.C: "Re: Using tasm"
- Reply: D: "Re: Using tasm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|