; bcd_add.asm
; add two 4bit numbers on the Intel 4004
; bcd-wise
 FIM R0R1, 0x78 ; initialize R0=8 & R1=7
 FIM R2R3, 0    ; clear result pair
 LD R0     	; load R0 into accumulator
 ADD R1    	; add second number
 DAA   	        ; decimal adjust accumulator
 XCH R2     	; store new result in R2
 TCC		; transmit carry to accu, clear carry
 XCH R3		; store carry bit in R3
done:
 JUN done       ; end
