]>
git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/lneg.s
;
; eax = -eax
;
- .export negeax
- .importzp sreg
+ .export negeax
+ .importzp sreg
-negeax: clc
- eor #$FF
- adc #1
- pha
- txa
- eor #$FF
- adc #0
- tax
- lda sreg
- eor #$FF
- adc #0
- sta sreg
- lda sreg+1
- eor #$FF
- adc #0
- sta sreg+1
- pla
- rts
+negeax: clc
+ eor #$FF
+ adc #1
+ pha
+ txa
+ eor #$FF
+ adc #0
+ tax
+ lda sreg
+ eor #$FF
+ adc #0
+ sta sreg
+ lda sreg+1
+ eor #$FF
+ adc #0
+ sta sreg+1
+ pla
+ rts