NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: nobody 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?
-
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
-
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
-
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