Jump to content





Recent Status Updates

  • Photo
      16 Apr
    Kadence

    If you're reading this, you're on my profile and I know you're on my profile because I'm probably viewing yours.

    Show comments (6)
  • Photo
      10 Apr
    Poe

    Finally (and hopefully) i'm getting a team together that knows a little of this and a little of that; and maybe all my open source projects that are half written can begin to be released. :)

View All Updates
Photo
- - - - -

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

dre

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 24 July 2009 - 09:30 AM

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)

  • 0

#2 dargueta

dargueta

    CC Mentor

  • Moderator
  • 4,372 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

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