COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

• Email
• Follow

I read in section 6.1.3 of the manual:

6.1.3 Multisection support for the BIN format.
...
Nasm creates the section.<secname>.start for each section, which may

feature does not work, or it works if the section name does not begin
with a dot. I can't get it to work at all, and I think it might be
quite useful for me (assuming it does what I think it does). Can anyone
throw any light on this?

Thanks
Mike


 0
Reply spamtrap2 (1628) 1/6/2007 12:38:26 PM

See related articles to this posting

Mike Harrison wrote:
> I read in section 6.1.3 of the manual:
>
> 	6.1.3 Multisection support for the BIN format.
> 	...
> 	Nasm creates the section.<secname>.start for each section, which may
> be used in your code.
>
> feature does not work, or it works if the section name does not begin
> with a dot. I can't get it to work at all, and I think it might be
> quite useful for me (assuming it does what I think it does). Can anyone
> throw any light on this?

Sorry to say, I think it simply doesn't work. Or does it??? I just tried
it again, and it *does* seem to work. If your section name begins with a
dot, "section..mysection.start", with two dots, seems to be necessary -
I'm not sure that's "right"... (but I guess we can live with it)

The "multisection support" has gone through several evolutions. First
written by Berkus - worked for what he wanted, I guess, but didn't
please everybody. Then Mike Ter Louw took a stab at it. We designed a
"specification" first, and everything. Still had some errors, which Mike
fixed... there are alleged to still be errors, and I *thought* the
"section.name.start" thing was one of 'em... ("test/multisection.asm" is
apparently for Berkus' earlier version, and does not currently assemble)

To tell you the truth, I didn't think anyone was using this feature
newsgroup a while back - looking for examples - and didn't get any
response. I guess it's time to revisit this issue. I'll try some more
tests and try to get back to you...

Best,
Frank


 0

Frank Kotler wrote:
> Mike Harrison wrote:
>
>> I read in section 6.1.3 of the manual:
>>
>>     6.1.3 Multisection support for the BIN format.
>>     ...
>>     Nasm creates the section.<secname>.start for each section, which may
>> be used in your code.
>>
>> feature does not work, or it works if the section name does not begin
>> with a dot. I can't get it to work at all, and I think it might be
>> quite useful for me (assuming it does what I think it does). Can anyone
>> throw any light on this?
>
>
> Sorry to say, I think it simply doesn't work. Or does it??? I just tried
> it again, and it *does* seem to work. If your section name begins with a
> dot, "section..mysection.start", with two dots, seems to be necessary -
> I'm not sure that's "right"... (but I guess we can live with it)
>
> The "multisection support" has gone through several evolutions. First
> written by Berkus - worked for what he wanted, I guess, but didn't
> please everybody. Then Mike Ter Louw took a stab at it. We designed a
> "specification" first, and everything. Still had some errors, which Mike
> fixed... there are alleged to still be errors, and I *thought* the
> "section.name.start" thing was one of 'em... ("test/multisection.asm" is
> apparently for Berkus' earlier version, and does not currently assemble)
>
> To tell you the truth, I didn't think anyone was using this feature
> much. Peter Johnson, author of Yasm, asked about that in this(?)
> newsgroup a while back - looking for examples - and didn't get any
> response. I guess it's time to revisit this issue. I'll try some more
> tests and try to get back to you...

A few more rudimentary tests suggest that it *is* working, after all.
Can you give us an example of where you're having trouble, Mike?

Best,
Frank

