Add carry flag "threading"
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
54bd10f913
commit
db5aeb333c
1 changed files with 2 additions and 2 deletions
|
@ -184,13 +184,13 @@ module Hence
|
||||||
when 0x08 # shr
|
when 0x08 # shr
|
||||||
@reg_tmp = @reg_a >> @reg_b
|
@reg_tmp = @reg_a >> @reg_b
|
||||||
when 0x09 # add
|
when 0x09 # add
|
||||||
@reg_tmp = @reg_a &+ @reg_b
|
@reg_tmp = @reg_a &+ @reg_b &+ (@reg_s & 0b00000001_u8)
|
||||||
@reg_s &= 0b11111110_u8
|
@reg_s &= 0b11111110_u8
|
||||||
if @reg_tmp < @reg_a
|
if @reg_tmp < @reg_a
|
||||||
@reg_s |= 0b00000001_u8
|
@reg_s |= 0b00000001_u8
|
||||||
end
|
end
|
||||||
when 0x0a # sub
|
when 0x0a # sub
|
||||||
@reg_tmp = @reg_a &- @reg_b
|
@reg_tmp = @reg_a &- @reg_b &- (@reg_s & 0b00000001_u8)
|
||||||
@reg_s &= 0b11111110_u8
|
@reg_s &= 0b11111110_u8
|
||||||
if @reg_tmp > @reg_a
|
if @reg_tmp > @reg_a
|
||||||
@reg_s |= 0b00000001_u8
|
@reg_s |= 0b00000001_u8
|
||||||
|
|
Loading…
Reference in a new issue