Jump to content

How do I compile and run an assembly program using TASM?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
dre

dre

    Newbie

  • Members
  • Pip
  • 2 posts
I have this small hello world program:
.386
code segment use16
assume cs:code,ds:data,ss:mystack 
; ; is used to write comments 
begin : ; here begin is a label as it's follows by :
mov ax,data ;put in ds the adresse of data segment 
move ds,ax ; using ax regiter as ds is not directly assecible
mov ah,09 ; 09h is the function to write in screen
mov dx,offset message ; the offset of messege is put in dx
int 21h ; call of interrupt 21 to execute the function

mov ah,4ch ; appel a la fonction 4ch (h for hexadecimal)
int 21h ; call to execute the function for ending this 
code ends ; program must be in each exe program

data segment use16 ; the dump of data segment and variable in
message db "hello, world !",'$' ; here an array of char ends with '$'
data ends ; 

mystack segment stack ; begin of stack
dumping db 256 DUP (?) ; 256 cellule full with (?)
mystack ends ; end of stak


end begin ; end du code source


and i just have tasm downloaded but don't know how to compile this and get it running. i know i have to do something with DOS, i have this program saved in notepad...can somebody please tell me how i can get this program running with TASM?

thank you.

Edited by WingedPanther, 24 July 2009 - 10:20 AM.
add code tags (the # button)


#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
There should be some documentation that came with it. What version of TASM do you have? (And why don't you use NASM?)
sudo rm -rf /

#3
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts
yea, i recommend NASM too, it's my favorite assembler, and TASM is no longer maintained.