Saving registers using double

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

8)

I am using a lot of registers (almost all lower, one left), so now I use doubles.
Program size increases a littlebit.
How can I do the next piece of code shorter?

----------->8
sbrc	toggle, 0			;if bit0 = 1,
rjmp	pickLch				; -> result in L-ch
mov	accR, accL			;else result in R-ch
pop	accL				;restore value L-ch
rjmp	exitADC				;& exit
pickLch:
pop	accR				;restore value R-ch
exitADC:
inc	toggle				;& toggle bit0
ret

:roll: :?: