2 ; Ullrich von Bassewitz, 07.04.2000
4 ; CC65 runtime: += operator
6 ; On entry, the low byte of the address of the variable to increment is
7 ; in ptr1, the high byte is in Y, and the increment is in eax.
10 .export laddeq1, laddeqa, laddeq
11 .importzp sreg, ptr1, tmp1
22 laddeq: sty ptr1+1 ; Store high byte of address
23 ldy #$00 ; Address low byte
28 pha ; Save byte 0 of result for later
32 adc (ptr1),y ; Load byte 1
48 pla ; Retrieve byte 0 of result