os-tutorial icon indicating copy to clipboard operation
os-tutorial copied to clipboard

Minor: three jump after conditionals

Open ern0 opened this issue 7 years ago • 1 comments

Location: https://github.com/cfenollosa/os-tutorial/tree/master/05-bootsector-functions-strings

cmp ax, 4      ; if ax = 4
je ax_is_four  ; do something (by jumping to that label)
jmp else       ; else, do another thing
jmp endif      ; finally, resume the normal flow    ######### control never gets here, delete this line pls

ax_is_four:
    .....
    jmp endif

else:
    .....
    jmp endif  ; not actually necessary but printed here for completeness

endif:

You should remove line marked with "#"s.

ern0 avatar Sep 22 '18 19:09 ern0

He would be using the jmp endif if for some reason jmp else doesn't work (i guess) :sweat_smile:

AtieP avatar Mar 14 '20 18:03 AtieP