Author Topic: Is there example for ISTRUC?  (Read 8919 times)

nobody

  • Guest
Is there example for ISTRUC?
« on: February 20, 2007, 01:59:36 PM »
Trying to relocate source from MASM to NASM but...
What to do with structures?

Need simple sample - how to insert structure. No problem to declare it, but on istruc... got parser: instruction expected. What's wrong?

nobody

  • Guest
Re: Is there example for ISTRUC?
« Reply #1 on: February 20, 2007, 06:49:32 PM »
Dunno. What did you do?

There's a pretty good example in the Friendly Manual. Quite different than the way Masm does it. If you can't figure it out, show us what's not working.

Best,
Frank

nobody

  • Guest
Re: Is there example for ISTRUC?
« Reply #2 on: February 21, 2007, 09:22:36 AM »
segment   code16
   bits 16
   align 16

struc   mt
.mtl:    resd   1
.mtw:    resw   1
   endstruc

b   resb   100

a:      istruc   mt
   at mt.mtl
   dd   0
   at mt.mtw
   dw   1
   iend

call   ccc
   resw   20

ccc:   mov   ax,bx
   retn

ends
   end

As result - parser error and no .obj

nobody

  • Guest
Re: Is there example for ISTRUC?
« Reply #3 on: February 21, 2007, 12:58:44 PM »
I'm not able to duplicate this problem. With a comma after the "at ..." line - if it's on two lines - and no comma in "at ..., dd 0" - on one line - both fail. But exactly as you show it, it assembles fine for me (warns about uninitialized garbage in section code16 in "-f bin" mode, silent in "-f obj" mode).

The only thing I can suggest is fool with comma/no comma and one line/two lines - watching where the errors occur, and see if you can figure out what Nasm doesn't like. For me, it seems to work "just like in the book", and your code is fine...

Sorry I can't be more help.

Best,
Frank