I'm looking for a Z80 assembler which is available for win32 and does support both macro and the possiblity to give additional "include path" as compiler parameters.
For now i'm using AS80 and i was very happy with it, unfortunatly it doesn't support extra include path and that gimme serious problems to write my ultimate genesis developement makefile
Does anyone has any ideas ? i made some searchs but i can't found any win32 assembler with both features...
thanks
Last edited by Stef on Mon Jan 10, 2011 10:22 pm, edited 1 time in total.
SjAsmPlus is the best Z80 cross-assembler, in my opinion. It has includes, macros, and a lot of other features. I've used parent version, SjAsm, to make code for SMD's Z80, and you've seen the code.
Shiru wrote:SjAsmPlus is the best Z80 cross-assembler, in my opinion. It has includes, macros, and a lot of other features. I've used parent version, SjAsm, to make code for SMD's Z80, and you've seen the code.
Thanks a tons, i think i found my new Z80 assembler
I was lately experiencing some problems with my Z80 drivers and i just realized that SJAsm was doing very weird things compared to my previous assembler... anyway i can't use it anymore, it seems quite buggy :-/
So i'm just wondering if someone found a "new cool another Z80 assembler" which does support macro and include path option ? maybe the one you're using
It doesn't have macros. I switched to sjasmplus, but I haven't seen anything weird yet. I'm using 1.0.7 RC7. Maybe your problem is an issue with a new version that broke something... or maybe I just haven't used whatever causes you problems.
It doesn't have macros. I switched to sjasmplus, but I haven't seen anything weird yet. I'm using 1.0.7 RC7. Maybe your problem is an issue with a new version that broke something... or maybe I just haven't used whatever causes you problems.
I was using sjasm, not sjasmplus... afaik the problem arrives only when you intent to use ORG directive. With my previous assembler (asmZ80, don't remember exactly which one exactly) i was able to choose to fill empty space with 0 in binary file which was very common. So i was able to do the following stuff :
ORG $0
<boot_code>
...
jmp main
ORG $38
<interrrupt_code>
RTI
ORG $200
main
<main_code>
...
My working variables were located at $100, between interrupt handler and main code. The problem with sjasm is that ORG directive doesn't work that way. Afaik i don't really know what it does. Maybe it permit to force the Program Counter value at specific location but at least it doesn't fill empty space so all code is concatenated. i.e, the last instruction of boot_code is followed with first instruction of interrupt_code and last instruction of interrupt_code is followed by first instruction of main_code.
Then i tried to use the BLOCK directive to empty space fill but then if code is now correctly located the resulting obj file is truncated before the end of the actual code. For instance my main code_code should end at $450 but the bin file end at $350... so a part of my code isn't there.
; ########################### Code starts here ##############################
OUTPUT "z80_tadpcm.o80",t
ORG $0000
; basic init code
DI ; Disable ints
LD SP, $2000 ; Setup stack
IM $01 ; Set int mode 1
JP start ; Jump to start
; ########################## Interrupt handler ##############################
BLOCK $0038-$
interrupt
RETI
; ############################## Main code ##################################
BLOCK $0080-$
start
LD B, $10
XOR A
LD HL, $0040
clr_vars
ORG doesn't work for offsetting the current PC, but BLOCK does. I have END at the end of my Z80 code and I haven't had a problem with the code size being wrong.
Chilly Willy wrote:Um - you do use an END statement at the end of the code, right? Here's a snippet of my Z80 code where I use ORG and BLOCK:
...
END statement ? ok so that is the reason why my code is truncated...You're doing is exactly what i want to do so i guess that's the problem, thanks a tons !
Honestly i find that END statement a bit surprising, i really wonder why ajasm need that :-/ not a big problem anyway...
It works now, thanks again
Very stupid problem afaik, the END directive was missing and it seems this is only needed when you use some others specials directives as BLOCK :-/
I can't understand why the assembler doesn't assume the end of file as being the end X'D
It was pretty common for assemblers for 8-bit CPUs to require the end statement. It stopped being common on 16-bit systems. For example, all the 6502 assemblers I used to use all required END, but only one of the 68000 assemblers did, and it was optional on the rest.
Chilly Willy wrote:It was pretty common for assemblers for 8-bit CPUs to require the end statement. It stopped being common on 16-bit systems. For example, all the 6502 assemblers I used to use all required END, but only one of the 68000 assemblers did, and it was optional on the rest.
I'm not very familiar with these 8 bits assemblers, i did a bit of 6809 but a long long time ago and the assembler was really far from what we have now. Anyway problem solved, this is the point