1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-11-15 16:06:38 +00:00
rk65c02/test/test_emulation_adc_16bit.s
2017-02-02 21:16:31 +01:00

22 lines
436 B
ArmAsm

; 16-bit addition simple example by FMan/Tropyx
; modified by rkujawa
.org 0xC000
.set num1lo, 0x62
.set num1hi, 0x63
.set num2lo, 0x64
.set num2hi, 0x65
.set reslo, 0x66
.set reshi, 0x67
; adds numbers 1 and 2, writes result to separate location
add: clc ; clear carry
lda num1lo
adc num2lo
sta reslo ; store sum of LSBs
lda num1hi
adc num2hi ; add the MSBs using carry from
sta reshi ; the previous calculation
stp