xot: ld c,4 ; CNT := 4; xotloop:xor a ; CARRY := 0; A := 0 [clear A, CARRY]; add hl,hl ; Shift four bits of ANSWER rla ; into A using add hl,hl ; two bvte addition rla ; with CARRY add hl,hl ; receiving each rla ; bit from the high add hl,hl ; order due to overflow; rla cp 10 ; is A LT 10 [test for numeric digit]? jp c,xotascii ; if so then go form ASCII character code; add a,7 ; if not then A := A + 7 [adjust to alpha]; xotascii: add a,'0' ; A := A + '0' [convert to ASCII code]; call put ; OUTPUT :=A; dec c ; CNT := CNT - 1; jp nz,xotloop ; if CNT NE 0 then repeat; ret ; else return to caller;