summaryrefslogtreecommitdiff
path: root/miniasm/test8.asm
blob: f261f08fb57a975cd991d00be885697c31c22921 (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
; test8 - subroutines, saving registers to the stack

begin:
	mov ax, 1
	mov bx, 2
	mov cx, 3
	mov dx, 4
	jsr func
end:
	hlt

func:
	push ax
	push bx
	push cx
	push dx
	mov ax, 10
	mov bx, 11
	mov cx, 12
	mov dx, 13
	pop dx
	pop cx
	pop bx
	pop ax
	ret