; CALL ACTS LIKE A FUNCTION CALL IN C, A SUBROUTINE
; CALL COUNT AND COUNT TO C FROM B
JMP START
START: MVI B,00H ; COUNT FROM 0
MVI C,05H ; COUNT TO 5
MOV A,B ; COUNT FROM B
CALL CNT ; CALL COUNT SUBROUTINE
HLT ; HALT
CNT: CMP C ; COMPARE C TO A
RZ ; RETURN IF C==A
INR A ; A++
JMP CNT ; LOOP