Skip to content

Commit

Permalink
NASM test for push [reg, r/m, imm] and pop reg are all tested
Browse files Browse the repository at this point in the history
With ENABLE_JIT_ALWAYS set, it effectively tests all variants (is_32 +
imm/reg/rm) of the instruction.

Stack size variation should also be tested in the future.

See WASM dump for optimized versions here:

https://gist.github.com/AmaanC/c5c5f9d76bef589a7fbb0f4af3b15e64
  • Loading branch information
AmaanC authored and copy committed Jul 22, 2020
1 parent 843527a commit b2e44e2
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/nasm/push.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
global _start

section .data
align 16
myquad:
dq 0x1234567890abcdef
mydword:
dd 0xcafebabe
myaddress:
dd 0xdeadbeef

%include "header.inc"

;; push r/m - push edx
db 0xff
db 0xf2

;; push r/m - push bx
db 0x66
db 0xff
db 0xf3

push 0xdeadbeef
push WORD 0xd00d
push DWORD [myaddress]

lea eax, [myaddress]
push WORD [eax]

mov ecx, 0xcafe
push cx
push ecx

xor eax, eax

pop ax
pop eax
pop cx
pop ecx
pop dx
pop ebx
pop si
pop di

%include "footer.inc"

0 comments on commit b2e44e2

Please sign in to comment.