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

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -