flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > use fasm as a generic tool

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
guignol



Joined: 06 Dec 2008
Posts: 635
guignol
a UTF-32 file with seamless compression over it; as a source file for fasm

plus, Tomasz could add archiving your chosen repository with PPMD (very good compression level for text data)
Post 29 Apr 2019, 04:46
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4218
Location: 2018
edfed
you can open a new thread about this cause here, i just focus on the
Code:

compile "returnX².asm" ;version that launches a fasm command.

 compile on "return0.bin" { ; versions that uses code inside brackets to compile. maybe it should use the sam emethod as in first version after extraction of the source in brackets...
 mov eax,0
 ret
}

compile  { ; this version needs to declare the file to generate, if you don't it will generate a "currentfilexxxxx.bin" file.current file is the name of the osurcefile,  xxxxx is the current compile iteration. each compile would then increment a counter by one.
db "x = 1234",0
db "y = x²",0
}


compile_begin ;maybe the job would be easier if using compile_begin and compile_end tokens...

mov eax,0xedfed
ret

compile_end ;of course, the symbol is still to define.

    

functionnality. i promise, when i'll have time i'll make the first version, versions on bracket enclosed code seems to be very hardcore to do for me in a first time.


Wink
Post 29 Apr 2019, 07:27
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4218
Location: 2018
edfed
found where to work on this Smile

TABLES.inc wrote:

Code:
include_variable db 'INCLUDE',0

symbol_characters db .a-$-1
 db 9,0Ah,0Dh,1Ah,20h,'+-/*=<>()[]{}:,|&~#`;\'
 .a:

macro DIRECTIVE name,where{
local .a
    db .a-$-1
    db name
.a:
    dw where-directive_handler

}

preprocessor_directives:
 DIRECTIVE 'flatassembler',assemble_a_file

 DIRECTIVE 'define',define_symbolic_constant
 DIRECTIVE 'include',include_file
 DIRECTIVE 'irp',irp_directive
 DIRECTIVE 'irps',irps_directive
 DIRECTIVE 'irpv',irpv_directive
 DIRECTIVE 'macro',define_macro
 DIRECTIVE 'match',match_directive
 DIRECTIVE 'postpone',postpone_directive
 DIRECTIVE 'purge',purge_macro
 DIRECTIVE 'rept',rept_directive
 DIRECTIVE 'restore',restore_equ_constant
 DIRECTIVE 'restruc',purge_struc
 DIRECTIVE 'struc',define_struc
 db 0

macro_directives:
 DIRECTIVE 'common',common_block
 DIRECTIVE 'forward',forward_block
 DIRECTIVE 'local',local_symbols
 DIRECTIVE 'reverse',reverse_block
 db 0

macro OPERATOR name,value {
local .a
      db .a-$-1
      db name
.a:
      db value
}

operators:
 OPERATOR '+',80h
 OPERATOR '-',81h
 OPERATOR '*',90h
 OPERATOR '/',91h
 OPERATOR 'and',0B0h
 OPERATOR 'mod',0A0h

...

    




and

PREPROCE wrote:

Code:


include_file:
        lods    byte [esi]
        cmp     al,22h
        jne     invalid_argument
        lods    dword [esi]
        cmp     byte [esi+eax],0
        jne     extra_characters_on_line
        push    esi
        push    edi
        mov     ebx,[current_line]
      find_current_file_path:
        mov     esi,[ebx]
        test    byte [ebx+7],80h
        jz      copy_current_file_path
        mov     ebx,[ebx+8]
        jmp     find_current_file_path
      copy_current_file_path:
        lods    byte [esi]
        stos    byte [edi]
        or      al,al
        jnz     copy_current_file_path
      cut_current_file_name:
        cmp     edi,[esp]
        je      current_file_path_ok
        cmp     byte [edi-1],'\'
        je      current_file_path_ok
        cmp     byte [edi-1],'/'
        je      current_file_path_ok
        dec     edi
        jmp     cut_current_file_name
      current_file_path_ok:

...
       

    



to achieve the flatassembler directive, i will just make like include, but instead of including , i'll just launch the command "fasm file.asm" with os independent code.

i also macroed the items in tables.inc then it will be more easy, and less verbose to add new items.

i just hope it will be as simple as that, and don't create problems with multiple passes.
Post 09 May 2019, 09:33
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4218
Location: 2018
edfed
Main problem here is in dos version.
dos cannot execute fasm from fasm.

then, the solution should be to pipeline the compilations to do, and launch them after the main execution.

this creates a second problem, if the main compile needs a secondary file to be compiled to include data (file directive) from it, it will not work...

maybe in a first time, i'll not consider the dos version and focus on the win32 version, and then confirm it will execute secondary compilation only one time before file directive.
Post 15 May 2019, 08:05
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.