flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 30 Dec 2021, 21:21
al_Fazline wrote: The file struct.inc isn't available neither from fasm, nor from fasmg distribution. As for the file permissions, ZIP files created with tools capable of including them cause compatibility problems with some of my uses (including, but not limited to, MS-DOS), so I'd prefer to keep the basic universal distribution as it is. Update: Grom PE suggested how I can patch the ZIP file myself to add the Unix permissions without breaking compatibility. It seems to work, so I'm adding this to my build scripts: Code: @goto equ virtual at 0 Entry db 'PK',1,2 .VersionMadeBy dw ? .VersionToExtract dw ? .GeneralPurpose dw ? .CompressionMethod dw ? .FileTime dw ? .FileDate dw ? .Crc32Offset2 dd ? .CompressedSize dd ? .UncompressedSize dd ? .FileNameLength dw ? .ExtraFieldLength dw ? .CommentLength dw ? .DiskNumber dw ? .FileAttributes dw ? .FileAttributesExt dd ? .LocalHeaderOffset dd ? .FileName: end virtual file ZIPFILE offset = $ - 22 while offset > 0 load signature:8 from offset if signature = 'PK' + 5 shl 16 + 6 shl 24 load size:4 from offset + 12 tail = offset offset = offset - size while offset < tail load signature:4 from offset if signature <> 'PK' + 1 shl 16 + 2 shl 24 break end if load FileNameLength:2 from offset + Entry.FileNameLength load ExtraFieldLength:2 from offset + Entry.ExtraFieldLength load CommentLength:2 from offset + Entry.CommentLength load FileName:FileNameLength from offset + Entry.FileName if FileName eq 'fasmg' |\ FileName eq 'fasmg.x64' |\ FileName eq 'source/macos/fasmg' |\ FileName eq 'source/macos/x64/fasmg' store 3:1 at offset + Entry.VersionMadeBy+1 store 81EDh:2 at offset + Entry.FileAttributesExt+2 end if offset = offset + Entry.FileName + FileNameLength + ExtraFieldLength + CommentLength end while break end if offset = offset - 1 end while macro ?! line& end macro :equ @echo off if not exist "%~1" goto info fasmg "%~f0" "%~1" -i"ZIPFILE='%1'" goto end :info echo Please provide a name of ZIP file containing fasmg distribution. :end As for the directory envelope - I know that people have various build/update scripts made around the existing structure, so I would need a really good reason to change it. Traditionally all the ZIP files I publish have files directly in the root, as this has always been my personal preference (going back to DOS days). |
|||
![]() |
|
al_Fazline 01 Jan 2022, 01:58
Thanks for fixing the bug. I am not sure if I was supposed to create a new thread for that or not, since it's not about fasmg, but in fasm package, there is a file with incorrect encoding: fasm/examples/elfexe/hello64.asm
The most of file is actually ASCII, but this line: Quote:
I think the best solution would be transliterate the name into plain ASCII, but otherwise second best option would be to encode it as UTF-8, since it's the most common character encoding nowadays, so most text editors, viewers and browsers would open it in that encoding by default on every modern OS. Also I was thinking, do you think that since fasm is supposed to work as cross-assembler (such as it could produce executables of any type from any type, do you think, it would make sense to have just one universal distribution instead of splitting fasm into multiple packages: Windows, Linux, DOS, libc? People using other operating systems might want to try and build executables for different systems out of example directories. The source should be the same, Linux users can read PDF file as easily as window's and so on. The only thing other platform users won't need would be binaries, but they are relatively small and rather easy to delete after unpacking, if needed. I also think that DOS and Windows users could benefit from renaming all files to lower case, as, at least for me, they look better aesthetically and those systems are case-insensitive anyway so it shouldn't break compilation. Also, Happy New Year! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.