Jump to content

Recent Status Updates

  • Photo
      18 Aug

    When faced with a wall of errors and no hope to fix them, remember the following "Programs always do what you tell them to, and seldom what you want them to, but eventually you'll run out of things that can go wrong and it'll just work. and that's the secret to good programming."

    Show comments (2)
View All Updates

Developed by Kemal Taskin
- - - - -

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
  • 4,495 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