summaryrefslogtreecommitdiff
path: root/miniasm/test4.asm
blob: ebdd9540aa8f96a2f3a2abf40b5c911c809dce5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; test4 - integer arithmetics and logical operations

begin:
	mov ax, 5
	mov bx, 3
; ax should be 8
	add ax, bx
	mov cx, 1
	sub ax, cx
; ax should be 7
	or ax, 64
; ax should be 00000111 | 010000000 = 01000111 (0x47)
	mov dx, 8
	add dx, 19
; dx should be 27 (0x1b)
	and dx, 15
; dx should be 00011011 & 00001111 = 00001011 (0xb)
	not dx
; ~ 00001011 - 11110100 (0xf4)
	jmp end

end:
	hlt