Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

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

hello world assembly

  • Please log in to reply
2 replies to this topic

#1 dre


    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 24 July 2009 - 09:30 AM

I have this small hello world program:
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)

  • 0

#2 dargueta


    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 05 August 2009 - 06:54 PM

There should be some documentation that came with it. What version of TASM do you have? (And why don't you use NASM?)
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'

#3 outsid3r


    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 494 posts

Posted 21 August 2009 - 01:32 AM

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

Also tagged with one or more of these keywords: hello world, assembly

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download