flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > complex struct. How do ? |
| Author |
|
|
Roman 10 Aug 2026, 16:53
Code: struc affaf [x] { .x dd 0 } struct frettt life affaf x,y,z ;fasm error alredy defined frettt.life.x ends jumpii frettt |
|||
|
|
Roman 10 Aug 2026, 17:11
I try this but error
Code: struc affaf x { irp r,x \{ ;display r r dd 0 \} } struct frettt life affaf <.x,.y,.z> ends jumpii frettt mov [jumpii.life.x],1 ;undefined jumpii.life.x mov [jumpii.life.y],2 ;undefined jumpii.life.y |
|||
|
|
Roman 10 Aug 2026, 17:23
This work !
Code: struc affaf pp { irp r,pp \{ ;display pp r dd 0 \} } struc frettt { .x affaf <.life.x,.life.y,.life.z> } jumpii frettt ;in code mov [jumpii.life.x],1 mov [jumpii.life.y],2 mov [jumpii.life.z],3 mov [jumpii.x],3 ;= mov [jumpii.life.x],3 |
|||
|
|
Roman 11 Aug 2026, 04:36
Code: macro zero@Struct ss { local up mov eax,ss#.bgn up: if ss#.Type = 1 mov dword [eax],0 add eax,4 end if if ss#.Type = 0 ;byte mov byte [eax],0 inc eax end if if ss#.Type = 2 mov dword [eax],1.0 add eax,4 end if cmp eax,ss#.end jnz up } macro cs@. v,n { if v#.Type = 1 mov dword [v],n end if if v#.Type = 0 mov byte [v],n end if if v#.Type = 2 mov dword [v],n#f end if } struc csafint pp { irp r,pp \{ ;display pp r dd 0 r\#\.Type equ 1 \} } struc csafbyte pp { irp r,pp \{ r db 0 r\#\.Type equ 0 \} } struc csaflt pp { irp r,pp \{ ;display pp r dd 0 r\#\.Type equ 2 \} } struc complexStructF { .life.bgn csafint <.life.x,.life.y> .life.end: .life.Type equ 1 ;int .pos.bgn csaflt <.pos.x,.pos.y,.pos.z> .pos.end: .pos.Type equ 2 ;float } jumpii complexStructF mov eax,jumpii.life.x.Type mov eax,jumpii.pos.x.Type cs@. jumpii.life.x , 2 cs@. jumpii.pos.z , 2 zero@Struct jumpii.life zero@Struct jumpii.pos |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.