flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > How to make a record structure addressing without +1+2+4 ?

Author
Thread Post new topic Reply to topic
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 19 Jun 2005, 00:31
Hy,
could someone help to find a better way for referencing a variable in a record?

i have a record like:
LINE width x-start y-start x-end y-end
byte word word word word

i could define a structure like

Code:
struc linestruct width,xs,ys,xe,ye
{
.w db width
.x-start dw xs
.y-start dw ys
.x-end dw xe
.y-end dw ye
}


firstline linestruct 20,300,400,340,540

    


and then address like

Code:
mov al,[firstline.w]
mov ax,[firstline.x-start]
    


now, what i cant do is if i already have a large amount of elements in my array,
somewhat like if it was defined like
Code:

TestLine: ; addresss of record
db 44  ; width
dw 433 ; x start
dw 433 ; y start
dw 433 ; x end
dw 433 ; y end

    

and addresss like
Code:
mov al,[TestLine] ; width
mov ax,[TestLine+1] ; x start
mov ax,[TestLine+3] ; y start
    

is there some function in fasm to make this [TestLine+3] to look somewhat more friendly like [TestLine.ystart] ?

this is only a cosmetic question...
Post 19 Jun 2005, 00:31
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.