flat assembler
Message board for the users of flat assembler.
Index
> Main > Type conversion and an out of topic question |
Author |
|
mike.dld 18 Aug 2004, 20:00
Code: struct aaa .member1 db ? .member2 dd ? ends mov ebx,[pointer_var] mov eax,[ebx+aaa.member1] or Code: struct aaa .member1 db ? .member2 dd ? ends virtual at ebx obj aaa end virtual mov ebx,[pointer_var] mov eax,[obj.member1] |
|||
18 Aug 2004, 20:00 |
|
madmatt 20 Aug 2004, 10:08
To answer your first question, use the rb,rw,rd,rq, .etc, (reserve byte,word,dword,qword, .etc) to create just the offsets into the structure object rather than defining data, like so:
Code: struct OFFSETS .offsetq rq 4 ;reserve 4 offset containing 4 qwords .offsetd rd 1 ;reserve 1 dword offset .offsetw rw 5 ;reserve offset containing 5 words .offsetb rb 64 ;reserve offset containing 64 bytes, for a string. ends mystruc OFFSETS then to access use, mov ecx,[eax+mystruc.offsetw+(3*2)] ;third offset, 3rd word size data item ( About your second question, I have some texts that tell you the steps you need to write a compiler, they are fairly old, but you may get some use out of them. |
|||
20 Aug 2004, 10:08 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.