Source code:
Machine code:
START: TIA F ; put F into A register AO ; display value of A register CAL SHTS ; play short beep (can omit "CAL") JUMP START ; restart if flag set JUMP #02 ; go to third nibble in code (flag was set by first JUMP)
All opcodes set flag except in the circumstances mentioned.
Source here.
KA
(0): hex key→Ar and flag clear if hex key pressedAO
(1): display Ar on 7-seg LEDCH
(2): Ar↔Br, Y↔ZCY
(3): Ar↔YrAM
(4): Ar→[50+Yr]MA
(5): [50+Yr]→ArM+
(6): [50+Yr]+A→Ar; flag clear if no overflowM-
(7): [50+Yr]-A→Ar; flag clear if no underflowTIA x
(8x): x→Ar (immediate x)AIA x
(9x): Ar+x→Ar (immediate x); flag clear if no overflowTIY x
(Ax): x→Y (immediate x)AIY x
(Bx): Ar+x→Yr (immediate x); flag clear if no overflowCIA x
(Cx): flag clear if x=Ar (immediate x)CIY x
(Dx): flag clear if x=Yr (immediate x)JUMP xy
(Fxy): jump to xy if flag setCAL RSTO
(E0): clear 7-seg LEDCAL SETR
(E1): turn on LED #YrCAL RSTR
(E2): turn off LED #YrCAL CMPL
(E4): bitwise complement ArCAL CHNG
(E5): Ar/Br/Yr/Zr↔A'r/B'r/Y'r/Z'rCAL SIFT
(E6): right shift Ar; flag clear if Ar was odd (!)CAL ENDS
(E7): end soundCAL ERRS
(E8): error soundCAL SHTS
(E9): short soundCAL LONS
(EA): long soundCAL SUND
(EB): play note in Ar (from 1 to E)CAL TIMR
(EC): delay (Ar+1)*0.1 sec.CAL DSPR
(ED): display [5F][5E] on the LEDsCAL DEM-
(EE): decimal subtractionCAL DEM+
(EF): decimal addition