; test8 - subroutines, saving registers to the stack begin: mov ax, 1 mov bx, 2 mov cx, 3 mov dx, 4 jsr func ; the subroutine saves all registers to the stack, modifies them and ; then restores them to their original value ; while in the subroutine we should se 04 03 02 01 0a on the stack ; (the registers and the return address 0a) 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