flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
edfed 11 Dec 2007, 05:52
when building a dot, you know the structure, X,Y
when building a box, you know the structure X,Y,XL,YL,color when building a 3D poligon, you know the structure P1,P2,P3 etc etc... i don't use the struct macro. structure can be done with memory directive and a related equate ??. Code: point: ;related equate X=0 Y=4 points: ;structure .1 dd 0,0 ;one point .2 dd 4,8 onedot dd 10,10 mov esi,points mov eax,[esi+point.X] add esi,8 mov ebx,[esi+point.Y] mov esi,onedot mov ecx,[esi+point.Y] there are frequent bugs when structure is not clear but with this i don't need the struct directive... ![]() |
|||
![]() |
|
revolution 11 Dec 2007, 07:21
dosin: struc and struct are entirely different things. you have mixed them together in your post.
struc is an assembler preprocessor directive. It is similar to 'macro' with one minor difference that the expanded structure must have a naming label. struct (with the extra 't') is a macro if you include the standard fasm file 'struct.inc'. If you don't include this file then struct is undefined. Also the struct macro as used in the fasm include file does not use the curly braces {}, you should terminate it with 'ends' and don't use the dots for the internal labels. Code: ;define the macro structure struct THREE_D x dd ? y dd ? z dd ? ends ;instantiate it my_point THREE_D ;access a value mov rax,[my_point.x] |
|||
![]() |
|
dosin 11 Dec 2007, 08:04
lol! struct from programming C/C++... from typing it so much I added the t.
I just have never used the struct in asm I have seen it a few times but not known how to use it! Well I can't use macros.. I am thinking I have a way around not using it! Thanks for both the post! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.