summaryrefslogtreecommitdiff
path: root/TASK3.asm
blob: e7fea45a615bf46b42b3e95721906a502b4b7228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; 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