Files

31 lines
496 B
NASM

; # pusha
; # popa
; Push and restore the following registers using the stack:
; EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI
; This is important for example in the C calling convention,
; where certain registers must not be changed by functions.
%include "lib/asm_io.inc"
ENTRY
mov ebx, 0
mov ecx, 0
mov eax, esp
pusha
sub eax, esp
; 8x 4 bytes
ASSERT_EQ 32
mov ebx, 1
mov ecx, 1
popa
ASSERT_EQ ebx, 0
ASSERT_EQ ecx, 0
EXIT