flat assembler
Message board for the users of flat assembler.

Index > Main > Syntax error on this struc, why?

Author
Thread Post new topic Reply to topic
StringCheesian



Joined: 20 Feb 2004
Posts: 20
StringCheesian
Code:
struc segmentDescriptor segBase, segLength, flags
{
   .length0_15   dw   (segLength & 0x0FFFF)
   .base0_15     dw   (segBase & 0x0000FFFF)
   .base16_23    db  ((segBase & 0x00FF0000) >> 16)
   .flags        dw (((segLength & 0xF0000) >> 8) | flags)
   .base24_31    db  ((segBase & 0xFF000000) >> 24)
}    

This struc takes a 32 bit base and 20 bit length and splits each up into the appropriate feilds.

But it doesn't work! Instead I get this:
Code:
flat assembler  version 1.51
test.asm [78]:
   a segmentDescriptor 0,0,0
test.asm [23] segmentDescriptor [1]:
   .length0_15   dw   (segLength & 0x0FFFF)
error: invalid argument.    

I just want FASM to deal with the weirdness of the descriptor format for me. Am I doing something wrong? Should I use a macro instead?
Post 22 Feb 2004, 00:41
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
&, >> are not proper symbols

use AND and shr

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 22 Feb 2004, 01:09
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
StringCheesian



Joined: 20 Feb 2004
Posts: 20
StringCheesian
AND would be bitwise not logical, right?
Post 22 Feb 2004, 01:36
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
yes, bitwise

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 22 Feb 2004, 02:00
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
StringCheesian



Joined: 20 Feb 2004
Posts: 20
StringCheesian
Thanks!
Post 22 Feb 2004, 06:24
View user's profile Send private message Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy
Also, you should use "or" instead of "|"... Wink
Post 22 Feb 2004, 08:33
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.