flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > FASM Keywords:

Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 3624
Location: vpcmipstrm
bitRAKE 04 Jan 2009, 06:54
Download a new highlighting editor?

Want to parse FASM syntax?

What if FASM changes?

The solution is to use the FASM source code to generate the keyword file needed.
The minimalist way to do that is below:
Code:
virtual at 0

; SYSTEM.INC interface:

        predefinitions:
 get_environment_variable:
       make_timestamp:
 display_block:
  fatal_error:
    assembler_error:

    create:
 open:
   lseek:
  read:
   write:
  close:

  include '..\source\version.inc'

  include '..\source\errors.inc'
  include '..\source\expressi.inc'
  include '..\source\preproce.inc'
  include '..\source\parser.inc'
  include '..\source\assemble.inc'
  include '..\source\formats.inc'
  include '..\source\x86_64.inc'

  include '..\source\messages.inc'

  include '..\source\variable.inc'

end virtual

  include '..\source\tables.inc'    
...then the data can be accessed directly:
Code:
; macro_directives:
; preprocessor_directives:
;      length byte ?
;      string byte length dup(?)
;      func   word ?
;
; see get_directive in FASM source file "preproce.inc"

macro_directives.itterator:
 xor eax,eax
        lea esi,[macro_directives]
   jmp preprocessor_directives.itterator.0

preprocessor_directives.itterator:
       xor eax,eax
        lea esi,[preprocessor_directives]
  .0:   lodsb
       xchg ecx,eax
        jecxz .x
    lea eax,[esi+ecx+1]
 mov byte [esi+ecx],0
        xchg eax,esi
        ; EAX = string, null terminated
     ; ECX = length in bytes
     call ebx
    ; ESI needs to be preserved
 ; EAX must be zero to continue
      test eax,eax
        jz .0
  .x:   retn    
...any ideas?

_________________
¯\(°_o)/¯ unlicense.org
Post 04 Jan 2009, 06:54
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:  


< 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-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.