Search this site

Monday, April 4, 2011

TASM 2

thank to Adiguna
now I know how to print word

---------------------------------------------------

TData : JMP Prosess ; jump to Process
; first save the word in a label (example : Tes)
Tes DB 'D_FREAK'

Prosess:
LEA BX,Tes ; To get the first address from Tes
MOV CX,7 ; How many character you want to print

Looping:
MOV DL,[BX] ; move BX to DL
MOV AH,02h ; The service to print character
INT 21h ; Do the service!!
ADD BX,1 ; BX:=BX+1 or BX move to the next character's address
LOOP Looping ; Back to Looping
INT 20h
END TData

---------------------------------------------------

and about add I stil don't know much

they say just write
debug (yourfile).com
after compilation

then press
r,enter -> to see value all registers
t,enter -> to run the instruction one by one
q,enter -> to quit from debug

2 comments:

  1. there is easier way
    1. end your word label using $ character , yours would be 'D_FREAK $'
    2. load its address content using into register dx using lea dx, Tes
    3. print it using interrupt 21h service 09h
    :D

    ReplyDelete
  2. Nice I've try it this morning

    ReplyDelete