Hi, hope i got the terminology right above
anyway, ive just written a small snippet of code for doing a prime test on a number. Now i want this to be called (i dont know if im still allowed to call it a function in asm, lol) and i want to push either a 0 or 1 on the stack depending on the result of the test. Now, i just though about this, but if i simply go
push 1
then what goes on the stack. Is it a BYTE, WORD, DWORD ect. This would of course be useful to know when popping the value again in the calling function.
In 32-bit code a DWORD would be pushed.
print uhex$(esp),13,10
push 1
print uhex$(esp),13,10
pop eax
print uhex$(eax),13,10
0012FFC0
0012FFBC
00000001
ok thx
And, of course, in 16-bit code a WORD is always pushed - you can't PUSH a BYTE
.data
 a_byte db 1
.code
 push a_byte
error A2070: invalid instruction operands
But with INVOKE, you can (indirectly)
my_proc proto c x:byte
.data
 a_byte db 1
.code
 invoke my_proc,a_byte
;the invoke gets translated as
;Â mov al,a_byte
;Â push ax
;Â call my_proc