flat assembler
Message board for the users of flat assembler.
Index
> Windows > strange problem with messagebox |
Author |
|
typedef 30 May 2012, 20:58
try using
Code: jmp printeax Code: call printeax |
|||
30 May 2012, 20:58 |
|
revolution 30 May 2012, 22:19
You didn't show all of your code so we have to assume some things not given. Is your code section posted inside a proc/endp section? If it is then the problem is caused by the ret. Use retn to avoid instantiating the ret macro:
Code: printeax: cinvoke wsprintf,my_string_buffer,fmtprt,eax invoke MessageBox,[hwnd],my_string_buffer,_caption,MB_ICONERROR+MB_OK retn ; <--- don't use the ret macro here |
|||
30 May 2012, 22:19 |
|
shutdownall 31 May 2012, 11:59
revolution wrote: You didn't show all of your code so we have to assume some things not given. Is your code section posted inside a proc/endp section? If it is then the problem is caused by the ret. Use retn to avoid instantiating the ret macro: Okay you are right. It was in a proc section (Window Proc) and I didn't expect that ret is a macro instruction as it is also an official assembling instruction. Works fine now with retn. |
|||
31 May 2012, 11:59 |
|
shutdownall 31 May 2012, 12:02
typedef wrote: try using That didn't help and I want to call a simple subroutine. Okay now it's not much code which could be copied several times but it was more to understand principals than getting some workaround. |
|||
31 May 2012, 12:02 |
|
typedef 31 May 2012, 17:14
Then set up your calling right like revolution suggested.
|
|||
31 May 2012, 17:14 |
|
shutdownall 31 May 2012, 21:38
As you can read - i did and it worked.
I just wanted to let you know, that simply jmp instead of call is not working - with ret. |
|||
31 May 2012, 21:38 |
|
typedef 01 Jun 2012, 02:39
shutdownall wrote: As you can read - i did and it worked. lol. Dude, I assumed that you knew you don't mix jmp with ret. If you JMP to X you have to JMP back to Y and not RET. I thought you knew that. You fixed it so let's move on. |
|||
01 Jun 2012, 02:39 |
|
shutdownall 01 Jun 2012, 09:57
As I know the difference between GOSUB/RETURN and GOTO I assume it is similar to call and jmp.
|
|||
01 Jun 2012, 09:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.