flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
wht36 22 Dec 2010, 06:13
This patch adds the following options to the main FASM.EXE (windows only)
Code: -i <file> include file in processing -e export all labels and variables for debugging -f dump symbolic info to .fas file -l dump assembly listing to .lst file -o dump preprocessor output to .out file Note: There are already separate tools to generate preprocessor & listing output in the TOOLS folder. This is patch is for those who prefer everything in one executable. The patch can also export symbols for debugging and automatically searches FASM home path for include files. The basic patch went like this Code: start: . . . call preprocessor ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv call process_fasm_flags ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call parser call assembler call formatter ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv test [fasm_flags],4 jz finish_listing call listing finish_listing: ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ . . . jmp exit_program ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv process_fasm_flags: cmp byte [include_files],0 jz create_export_section ... ... loop through include files ... create_export_section: test [fasm_flags],export_option_flag jz write_preprocessor_file ... ... parse preprocessor output and create export file ... run preprocessor on export file to create export section ... write_preprocessor_file test [fasm_flags],preprocessor_option_flag jz write_symbol_file ... ... convert preprocessor output to text and write to .out file ... write_symbol_file: cmp [fasm_flags],fas_option_flag jb done_processing_fasm_flags mov eax,'fas' call create_output_file_extension mov [symbols_file],edx done_processing_fasm_flags: ret create_output_file_extension: . . . ret listing: ;copied from listing.inc mov edx,[symbols_file] call open . . . ; mov edx,[listing_file] mov eax,'lst' call create_output_file_extension call create . . . load_file: . . . call read_ . . . ret alloc: . . . free: . . . read_: . . . retn ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ . . . get_params: . . . cmp al,'S' je symbols_option ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv or al,'a'-'A' mov ah,preproc_flag cmp al,'o' je set_fasm_flags mov ah,fas_flag cmp al,'f' je set_fasm_flags . . . set_fasm_flags: or [fasm_flags],ah jmp find_param ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad_params: . . . db ' -s <file> dump symbolic information for debugging',0Dh,0Ah ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv db ' -f dump symbolic information to .fas for debugging',0Dh,0Ah ... ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ . . . _bytes_suffix db ' bytes.',0Dh,0Ah,0 ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv fasm_flags db 0 ... ... ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ . . . start_time dd ? ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv input dd ? ... ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Hmm, my follow up post are getting too many, sorry about that ![]()
Last edited by wht36 on 02 Feb 2013, 20:05; edited 17 times in total |
|||||||||||
![]() |
|
wht36 22 Dec 2010, 13:59
Nevermind, I figured out why. I forgot to include the read procedure from system.inc in the TOOLS folder. The updated source can be downloaded below. It basically adds the following options
Code: -f dump symbolic info to .fas file -l dump assembly listing to .lst file -o dump preprocessor output to .out file
|
|||||||||||
![]() |
|
wht36 23 Dec 2010, 14:00
Update. I've added an option to create an export section in the final output exe with all the labels and variables used so that you can symbolically debug the exe in Ollydbg. Only tested on the FASM.ASM original source.
Code: -e export all labels and variables for debugging -f dump symbolic info to .fas file -l dump assembly listing to .lst file -o dump preprocessor output to .out file
|
|||||||||||
![]() |
|
wht36 23 Dec 2010, 21:07
Another update. Added option to have include files. Use one include file per -i switch. Include files and input file will be processed in the sequence that they occur on the command line. e.g. -i include2.inc proggie.asm -i include1.inc will assemble proggie.exe by first processing include2.inc, followed by proggie.asm, followed by include1.inc.
Code: -i <file> include file in processing -e export all labels and variables for debugging -f dump symbolic info to .fas file -l dump assembly listing to .lst file -o dump preprocessor output to .out file
|
|||||||||||
![]() |
|
revolution 24 Dec 2010, 01:22
So SSSO is no go.
![]() |
|||
![]() |
|
revolution 24 Dec 2010, 02:39
-i is the SSSO killer and would bring us back to the ugly days of TASM style command line craziness just to get something to assemble.
|
|||
![]() |
|
wht36 24 Dec 2010, 03:51
![]() ![]() |
|||
![]() |
|
wht36 24 Dec 2010, 08:45
Update. This version will search the INCLUDE folder in FASM's homepath for include files, so you don't need to set the INCLUDE environment variable to FASM\INCLUDE anymore.
|
|||||||||||
![]() |
|
edfed 31 Jan 2011, 12:37
F8 would be really nice for .LST generation, because .FAS file is not really usefull for the lambda coder like me. .LST really means something, directlly useable is fasm editor.
the process that would be very nice with listing file generation under fasm IDE is to open the fresh generated .LST file in a new tab. |
|||
![]() |
|
edfed 14 Feb 2011, 17:07
UP!!!
fasm <source> -L option as an official feature of fasm, fasmw, fasmd, etc.. ![]() it rests SSSO compliant because, .LST should not considered as an output, but as a debug ressource. is that planned as the debug F8 menuitem in fasmw? if this feature is present in next days, i will be able to document it. ![]() else, it will be a serious lack... ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.