-
Assembly selection
Is there a way that the program can be structured without jumping to a label? Or is assembly normally coded in this manner?
I always thought the use of GOTO's lead to bad programming structure, or does that only apply to higher level languages?
Code:
cmp bl,'Y' ; is al=Y?
je Prompt_Again ; if yes then display it again
cmp bl,'y' ; is al=y?
je Prompt_Again ; if yes then display it again
Somthing like...
Code:
if(bl == 'y'){
// execute code
// instead of jumping to a label or calling a method
}
Thanks for the help! :)
-
Ok i see that we can use functions and call them instead of jumping. :p
Code:
PROC AProcedure
.
. ; some code to do something
.
ret ; if this is not here then your computer will crash
ENDP AProcedure
-
Well, that depends on what you are trying to accomplish.
You need the jump statements for looping and condition testing (that is if you are going to strictly use the instruction set) because of the lack that there is no alternative. :(