I couldn't decide whether it would be better to save A and B on the caller side or on the __abx/adx side. Here, pshb/psha are omitted as they are saved on the caller side.
;
; Adds the value of the accumulator to X.
; messing up D
;
.export __abx
.export __adx
.code
__abx:
stx @tmp ; X where we can manipulate it
addb @tmp+1
adca #0
stab @tmp+1
staa @tmp
ldx @tmp
rts
__adx:
stx @tmp ; X where we can manipulate it
addb @tmp+1
adca @tmp
stab @tmp+1
staa @tmp
ldx @tmp
rts
When compiling a program with a large local array, tracking of A and B fails. I added invalidate_work(), but there must be a better way.
I couldn't decide whether it would be better to save A and B on the caller side or on the __abx/adx side. Here, pshb/psha are omitted as they are saved on the caller side.
When compiling a program with a large local array, tracking of A and B fails. I added invalidate_work(), but there must be a better way.