flat assembler
Message board for the users of flat assembler.
Index
> Main > I don't understand ... |
Author |
|
vid 29 Nov 2005, 13:55
|
|||
29 Nov 2005, 13:55 |
|
Ilmars 29 Nov 2005, 14:09
To vid:
I don't need a string output, i need symbol's, whose ASCII code is stored in al, output. In first case (mov dl,al) output is first number $ < 5 second number. But it must be, (as in case of mov dl,36h) first number 6 > 5 second number. It's that I don't understand. |
|||
29 Nov 2005, 14:09 |
|
vid 29 Nov 2005, 14:29
If you would read link i sent you precisely, you will find out: int 21h/9: Return: AL = 24h (the '$' terminating the string, despite official docs which state that nothing is returned)
Code: mov ah,9h mov dx,text1 int 21h ;this returns with al='$' |
|||
29 Nov 2005, 14:29 |
|
Madis731 29 Nov 2005, 14:55
What he's telling you is that your al gets deleted from returning from int 21h so you are declaring al too soon. Here's code for example:
Code: org 100h ; mov al,36h ;This is too soon - it gets lost mov bl,35h mov ah,9h mov dx,text1 int 21h ; mov ah,2h mov ax,0236h ;You can define both (ah,al) here mov dl,al ;al is 36h here and so will dl int 21h mov ah,9h cmp al,bl jbe first_below_or_equal mov dx,above jmp continue first_below_or_equal: je both_are_equal jmp first_is_below first_is_below: mov dx,below jmp continue both_are_equal: mov dx,equal continue: int 21h mov ah,2h mov dl,bl int 21h mov ah,9h mov dx,text int 21h int 20h text1 db "first number $" bigger db " > $" equal db " = $" below db " < $" text2 db " second number $" Try that |
|||
29 Nov 2005, 14:55 |
|
Ilmars 30 Nov 2005, 09:41
Very big thank for you both (Madis731 and vid) !!
Now it's OK. |
|||
30 Nov 2005, 09:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.