I am using 32-bit NASM assembly and was wondering if there is a way to pass a defined quad number (8bytes) as a parameter to a subprogram in Nasm 32-bit assembly. I know that the stack in 32bit assembly is organized to accept defined double words (4 bytes). So I am wondering if this is even possible to do.
Example code:
section .data
x: dq 10 ;Defining x as a 8 byte number
section .bss
section .text
global asm_main
asm_main:
enter 0,0 ;Creating stack frame
push QWORD[x] ;pushing x as a parameter for the test subprogram
call test ;Calling the subprogram
add esp,8 ;Deallocating memory used by parameter
leave
ret
But when I run the code I get an error saying that (push QWORD[x])
:
instruction not supported in 32-bit mode