flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
AsmGuru62
STOSB means:
1. Store byte from AL into address pointed by DI 2. Increment/Decrement DI (based on Direction Flag) to point to next byte AFTER the stored byte. |
|||
![]() |
|
LocoDelAssembly
Try this:
Code: PRINT_STATUS_KO: ror ax, 4 shr ah, 4 cmp al, 10 jbe @f add al, 7 @@: cmp ah, 10 jbe @f add ah, 7 @@: add ax, "00" mov [ERROR_CODE], ax mov dx,ERROR_CODE call write_text ret write_text: mov ah, 09h int 21h ret ERROR_CODE dw 0 db "h$" |
|||
![]() |
|
sbeng
Thank you! It does work!
I've some question: 1) where is @f label? 2) Instruction (db "h$") does not have a left label_name variable? LocoDelAssembly wrote: Try this: |
|||
![]() |
|
JohnFound
@f means "forward to the next @@ label"; @b means "backwards to the next @@ label".
IMHO, @@ labels are not very readable and possible source of mistakes and should be used only on very short distances - 1 or 2 instructions back and forward. |
|||
![]() |
|
revolution
JohnFound wrote: IMHO, @@ labels are not very readable and possible source of mistakes and should be used only on very short distances - 1 or 2 instructions back and forward. |
|||
![]() |
|
AsmGuru62
I once wrote a small loop using @@.
Then after a year or so I added some more code into the loop and some blocks of comments and the loop no longer fit into a single page of my IDE (I like 12 pts fonts, so I am not seeing much code in my IDE). I did one last addition to the loop and used the @@ again -- I did not see the full loop body! Wow! I looked for that bug for quite some time - my code started behaving randomly. It was fun (painfully fun) to debug. |
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.