flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 17 Jul 2017, 17:11
Yes, this is something that could work with fasmg but not with fasm 1, where sizes can only be specified with size operators and no other values are allowed.
|
|||
![]() |
|
Azagaros 17 Jul 2017, 17:16
Do you have fasmg with your simple windows editor? I was looking for fasm 1 solutions because of this issue...
|
|||
![]() |
|
ProMiNick 17 Jul 2017, 19:10
FASMG & FASM - AllInOne, all sources,all includes. All workable, all portable (whole package I mean).
FASMW used as editor and compilation launcher for both fasm & fasmg sources. https://board.flatassembler.net/topic.php?t=19966 But my example it is only for windows. Because it uses BAT files for automation. How to play with it?: unzip all & run Init.bat (it will adapt package to current directory, all params go to fasmg.ini not to registry). fasmg not uses fasmg.ini, but automation scripts uses it. Last edited by ProMiNick on 01 Aug 2017, 14:22; edited 1 time in total |
|||
![]() |
|
ProMiNick 19 Jul 2017, 11:56
Post removed.
Here was attached outdate version of package FASM1 FASMG AllInOne. Newer version always refered by link in above post. _________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||
![]() |
|
donn 09 Oct 2018, 20:59
Is there an include needed to use struc with fasmg?
The format I'm assembling (successfully) is MS64 COFF and each time I define a struc, I get: Code: fasmg APP.asm APP.obj flat assembler version g.i4pue APP.asm [4] macro format [201] include/format/coffms.inc [231]: NumberOfSections dw NUMBER_OF_SECTIONS Processed: NumberOfSections dw NUMBER_OF_SECTIONS Error: symbol 'NUMBER_OF_SECTIONS' is undefined or out of scope. Example strucs: Code: struc ListItem{ .item dq 0 .previous dq 0 .next dq 0 .itemSize dq 0 } struc List{ .firstItem dq 0 .listSize dq 0 .itemsCount dq 0 .index dq 0 .indexItem dq 0 .indexedItemIndex dq 0 } I'm still looking to resolve this and will edit this if I come across a resolution. |
|||
![]() |
|
revolution 10 Oct 2018, 00:22
fasmg does not use the curly brackets "{}" for structure definitions. Those are fasm syntax.
|
|||
![]() |
|
Tomasz Grysztar 10 Oct 2018, 08:26
The curly braces are the syntax of fasm's preprocessor. fasmg does not have a separate preprocessor, so its STRUC uses the same syntax as assembler's structures:
Code: struc ListItem label . .item dq 0 .previous dq 0 .next dq 0 .itemSize dq 0 end struc struc List label . .firstItem dq 0 .listSize dq 0 .itemsCount dq 0 .index dq 0 .indexItem dq 0 .indexedItemIndex dq 0 end struc See also this thread: https://board.flatassembler.net/topic.php?t=19283 |
|||
![]() |
|
donn 10 Oct 2018, 17:46
Great, it assembles now.
Still using the virtuals: Code: ; Used with address offsets virtual at 0 List List end virtual ; Used with address offsets virtual at 0 ListItem ListItem end virtual Also built my first working macros yesterday, which have been helpful to getting things rolling: Code: macro newFile fileNameAddr,handleAddr sub rsp, 8*8 mov qword [rsp+6*8], 0 ;hTemplateFile mov qword [rsp+5*8], 128 ;dwFlagsandAttributes mov qword [rsp+4*8], 000000100b ;dwCreationDisposition mov r9, 0 ;lpSecurityAttributes mov r8, 000000010b ;dwShareMode mov rdx, 10100000000000000000000100000101b ;dwDesiredAccess mov rcx, fileNameAddr call [CreateFile] add rsp, 8*8 mov [handleAddr], rax mov rcx, [handleAddr] sub rsp, 8*4 call [SetEndOfFile] add rsp, 8*4 end macro macro writeFile handleAddr,entry,size,writtenAddr mov rcx, [handleAddr] sub rsp, 8*4 call [SetEndOfFile] add rsp, 8*4 sub rsp, 8*8 mov qword [rsp+4*8], 0 mov r9, writtenAddr mov r8, [size] mov rdx, entry mov rcx, [handleAddr] call [WriteFile] add rsp, 8*8 end macro |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.