(here's what "works for me", for example)

[map all]

org 100h

section .text
mov ax, section.foo.start
times 10h nop

section .data
db 0

section foo start=200h
db 90h


 0

Frank Kotler wrote:
> Frank Kotler wrote:
> > Mike Harrison wrote:
> >
> >> I read in section 6.1.3 of the manual:
> >>
> >>     6.1.3 Multisection support for the BIN format.
> >>     ...
> >>     Nasm creates the section.<secname>.start for each section, which may
> >> be used in your code.
> >>
> >> feature does not work, or it works if the section name does not begin
> >> with a dot. I can't get it to work at all, and I think it might be
> >> quite useful for me (assuming it does what I think it does). Can anyone
> >> throw any light on this?
> >
> >
> > Sorry to say, I think it simply doesn't work. Or does it??? I just tried
> > it again, and it *does* seem to work. If your section name begins with a
> > dot, "section..mysection.start", with two dots, seems to be necessary -
> > I'm not sure that's "right"... (but I guess we can live with it)
> >
> > The "multisection support" has gone through several evolutions. First
> > written by Berkus - worked for what he wanted, I guess, but didn't
> > please everybody. Then Mike Ter Louw took a stab at it. We designed a
> > "specification" first, and everything. Still had some errors, which Mike
> > fixed... there are alleged to still be errors, and I *thought* the
> > "section.name.start" thing was one of 'em... ("test/multisection.asm" is
> > apparently for Berkus' earlier version, and does not currently assemble)
> >
> > To tell you the truth, I didn't think anyone was using this feature
> > much. Peter Johnson, author of Yasm, asked about that in this(?)
> > newsgroup a while back - looking for examples - and didn't get any
> > response. I guess it's time to revisit this issue. I'll try some more
> > tests and try to get back to you...
>
> A few more rudimentary tests suggest that it *is* working, after all.
> Can you give us an example of where you're having trouble, Mike?
>
> Best,
> Frank
>
> (here's what "works for me", for example)
>
> [map all]
>
> org 100h
>
> section .text
> mov ax, section.foo.start
> times 10h nop
>
> section .data
> db 0
>
> section foo start=200h
> db 90h

No, it doesn't pass 0200h but 0000h.

1                                  ;Best,
2                                  ;Frank
3                                  ;(here's what "works for me",
for example)
4                                  [map all foo2.map]
5                                  org 100h
6                                  section .text
7 00000000 B8[0000]                mov ax, section.foo.start
8 00000003 BB[0400]                mov bx, start2
9 00000006 90<rept>                times 10h nop
10                                  section .data
11 00000000 00                      db 0
12                                  section foo start=200h
13 00000000 90                      db 90h
14 00000001 90                      nop
15 00000002 90                      nop
16 00000003 90                      nop
17                                  start2:
18 00000004 90                      nop
19 00000005 90                      nop
20 00000006 90                      nop

BTW, the solution to Mike's original Macro is in the other thread...

Steve


 0

spamtrap@crayne.org wrote:

....
>>(here's what "works for me", for example)
>>
>>[map all]
>>
>>org 100h
>>
>>section .text
>>mov ax, section.foo.start
>>times 10h nop
>>
>>section .data
>>db 0
>>
>>section foo start=200h
>>db 90h
>
>
> No, it doesn't pass 0200h but 0000h.
>
>      1                                  ;Best,
>      2                                  ;Frank
>      3                                  ;(here's what "works for me",
> for example)
>      4                                  [map all foo2.map]
>      5                                  org 100h
>      6                                  section .text
>      7 00000000 B8[0000]                mov ax, section.foo.start
>      8 00000003 BB[0400]                mov bx, start2
>      9 00000006 90<rept>                times 10h nop
>     10                                  section .data
>     11 00000000 00                      db 0
>     12                                  section foo start=200h
>     13 00000000 90                      db 90h
>     14 00000001 90                      nop
>     15 00000002 90                      nop
>     16 00000003 90                      nop
>     17                                  start2:
>     18 00000004 90                      nop
>     19 00000005 90                      nop
>     20 00000006 90                      nop

Hi Steve,

I'm not sure I see your point. True, the listing file is unhelpful (as
usual, IME). You got a problem with the binary? I'm looking at (ndisasm
-o100h multitest.bin>multitest.dis):

00000100  B80002            mov ax,0x200
00000103  BB0402            mov bx,0x204
00000106  90                nop
00000107  90                nop

more "nop"s and many 0s elided.

00000200  90                nop
00000201  90                nop
00000202  90                nop
00000203  90                nop
00000204  90                nop
00000205  90                nop
00000206  90                nop

That's what *I* expect to see... I'm not sure what you guys are looking
for... As Mike observed, there *are* some "issues" with the multisection
support... Waiting to hear which one he's encountered *this* time :)

> BTW, the solution to Mike's original Macro is in the other thread...

Which solution? We can tell Nasm what it needs to know (perhaps it
"should" know, but it doesn't), or do it at runtime, or use Fasm. Any
others?

Best,
Frank


 0

Frank Kotler wrote:
> spamtrap@crayne.org wrote:
>
> ...
> >>(here's what "works for me", for example)
> >>
> >>[map all]
> >>
> >>org 100h
> >>
> >>section .text
> >>mov ax, section.foo.start
> >>times 10h nop
> >>
> >>section .data
> >>db 0
> >>
> >>section foo start=200h
> >>db 90h
> >
> >
> > No, it doesn't pass 0200h but 0000h.
> >
> >      1                                  ;Best,
> >      2                                  ;Frank
> >      3                                  ;(here's what "works for me",
> > for example)
> >      4                                  [map all foo2.map]
> >      5                                  org 100h
> >      6                                  section .text
> >      7 00000000 B8[0000]                mov ax, section.foo.start
> >      8 00000003 BB[0400]                mov bx, start2
> >      9 00000006 90<rept>                times 10h nop
> >     10                                  section .data
> >     11 00000000 00                      db 0
> >     12                                  section foo start=200h
> >     13 00000000 90                      db 90h
> >     14 00000001 90                      nop
> >     15 00000002 90                      nop
> >     16 00000003 90                      nop
> >     17                                  start2:
> >     18 00000004 90                      nop
> >     19 00000005 90                      nop
> >     20 00000006 90                      nop
>
> Hi Steve,
>
> I'm not sure I see your point. True, the listing file is unhelpful (as
> usual, IME). You got a problem with the binary? I'm looking at (ndisasm
> -o100h multitest.bin>multitest.dis):
>
> 00000100  B80002            mov ax,0x200
> 00000103  BB0402            mov bx,0x204
> 00000106  90                nop
> 00000107  90                nop
>
> more "nop"s and many 0s elided.
>
> 00000200  90                nop
> 00000201  90                nop
> 00000202  90                nop
> 00000203  90                nop
> 00000204  90                nop
> 00000205  90                nop
> 00000206  90                nop
>
> That's what *I* expect to see... I'm not sure what you guys are looking
> for... As Mike observed, there *are* some "issues" with the multisection
> support... Waiting to hear which one he's encountered *this* time :)
>
> > BTW, the solution to Mike's original Macro is in the other thread...
>
> Which solution? We can tell Nasm what it needs to know (perhaps it
> "should" know, but it doesn't), or do it at runtime, or use Fasm. Any
> others?
>
> Best,
> Frank

Ah, thanks Frank, I didn't know the binary was correct, and the listing
file wasn't.

A solution to his right shift by 16 problem of a non scalar address
type.  The solution involves Casting the address to a scalar value thru
EQU in the section it is defined, and passing that scalar as the
parameter to his macro.

Steve


 0

Frank Kotler wrote:

> (here's what "works for me", for example)
>
> [map all]
>
> org 100h
>
> section .text
> mov ax, section.foo.start
> times 10h nop
>
> section .data
> db 0
>
> section foo start=200h
> db 90h

Well that's very strange... it works for me as well now, both with and
without an initial dot in the section name. In fact, I can't get it to
NOT work. So I don't know what I was doing wrong. It was a while back,
so I can't remember exactly what I was trying to do (and I obviously
found another way to do it) but I certainly remember spending ages
trying different things to get it to accept "section.<name>.start",
without success, including searching Google Groups archives for any
info.

Sorry to have wasted your time :-(

Mike


 0

Mike Harrison wrote:

....
> So I don't know what I was doing wrong.

In *my* case, the (non)problem was a stupid typo/braino.
"section.<name>.name" does *not* work! Duh! :)

....
> Sorry to have wasted your time :-(

Never a waste of time to discuss asm. *Somebody's* bound to learn something!

Best,
Frank


 0

7 Replies
294 Views

Similar Articles

12/12/2013 3:04:32 AM
page loaded in 5015 ms. (0)

Similar Artilces:

Question about using sections in NASM
Hi, I'm using NASM to write a 2 section bin format file and am trying to find an easy way to get a build-time error if the code is over a certain size. For example, I can put this at the end of my main source file: [at end of file...] %if (-$$) > 1000 %error Code too big! %endif but and$$ appear to work only with the current section. I would like to be able to access the combined size of all sections in the file. Is there a way to do this? I am using NASM 0.98.39. On an unrelated point, %error gives me a warning, not an error, and does not stop the build. How can I get it to pr... Eliminating Blank Line in Address Section of Report Hi, I have a report with Name1 and Name2 in the address section . Sometimes, Name2 is not populated with data via the query that feeds the report. Unfortunately, the blank line stays in the report. I've tried experimenting with the Can Shrink property to no avail. Any tips on eliminating blank lines the right way would be much appreciated. thanks! On Fri, 09 Jan 2004 17:26:41 GMT, "MX1" <mx1@mx1.abc> wrote: >Hi, > >I have a report with Name1 and Name2 in the address section . Sometimes, >Name2 is not populated with data via the query that feeds the repor... START: IF NOT(infiniteLoop(START)) THEN GOTO START START: IF NOT(IinfiniteLoop(START)) THEN GOTO START is function infiniteLoop() programmable? infiniteLoop(X) <-> TRUE IFF function X does not terminate infiniteLoop(X) <-> FALSE IFF function X terminates Herc ... Section lines on half section Hi, I was wondering if there is any way to remove an arrow from a section line. My current half-section line is drawn at a right angle from the origin with an arrow pointing to the left on the vertical line, and the arrow is pointing down on the horizontal line. I am just beginning to study drafting and my instructor would like me to remove the arrow from the horizontal line. I have been looking for a setting for this but cannot find any. I have also talked to my SolidWorks instructor and he does not know of any way to change the arrows. Does anyone have any suggestions? I am using SolidWorks... Starting programs when a TSSession start. Say I have a machine to which I am connecting through using RDP client(mstsc). Now everytime I connect to this machine, I would like to run some particular program, say notepad.exe, in the tssed machine, automatically. (Something similar to running programs everytime a user logs in, But I dont want that solution because, If the the user is logged on already in the tssed machine locally, the startup programs will not fire the startup programs.) Is there any way I can acheive this. -Karthick ... MAC address of an IPv6 address Hi All, I am writing a program that tests the health of a NIC card. I am creating a NDD socket (Data Link Access) which I will use to send ICMP ECHO packets to a given host. This means that my application has to build the entire packet and I have to create and add the IP/IPv6, ICMP/ 6, and MAC headers in my application. I got things to work for IP, but I am stuck with IPv6: 1) How do I find the MAC address for an IPv6 remote host? For IP, I use the SIOCGARP ioctl and get the MAC adress from the ARP cache. But IPv6 does not use ARP. there is something called neighbor discovery for IPv6, but I... Virtual Address to Physical Address Newbie here! Is there a way to convert a user's virtual address to a physical address so that I can program a Bus Master Device's DMA Controller. I want to be able to calculate the user virtual address into Page segments and update the DMA control with this information. What the easiest way to do this. Or given a virtual address how can I convert it to a physical address. ... Wait,Start, Wait,Start.... Hi to everyone, what i want to achieve is to run the depth first search algorithm(DFS) in graphs step by step. In my AWT java applet i have added a button STEP. When the user clicks on this button i want my algorithm to display the first node and then to stop. When the users clicks again on this button i want my applet to restart from where it has stopped(inside the update method), to display the second node and so on..(one step at each button click). I have added the class variable stepCount which the STEP BUTTON increases everytime is hitted. Below is the code for the B... Start Hi, everibody I need some information about a good UML & patterns tutorial. Thank u ... CPU address to OCM address translation How exactly does the address translate to an OCM address? I can't really find anything solid on the matter and I looked at the values of the DSARC register and but I couldn't really find any connection between that value and my CPU OCM addresses. I know the upper 8 bits are not used, bit I didn't understand why the lower 2 bits are discarded, is this for 32 bit alignment? Thanks in advance Jim ... how to make kdesud start when starting X Hi, When I log in to my FreeBSD 4.8 system as a regular user, member of wheel group, and startx, (KDE 3.1) I cannot start konquerorsu (File Manager - Super User Mode) unless I open a root shell, and start kdesud. �What is the accepted way to make kdesud start when kde starts? Notice that kdesud is sgid nogroup. �That has to be for a reason..? [charles@moe ~] ls -l /usr/local/bin/kdesud -rwxr-sr-x �1 root �nogroup �48400 Dec 13 07:16 /usr/local/bin/kdesud Thanks, Charles Charles Howse wrote: > Hi, > > When I log in to my FreeBSD 4.8 system as a regular user, member of wheel >...

Problem with the section counter in \sections* with beamer
Hi, Everything is in the title and illustrate by this example: \documentclass{beamer} \begin{document} \section*{Intro} \frame{\arabic{section}~\insertsection} \section{Sec1} \frame{\arabic{section}~\insertsection} \section{Sec2} \frame{\arabic{section}~\insertsection} \end{document} Isn't this behavior a bit strange? PascalJLM ...

Does anyone know if there is way to map a disks hardware address (EG /pci@1c,600000/scsi@2/disk@0,0) to it's logical address (EG /dev/dsk/c0t0d0s0)? >From what I know, the "0,0" after the '@' sign is the target and device/disk. What about the controller? Is there any way to tell that from the hardware address? Is that the "1c,600000"? If so, how does that map to 'c'? Thanks.. "Ben Bowen" <bozothedeathmachine@gmail.com> writes: >Does anyone know if there is way to map a disks hardware address (EG >/pci@1c,600000/scsi@2/disk@...

where i started?
hello ,every one. I wan't to learn 3D programing for fun, on debian linux Xfree86. I know little about OpenGl GLX GLU GLUT,but i dont know which one i prefer. Can you tel me where i started and introuce some reference on web? Thank you! emile schrieb: > hello ,every one. > > I wan't to learn 3D programing for fun, on debian linux Xfree86. I > know little about OpenGl GLX GLU GLUT,but i dont know which one i > prefer. > > Can you tel me where i started and introuce some reference on web? > > Thank you! > concluding from your post you know very ...

Starting Out
As a general hobby of mine, I've learned the basics, mostly console, of a few languages. C++, Java, PHP, etc. I make little programs for fun, but nothing great. I really would like to get better at this stuff so I could help out Mozilla or open source projects, but it's only a hobby and I have no direction. What should I do? Should I pick one language, or learn them all slowly; what books should I buy or whatever? I just need some direction. brettkushner@hotmail.com wrote: > As a general hobby of mine, I've learned the basics, mostly console, of > a few languages. C++, Java...

Images in a figure are not shown in the same \section. They are shown in some sections after it.
Hi! In my document, I have got many images and many sections. The images are in a figure like in the following example. There are so many images, that they aren't shown in their section. They are moved to the next section or to three sections after their section. So when I remove the "figure" to place them exactly into the section to where they belong to, I cannot use \label and \ref anymore, because \caption does not work anymore. How can I solve this problem? Greetings, Martin \section{test1} Look at \ref{test1} \begin{figure}[h] \centering \includegraphics[width=1\textwidth...

I want to learn OpenGL, where to start? A decent tutorial would be nice. /Michael "Michael Nielsen" <mbn@voresmail.dk> wrote in message news:bdoq75$26ne$1@news.cybercity.dk... > I want to learn OpenGL, where to start? A decent tutorial would be nice. Check out http://nehe.gamedev.net hth -- jb (replace y with x if you want to reply by e-mail) Hello, Michael! You wrote on Mon, 30 Jun 2003 09:52:01 +0200: MN> I want to learn OpenGL, where to start? A decent tutorial would be MN> nice. nehe.gamedev.net With best regards, Alex Mizrahi aka killer_storm. ...