Skip to content

Commit

Permalink
Refactor DEX and DEY to use dec.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Oct 24, 2020
1 parent 74d9404 commit 2cb068f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/mos6502/cpu_instructions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ def instructions

# DEY
0x88 => lambda {
@y = (@y - 1) & 0xff
set_nz_flags(@y)
@y = dec(@y) & 0xff
},

# TXA
Expand Down Expand Up @@ -536,8 +535,7 @@ def instructions

# DEX
0xca => lambda {
@x = (@x - 1) & 0xff
set_nz_flags(@x)
@x = dec(@x) & 0xff
},

# CPY (absolute)
Expand Down

0 comments on commit 2cb068f

Please sign in to comment.