loops - Assembly Language MASM jumping -
.386 .model flat exitprocess proto near32 stdcall, dwexitcode:dword include io.h cr equ 0dh lf equ 0ah .stack 4096 .data string byte 40 dup (?) number dword ? rejected byte cr, lf, "rejected", 0 .code _start: forever: input string, 40 atod string mov number, eax cmp number,0 jne processing je finish processing: cmp number,10 jg message cmp number,-10 jl message jmp forever message: output rejected jmp forever finish: invoke exitprocess, 0 public _start end
i'm having difficulty adjusting assignment meet condition: make sure jump forward bottom of loop, , there top, every jump top comes same place.
i have accomplished task seem jumping multiple places. how adjust program meet condition.
you need change code have one jmp forever
. label can jump several places jmp forever
. suggestion:
processing: cmp number,10 jg message cmp number,-10 jl message jmp skipmsg message: output rejected skipmsg: jmp forever
Comments
Post a Comment