flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound 24 Jul 2003, 07:32
Hi. As I can understand, you talk about DOS programming. So, I am using following:
Code: struc Mystruc { .field1 db ? .field2 dd ? .field3 rb 256 } virtual at 0 MyStruc MyStruc ; Or see "struct" macro definition - it's the same end virtual ; then in code: ; es points to variable of type Mystruc ; gs points to second variable of type Mystruc mov eax, [es:Mystruc.field2] mov [gs:Mystruc.field2], eax ; copy field2 from first structure to second Regards |
|||
![]() |
|
Kevin_Zheng 24 Jul 2003, 12:21
Dear johnFound:
You code present a short bug, The complier will show "illeagul Instruction". Because the sources of fasm are case-sensitive. The successful code is belowing: Code: struc MyStruc { .field1 db ? .field2 dd ? .field3 rb 256 } virtual at 0 MyStruc MyStruc ;Or see "struct" macro definition - it's the same end virtual org 100H use16 ; then in code: ; es points to variable of type Mystruc ; gs points to second variable of type Mystruc mov eax, [es:MyStruc.field2] mov [gs:MyStruc.field2], eax ; copy field2 from first structure to second mov ax,4C00H int 21H Thanks your helpping.
|
|||||||||||
![]() |
|
JohnFound 24 Jul 2003, 12:53
It's not a bug, it's due to oversight. I never try to compile this code. But you take the idea as I can see, so all is OK.
![]() |
|||
![]() |
|
Chewy509 24 Jul 2003, 23:09
Thanks for clarifying that.
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.