ld a, $45 add a, $27 daa ; A becomes $72 The Z80 DAA uses carry and half-carry flags to correct the accumulator. ARM (especially Thumb and Cortex-M) does not have dedicated BCD arithmetic instructions. BCD operations must be implemented via software routines, using bit manipulation and conditional addition/subtraction.
The 8051 has a DA (Decimal Adjust) instruction that operates on the accumulator after addition. bcd commands
mov ax, 0x0405 ; unpacked 45 (AH=04, AL=05) add al, 0x03 ; add unpacked 3 → AL=08 aaa ; adjusts if AL>9, increments AH The 6502 has no dedicated BCD arithmetic instructions, but it includes a Decimal Mode flag (D flag in status register). When set, all ADC and SBC instructions automatically perform BCD arithmetic. ld a, $45 add a, $27 daa ;
sed ; enable decimal mode lda #$45 ; BCD 45 adc #$27 ; result in A = $72 (BCD 72) cld ; back to binary : The 6502’s decimal mode is famously broken on the CMOS version (65C02) but works on NMOS (original). Many emulators replicate the bug. 3.3 Z80 Processor Z80 lacks automatic BCD mode but provides DAA (Decimal Adjust Accumulator) after addition or subtraction, similar to x86. The 8051 has a DA (Decimal Adjust) instruction