2 ; Ullrich von Bassewitz, 05.08.1998
3 ; Christian Krueger, 11-Mar-2017, spend two bytes for one cycle, improved 65SC02 optimization
5 ; CC65 runtime: add ints
8 ; Make this as fast as possible, even if it needs more space since it's
11 .export tosadda0, tosaddax
21 .if (.cpu .bitand ::CPU_ISET_65SC02)
39 adc (sp),y ; (9) lo byte
41 sta tmp1 ; (14) save it
43 adc (sp),y ; (21) hi byte
51 L1: lda tmp1 ; (39) restore low byte
54 rts ; (6502: 45 cycles, 26 bytes <-> 65SC02: 42 cycles, 22 bytes )