summaryrefslogtreecommitdiff
path: root/miniasm/test5.asm
blob: f518afb6bc31894f066a8d603b0adca99c5e5d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
; test5 - conditional jumps

begin:
	mov ax, 5
	mov bx, 5
	cmp ax, bx
	je equals
	jmp not_equals
	
equals:
	mov cx, 1
; cx is one on equality	
	jmp test2

not_equals:
	mov cx, 0
; cx is zero on inequality	

test2:
	mov ax, 5
	mov bx, 6
	cmp ax, bx
	je equals2
	jmp not_equals2
	
equals2:
	mov dx, 1
; dx is one on equality	
	jmp end2

not_equals2:
	mov dx, 0
; dx is zero on inequality	
	jmp end2

end2:
	hlt