Hi,

advertisement
Hi,
I'll write all the email in english because its much more comefortable
A. The strange jmp is at :
0114 JNZ 0103
its jump to 103 in the memory because "29D2 = xor dx,dx"(set dx=0).
B. Int 29 - fast write( put a character on the screen) AL = character to
write .
C.
0100 MOV
CH,0D
'Set CH=0D for the loop
0102 MOV
BP,D229
'Set BP=D229 for the division, Set dx=0 in
the jump to 103
0105 MOV
DI,CX
'Set DI=CX from where to load ( lodsw)
0107 PUSH CX
0108 LODSW
'Transfer a word from ds:si to ax and
incremente di
0109 DIV
BP
'AX= DX:AX div BP ,DX=DX:AX mod BP
010B STOSW
'Transfer the vaule from ax to ES:DI and increment di
010C LOOP 0108
010E POP
SI
010F MOV CX,SI
'Set =CX,SI for the loop
0111 INC
WORD PTR [SI]
0113 DEC
BP
0114 JNZ
0103
'check if bp==0 if not jump to 103
I didnt understand very well the paragraph, I mean i know all the comamnds
but i cant write in one sentence what the paragraph do. I think that the
paragraph load words from the memory and transfer them to another place.
0116 LODSW
0117 MOV BL,10 ; jumping 16 times
0119 ROL AX,1
; Rotate Left
011B PUSH AX
011C AND AL,01 ; keep only the first bit of AL
011E ADD AL,30 ; if al=0 then al='0' or if al=1 then al='1'
0120 INT 29
;Interupt number 29 print the char from al to the
screen
0122 POP AX
0123 DEC BX
;BX=BX-1
0124 JNZ 0119
; if BX=! 0 then jump to 119
0126 LOOP 0116
The paragraph transfers word from DS:SI to AX and print the vaule of it in
binray (16 bits)
and this part can written in another way:
--------------------------------nextword:
LODSW
MOV BX,08
nextbit:
RCL AX,1
; Rotate Carry Left
PUSH AX
XOR AL,AL
ADC AL,30 ; add AL=CF+30+AL
INT 29
;Interupt number 29 print the char from al to the screen
POP AX
DEC BX
;BX=BX-1
JNZ nextbit
LOOP nextword
--------------------------------Alon Klein
Download