flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
IronFelix 19 Jan 2005, 13:50
Snifit, let me tell what i know about it. It is not a good idea to put 1 byte to stack because it becomes unaligned.
About your words "This does not work either because (my guess) the proc macro doesn't know that it should pop a byte...". Proc macro doesn't do any pop. You can try this: myownproc: byteparam equ ebp+8 push ebp mov ebp,esp mov al,[byteparam] ; read passed parameter ; ... mov esp,ebp pop ebp retn 1 When you can call it in this way: xor eax,eax or al,[byteparam] stdcall myownproc,eax Stdcall is invoke analog, but it make 'call myownproc'. Regards. |
|||
![]() |
|
IronFelix 19 Jan 2005, 14:12
Sorry, small mistake: i used 'retn 1' to return from function and had to pass only one byte ('push byte byteparam' instead of using eax)! For my stdcall example at the end of the function must be 'retn 4'.
_________________ Flat Assembler is the best! |
|||
![]() |
|
JohnFound 19 Jan 2005, 14:15
AFAIK, you never can push one byte using the instruction "push". You can push word or dword only. The only way to push only one byte is to store it in the stack with "mov" instruction and to decrement esp by 1.
|
|||
![]() |
|
snifit 19 Jan 2005, 14:37
Big thanks guys!
I didn't realize it was such a problem with a single byte at the stack, and if I knew I'd used word or dword instead ![]() Anyways, I fixed it by using a dword value instead and by using the stdcall macro. Thanks again. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.