You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working with a pretty basic multiplication code when I encountoured that my code is failing for higher values of a particular operand. After investigating, I found that the dcr operation sets the S flag to 1 for values in register higher than 80h. This is obviously a bug, since S flag should be set only if dcr is operating on 00h register entry. Please look into this. Here's my code for error reproduction:
;<Multiplication Program>
jmp load
;data
num: db 0ffh, 81h
res: db 00h, 00h
;code
load: nop
lhld num
xchg
mov c, d
mvi d, 0h
lxi h, 0000h
main: nop
dcr c
jm end
dad d
jmp main
end: nop
shld res
hlt
The text was updated successfully, but these errors were encountered:
torishabhmehta
changed the title
DCR instruction doesn'y work properly after 80h
DCR instruction doesn't work properly after 80h
Apr 14, 2020
The code works perfectly for values in num+1 less than/equal to 80h. The dcr operation acting on higher values than that simply sets the S flag, which triggers the jm command
I was working with a pretty basic multiplication code when I encountoured that my code is failing for higher values of a particular operand. After investigating, I found that the dcr operation sets the S flag to 1 for values in register higher than 80h. This is obviously a bug, since S flag should be set only if dcr is operating on 00h register entry. Please look into this. Here's my code for error reproduction:
The text was updated successfully, but these errors were encountered: