flat assembler
Message board for the users of flat assembler.

flat assembler > Windows > Extended the Struct Macro

Author
Thread Post new topic Reply to topic
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Dear All:
We kown that struc syntax is very diffcult on FASM. So Privalov writed a "struct" macro for solution some struct paramters question. But it doesn't support the sturct needed multi paramters. So I modified it. And I think it maybe helpping for you.
Thanks the excellect working of Privalov. Please see the belowing code:
Code:
; structure definition helper
macro struct  name,[Arg]
{    
common
  virtual at 0
        if      ~Arg    eq
          name    name    Arg
 else
                name    name
        end if
      sizeof.#name = $ - name
     name equ sizeof.#name
       end virtual 
}

struc     Descriptor      LimitL,BaseL,BaseM,Attributes,BaseH
{
       .LimitL         DW      LimitL  
    .BaseL          DW      BaseL
       .BaseM          DW      BaseM
       .Attributes     DW      Attributes
  .BaseH          DW      BaseH
}
struct       Descriptor,?,?,?,?,?

struc       Gate    OffsetL,Selector,Dcount,Gtype,OffsetH
{
     .OffsetL        DW      OffsetL 
    .Selector       DW      Selector
    .Dcount         DW      Dcount
      .Gtype          DW      Gtype
       .OffsetH        DW      OffsetH
}
struct     Gate,?,?,?,?,?
struc Pdesc   LimitL,Base
{
       .LimitL         DW      LimitL
      .Base           DW      Base
}
struct        Pdesc,?,?
struc      TaskSS  
{
  .TRLink         DW      ?,0
 .TRESP0         DD      ?
   .TRSS0          DW      ?,0
 .TRESP1         DD      ?
   .TRSS1          DW      ?,0
 .TRESP2         DD      ?
   .TRSS2          DW      ?,0
 .TRCR3          DD      ?
   .TREIP          DD      ?
   .TREFLAG        DD      ?
   .TREAX          DD      ?
   .TRECX          DD      ?
   .TREDX          DD      ?
   .TREBX          DD      ?
   .TRESP          DD      ?
   .TREBP          DD      ?
   .TRESI          DD      ?
   .TREDI          DD      ?       
    .TRES           DW      ?,0
 .TRCS           DW      ?,0
 .TRSS           DW      ?,0
 .TRDS           DW      ?,0
 .TRFS           DW      ?,0
 .TRGS           DW      ?,0
 .TRLDT          DW      ?,0
 .TRFLAG         DW      ?,0
 .TRIOMAP        DW      $+2
}
struct TaskSS
    
Post 13 Aug 2003, 12:32
View user's profile Send private message MSN Messenger 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-2019, Tomasz Grysztar.

Powered by rwasa.