flat assembler
Message board for the users of flat assembler.
Index
> Main > Labels in procedures |
Author |
|
typedef 05 Aug 2011, 19:21
you mean
Code:
proc y
label1:
ret
enp
proc x
jmp y.label1
|
|||
05 Aug 2011, 19:21 |
|
LocoDelAssembly 05 Aug 2011, 20:58
mmm, odd, you should be able to define a label like ".LUT:" and use it (which would be also accessible from outside using procname.LIT), however, if it still fails then put at the beginning of the source "dummy = procname", just in case that conditional compilation is screwing things up (but everything should be OK if the LUT is accessed from the proc only).
Please post some minimal code showing the problem. |
|||
05 Aug 2011, 20:58 |
|
MattDiesel 06 Aug 2011, 19:59
Thanks guys, i have been testing on a small sample but I'm posting from an iPhone at the moment. Off the top of my head it's:
Code: format PE console Entry start Include 'win32a.inc' Section '.text' code readable Start: Call testProc.lbl Invoke ExitProcess,0 proc testProc .lbl: Invoke MessageBox,0,0,0,0 Term Endp Section imports for user32 and kernel31 That won't compile as the iPhone capitalises thinking it's helping. I'll post the exact code when I get the chance. It shouldn't matter that the proc is defined after the usage as my understanding of the fast multiuser system is that order of definition doesn't matter.[/code] _________________ Cogito Cogito Ergo Essum Last edited by MattDiesel on 07 Aug 2011, 14:31; edited 1 time in total |
|||
06 Aug 2011, 19:59 |
|
LocoDelAssembly 06 Aug 2011, 22:09
MattDiesel, then if your code above is accurate enough, your problem is that you are accessing the internal label directly but never accessing the main label (testProc). Since proc macro uses conditional compilation, you don't get defined your ".lbl:" and nothing inside the proc because there is no reference to testProc. As I've told you earlier, use "dummy = testProc" to cause a reference to be detected and force the conditional compilation to include the proc's code (note that "dummy = testProc" incurs in no run-time costs as it is a compile-time only thing).
|
|||
06 Aug 2011, 22:09 |
|
typedef 06 Aug 2011, 22:19
what if you do this
Code: proc x x1: ret endp proc y call x:x1 ret endp |
|||
06 Aug 2011, 22:19 |
|
LocoDelAssembly 06 Aug 2011, 22:28
Placing this macro after including the include files will disable conditional compilation (and I hope it won't introduce problems)
Code: macro proc [args] { common local ref match name any, args any\{ref = name\} proc args } typedef, it doesn't even compile when "y" is referenced. |
|||
06 Aug 2011, 22:28 |
|
typedef 06 Aug 2011, 22:44
^^@lol... I didn't try it at all I just thought of it. .. Well we learned something there
|
|||
06 Aug 2011, 22:44 |
|
MattDiesel 07 Aug 2011, 14:30
Thanks LocoDelAssembly, conditional compilation being the problem would make sense, though I had no idea that fasm had it though so it never occured to me.
I will try the dummy method and see if that works. It's not ideal as there is a reason I'm going for a lookup table rather than cmp ... je. Matt _________________ Cogito Cogito Ergo Essum |
|||
07 Aug 2011, 14:30 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.