Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
LDA #%01010101
|
||||
EOR #255
|
||||
CLC
|
||||
ADC #1 ;result: #%10101011
|
||||
22
Task/Twos-complement/6502-Assembly/twos-complement-2.6502
Normal file
22
Task/Twos-complement/6502-Assembly/twos-complement-2.6502
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
myVar equ $20
|
||||
|
||||
LDA #3
|
||||
STA myVar
|
||||
LDA #0
|
||||
STA myVar+1 ;equivalent C: uint16_t myVar = 3;
|
||||
|
||||
negate:
|
||||
LDA myVar+1
|
||||
EOR #255
|
||||
STA myVar+1
|
||||
|
||||
LDA myVar
|
||||
EOR #255
|
||||
STA myVar
|
||||
CLC
|
||||
ADC #1
|
||||
STA myVar
|
||||
;this handles the case if we started with something where the low byte was zero.
|
||||
LDA myVar+1
|
||||
ADC #0
|
||||
STA myVar+1
|
||||
Loading…
Add table
Add a link
Reference in a new issue