flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > zasm

Author
Thread Post new topic Reply to topic
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 05 Oct 2011, 00:08
Hi. Smile

I'm doing an assembler (nothing so serious - zasm is his name Razz) in fasm assembler, of course, and I've almost done with the lexical analyzer (scanner), I would like you could test it and report me bugs. Then i can optimize the scanner before go to next step.

Here a code example:
Code:
@COM
    EXECUTE 0x21

    mov dx msg
    mov ah 0x09
    int EXECUTE

    mov ah 0x4C
    int EXECUTE

    msg db 'Hello world!$'    


(More syntax here)

Notes:

  • Macro scanner is not yet implemented (so do not test them).
  • when using an address displacement (ex. mov [eax+ebx] 0) type the register name in uppercase (EAX+EBX). (this is provisory)
  • in the example code above if you remove the line EXECUTE 0x21 it will work with no error, remember: its a scanner step only.
  • the only error message displayed if a syntax is wrong is: invalid line [#]. Sorry for that Razz. So if you get this message and cannot solve it, post here!
  • right now it parses all general purpose registers and the following instruction: adc, add, and, dec, inc, int, mov, or, pop, push, sub, test, xor. Do not try any other. Razz
  • @PE directive or similars need at least one session (ex. @code) in order to work with no error msg. (and do not let it empty, or... Shocked i will fix that)
  • Pay attention in whitespace. Some erros may happen because of them. I do not yet parse them in all places, for example, in expressions (2+2 ok; 2 + 2 error!). But i'm doing.. help me find them Razz


How to use
Type a test.asm code file and drop it to zasm.exe. Or use command line if you like.

Please, test it! Thanks


Description: new version with some bugfixes
Download
Filename: zasm_v0.0.1.7z
Filesize: 2.1 KB
Downloaded: 798 Time(s)


_________________
Sorry if bad english.


Last edited by Teehee on 06 Oct 2011, 20:39; edited 1 time in total
Post 05 Oct 2011, 00:08
View user's profile Send private message Reply with quote
addes3



Joined: 09 May 2011
Posts: 29
addes3 06 Oct 2011, 00:04
I saw this on google code a while ago. The reference labels look a lot better then FASM's @F and @B.
Post 06 Oct 2011, 00:04
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 06 Oct 2011, 01:01
addes3 wrote:
I saw this on google code a while ago. The reference labels look a lot better then FASM's @F and @B.


But which one is better ? Rolling Eyes Very Happy
Post 06 Oct 2011, 01:01
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 06 Oct 2011, 08:43
No feedback yet?? perhaps there is no errors?! impossible Laughing, come on guys, help me!!

_________________
Sorry if bad english.
Post 06 Oct 2011, 08:43
View user's profile Send private message Reply with quote
emc



Joined: 20 Aug 2011
Posts: 90
Location: France
emc 06 Oct 2011, 16:33
I saw this too, and I have posted a comment about "<" labels. I said it's cool to write "(30<)" instead "<<< ... <<<" 30 times. Do you saw? (long ago) Wink
Post 06 Oct 2011, 16:33
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 06 Oct 2011, 20:41
i did and answered you Wink

i've found some bugs in my scanner right now (on unknow instructions), i'm working to fix them.

***

*edit* Note: I've just upload a new version with some bug fixes, please download it again.

_________________
Sorry if bad english.
Post 06 Oct 2011, 20:41
View user's profile Send private message Reply with quote
addes3



Joined: 09 May 2011
Posts: 29
addes3 06 Oct 2011, 22:57
What exactly does this do? Tell us if there are errors?
All I get is "Press any key to continue . . ."
Post 06 Oct 2011, 22:57
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 06 Oct 2011, 23:53
addes3 wrote:
What exactly does this do? Tell us if there are errors?
All I get is "Press any key to continue . . ."


it will analyze your code input for valid syntax. If you saw "press any key to continue..." that means your syntax is ok. You will see 'invalid line [#]' when you make some mistake.

ex.
Code:
mov eax eax ; this line is valid, so
; output: Press any key to continue...
mov 3 eax   ; this line is invalid, so
; output: invalid line [#]    

_________________
Sorry if bad english.
Post 06 Oct 2011, 23:53
View user's profile Send private message Reply with quote
addes3



Joined: 09 May 2011
Posts: 29
addes3 07 Oct 2011, 19:33
Ohhh okay.
Post 07 Oct 2011, 19:33
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.