From: Jacques M. <jac...@gm...> - 2005-11-12 00:06:45
|
Hi, Can anyone give me an example of how to use section.<secname>.start? I tried this: ------ test.asm ------- section mysection mysectionsize equ $ - section.mysection.start -------------------------- This will tell me section.mysection.start wasn't defined prior to its use..= . What's wrong? Thanks! Jacques Mony (V2_OS project) |
From: Frank K. <fbk...@co...> - 2005-11-12 01:47:13
|
Jacques Mony wrote: > Hi, > > Can anyone give me an example of how to use section.<secname>.start? > > I tried this: > > ------ test.asm ------- > > section mysection > > mysectionsize equ $ - section.mysection.start > -------------------------- > > This will tell me section.mysection.start wasn't defined prior to its use... > > What's wrong? Dunno. I can confirm that it happens. I *think* you're doing everything right. If I add the "-O" switch, the error message changes to "invalid operand type". I suspect a bug. I'll pass this on to the developer's list, and see if anyone has any ideas... Thanks for testing the multisection support and letting us know! Best, Frank |
From: anonymous c. <nas...@ya...> - 2005-11-13 18:00:00
|
Frank, > > section mysection > > mysectionsize equ $ - section.mysection.start > > > > This will tell me section.mysection.start wasn't defined prior to its use... > > > > What's wrong? > > Dunno. I can confirm that it happens. I *think* you're doing everything > right. If I add the "-O" switch, the error message changes to "invalid > operand type". I suspect a bug. I'll pass this on to the developer's > list, and see if anyone has any ideas... The section.<name>.start label is defined by bin_define_section_labels() in outbin.c. However, that function isn't called until after the second pass has been completed -- see line 1227. As a result, with the traditional two passes, EQU can't find the label during the first pass. And since EQU's operand is a critical expression you get the "symbol `<name>` not defined before use" error. With additional passes you get the "invalid operand type" warning; it happens to be the first of the two in parser.c, in line 690. __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com |
From: Jacques M. <jac...@gm...> - 2005-11-13 18:43:56
|
I'd like to retrieve a section size (in fact, multiple sections size) from another section (which relocated the other sections). Is section.<secname>.start supposed to be the solution? Should we, instead, do this: section mysection mysectionsize: dd $ - section.mysection.start And later user [mysectionsize] ? Will I be able to access it from another section without some weird %define calculations? On 11/13/05, anonymous coward <nas...@ya...> wrote: > Frank, > > > section mysection > > > mysectionsize equ $ - section.mysection.start > > > > > > This will tell me section.mysection.start wasn't defined prior to its= use... > > > > > > What's wrong? > > > > Dunno. I can confirm that it happens. I *think* you're doing everything > > right. If I add the "-O" switch, the error message changes to "invalid > > operand type". I suspect a bug. I'll pass this on to the developer's > > list, and see if anyone has any ideas... > > The section.<name>.start label is defined by bin_define_section_labels() > in outbin.c. However, that function isn't called until after the second > pass has been completed -- see line 1227. > > As a result, with the traditional two passes, EQU can't find the label > during the first pass. And since EQU's operand is a critical expression > you get the "symbol `<name>` not defined before use" error. > > With additional passes you get the "invalid operand type" warning; it > happens to be the first of the two in parser.c, in line 690. > > > > __________________________________ > Yahoo! FareChase: Search multiple travel sites in one click. > http://farechase.yahoo.com > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. Downl= oad > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Nasm-users mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-users > -- Jacques Mony Programmeur-Analyste Les services conseils Syst=E9matix inc. |
From: H. P. A. <hp...@zy...> - 2005-12-29 23:04:37
|
Frank Kotler wrote: > Jacques Mony wrote: > >> Hi, >> >> Can anyone give me an example of how to use section.<secname>.start? >> >> I tried this: >> >> ------ test.asm ------- >> >> section mysection >> >> mysectionsize equ $ - section.mysection.start >> -------------------------- >> >> This will tell me section.mysection.start wasn't defined prior to its >> use... >> >> What's wrong? > > > Dunno. I can confirm that it happens. I *think* you're doing everything > right. If I add the "-O" switch, the error message changes to "invalid > operand type". I suspect a bug. I'll pass this on to the developer's > list, and see if anyone has any ideas... > > Thanks for testing the multisection support and letting us know! > Okay, sorry for chiming in way, way late... The reason it doesn't work is because section.mysection.start isn't seen by the assembler and linker as being in the same section as $. Remember that outbin is really a linker. In the case above, it's equivalent to $-$$, but the assembler doesn't know that, and if it had been a *different* section, it wouldn't have been able to resolve it. -hpa |