flat assembler
Message board for the users of flat assembler.
Index
> Non-x86 architectures > eZ80 includes for fasmg |
Author |
|
jacobly 30 May 2016, 03:43
I started working on an ez80 include for fasmg a while back due to a lack of good ez80 assemblers. I finally got it working, and have successfully tested it with every ez80 instruction. The code is at https://github.com/jacobly0/fasmg-ez80. It could even be used to compile z80 code if the
Code: assume adl = 0 |
|||
30 May 2016, 03:43 |
|
revolution 30 May 2016, 03:46
I'm wondering if this should be in the "Non-x86 architectures" forum?
|
|||
30 May 2016, 03:46 |
|
connor 10 Jun 2016, 04:53
Does it 8080?
_________________ cars tech weed bitches country & thug life |
|||
10 Jun 2016, 04:53 |
|
shoorick 13 Jun 2016, 10:12
for 8080 look there
|
|||
13 Jun 2016, 10:12 |
|
marste 27 Jul 2016, 09:15
In some spare time I was trying to build the Z80 compiler myself...
Good that I was so slow: this version is much better of current mine! I'm trying to recompile with it a little modified version of the Super Micro Chess ZX81! Bravo jacobly!! |
|||
27 Jul 2016, 09:15 |
|
marste 28 Jul 2016, 17:56
I managed to compile the first version of the source!
Two notes for information: 1. @jacobly: don't know why but long addresses were always outputted as long instead of word. I had to force word changing the macro ez80.word: Code: macro ez80.word value ; if ez80.il ; ez80.long value ; else dw value ; end if end macro 2. @Tomasz: I used the listing macro discussed in the other topic, but if you redirect output to listing file you loose the compiler output, and if not redirect they are mixed with listing. One possible solution might be to redirect compiler output and "display" instruction output (I use for some info) on stderr (PS: I was using as legacy windows version since FASMW, now I can move to linux one! ) |
|||
28 Jul 2016, 17:56 |
|
marste 28 Jul 2016, 18:18
PS for point 2: proposed solution do not work since also listing macro use display!!
Another solution have to be found, as for example giving an optional parameter to display instruction to indicate a file to write |
|||
28 Jul 2016, 18:18 |
|
Tomasz Grysztar 28 Jul 2016, 18:48
marste wrote: PS for point 2: proposed solution do not work since also listing macro use display!! |
|||
28 Jul 2016, 18:48 |
|
Tomasz Grysztar 28 Jul 2016, 19:17
Actually, the quickest solution would be to define a macro like this:
Code: define ldisplay 13,10,10,'LISTING',13,10,10 macro ldisplay args& define ldisplay. args end macro postpone irpv d, ldisplay display d end irpv end postpone |
|||
28 Jul 2016, 19:17 |
|
marste 01 Aug 2016, 16:19
For some reason seems postpone is very much postponed... but I cannot say how to change:
Code: include 'ez80.inc' ;----------------- define Listing define ldisplay 13,10,10,'LISTING',13,10,10 macro ldisplay args& define ldisplay. args end macro postpone irpv d, ldisplay display d end irpv end postpone namespace Listing base = $$ offset = $ macro disphex number*,digits:8 repeat digits digit = ((number) shr ((%%-%) shl 2)) and 0Fh if digit < 10 ldisplay '0'+digit else ldisplay 'A'+digit-10 end if end repeat end macro end namespace macro ? line& line namespace Listing if ~ $$ eq base base = $$ offset = $$ end if bytes = $ - offset if $ - bytes < $$ bytes = $ - $$ end if offset = $ disphex (offset scale 0)-bytes,8 ldisplay ': ' column = 0 while bytes if column = 8 column = 0 ldisplay 13,10,' ' end if load data:byte from $ - bytes disphex data,2 ldisplay ' ' bytes = bytes - 1 column = column + 1 end while repeat 8-column ldisplay ' ' end repeat ldisplay `line,13,10 end namespace end macro ;----------------- nop jp test nop jr test nop ld a,(test) nop test: nop nop Result: Code: $ ./fasmg.exe test.asm test.bin flat assembler g version 0.97.1467376867 LISTING >>>>>>>>: >> nop >>>>>>>>: E> >E >> jp test >>>>>>>>: >> nop >>>>>>>>: >> >> jr test >>>>>>>>: >> nop >>>>>>>>: >E >E >> ld a,(test) >>>>>>>E: >> nop >>>>>>>E: >> test: nop >>>>>>>E: >> nop 2 passes, 14 bytes. Original output without "postponed" ldisplays: Code: $ ./fasmg.exe test_orig.asm test_orig.bin flat assembler g version 0.97.1467376867 00000000: 00 nop 00000001: C3 0C 00 jp test 00000004: 00 nop 00000005: 18 05 jr test 00000007: 00 nop 00000008: 3A 0C 00 ld a,(test) 0000000B: 00 nop 0000000C: 00 test: nop 0000000D: 00 nop 2 passes, 14 bytes. |
|||
01 Aug 2016, 16:19 |
|
Tomasz Grysztar 01 Aug 2016, 17:29
Oh, right, postponed display of a variable does not work well.
To fix it, replace the definition of "ldisplay" with this one: Code: macro ldisplay args& local str virtual at 0 db args load str : $ from 0 end virtual define ldisplay. str end macro |
|||
01 Aug 2016, 17:29 |
|
marste 04 Aug 2016, 16:13
Very good, like this is almost a normal listing!
Thank you!! |
|||
04 Aug 2016, 16:13 |
|
marste 21 Mar 2017, 18:18
Another question that will be good for a debugger input: is possible to add the source filename and source line together with the current assembled address?
E.g. (just to give the idea, formatting can be different) Code: 00000000 (pippo.asm,1): 00 nop 00000001 (pippo.asm,2): C3 0C 00 jp test 00000004 (pippo.asm,4): 00 nop 00000005 (pippo.asm,5): 18 05 jr test 00000007 (test.inc,1): 00 nop 00000008 (test.inc,2): 3A 0C 00 ld a,(test) 0000000B (pippo.asm,8): 00 nop 0000000C (pippo.asm,9): 00 test: nop 0000000D (pippo.asm,10): 00 nop |
|||
21 Mar 2017, 18:18 |
|
Tomasz Grysztar 21 Mar 2017, 19:12
Try replacing this line in listing macro:
Code: ldisplay ': ' Code: repeat 1, n:__line__ ldisplay ' (',__file__,',',`n,'): ' end repeat |
|||
21 Mar 2017, 19:12 |
|
marste 21 Mar 2017, 21:15
Tomasz Grysztar wrote: Try replacing this line in listing macro: Seems working well! Let's see how it will be for debugging info of zesaurux. In the meantime thank you again!! |
|||
21 Mar 2017, 21:15 |
|
ProMiNick 16 Jun 2017, 00:03
...ti84pceg.inc [37]:
include 'ti84pce.inc' Processed: include 'ti84pce.inc' Error: source file not found. Where I can get this include? |
|||
16 Jun 2017, 00:03 |
|
marste 16 Jun 2017, 08:59
ProMiNick wrote: ...ti84pceg.inc [37]: I think this has nothing to do with ez80 includes nor with fasm. Probably TI Calc forums are a better place to ask. |
|||
16 Jun 2017, 08:59 |
|
ProMiNick 10 Jan 2018, 10:24
Jacobly, can you sent ROM Image (or couple of images) to play with?
(I interested not in ez80 exactly, but in architectures other than x86 with opensource emulator of that architecture in win32 or win64 environment (with everything needed to make it work, like ROM images in case of ez80) and opened (or already adapted to fasmg syntax) opcode set ) for playing (compiling src in fasmg & running it in native environment in emulator, and than exploring sources of emulator itself). prominick.nvkz.sochi@gmail.com no needed in ROM. I thought sharing it in internet is illegal. But found couple of ROMes. _________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||
10 Jan 2018, 10:24 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.