z80asm equ

Other misc things
Post Reply
berk
Member
Posts: 37
Joined: Wed Dec 24, 2014 9:46 am

z80asm equ

Post by berk »

Hello,

z80asm doesnt support following syntax:

label: equ value

I have to remove colon in this case. Would it be possible to enable also this form?

Thank you

--berk
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

you may be interested inthe awk scripts in {z88dk}/support/8080. toz80.awk converts from 8080 to z80 mnemonics but is also able to convert from equ to defc. z80 to z80 should work as well
berk
Member
Posts: 37
Joined: Wed Dec 24, 2014 9:46 am

Post by berk »

Thank you - I will try
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I opened an issue on github:
https://github.com/z88dk/z88dk/issues/1018
pscust
Well known member
Posts: 194
Joined: Thu Jun 23, 2011 3:34 pm

Post by pscust »

Problem fixed. Thanks for reporting.
berk
Member
Posts: 37
Joined: Wed Dec 24, 2014 9:46 am

Post by berk »

Thank you :-)
User avatar
jorgegv
Well known member
Posts: 287
Joined: Wed Nov 18, 2020 5:08 pm

Re: z80asm equ

Post by jorgegv »

Hi, just found this thread and my question seems related to it.

I have the following PASMO syntax:

Code: Select all

...
my_label: equ $+4
...
That defines the my_label constant to be the current assembling position at the beginning of the line plus 4 bytes.

Does z88dk-z80asm have a similar syntax? How can I acces the current assembly address from inside the asm file with z88dk-z80asm?

Thanks, and sorry if the question is trivial :-)
J.
User avatar
jorgegv
Well known member
Posts: 287
Joined: Wed Nov 18, 2020 5:08 pm

Re: z80asm equ

Post by jorgegv »

Mmm maybe ASMPC is what I'm looking for...?
pjshumphreys
Member
Posts: 66
Joined: Sat Feb 06, 2021 2:32 pm

Re: z80asm equ

Post by pjshumphreys »

Pehaps the defc z80asm directive is useful? https://github.com/z88dk/z88dk/wiki/Too ... xpression-
User avatar
jorgegv
Well known member
Posts: 287
Joined: Wed Nov 18, 2020 5:08 pm

Re: z80asm equ

Post by jorgegv »

Hi pjshumphreys,

yes, that directive is what I used. So finally I replace the following PASMO statement:

Code: Select all

...
my_label: equ $+4
with the following Z80ASM one:

Code: Select all

...
defc my_label = ASMPC+4
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: z80asm equ

Post by dom »

It looks like Paulo added support for equ and $ a while back:

Code: Select all

cdom@ermintrude z88dk % cat equ.asm


	GLOBAL abc
	GLOBAL def

	org	32000

abc	equ	$+4
def:	equ	$+10
dom@ermintrude z88dk % z88dk-z80asm -b -m  equ
dom@ermintrude z88dk % cat equ.map
abc                             = $7D04 ; addr, public, , equ, , equ.asm:8
def                             = $7D0A ; addr, public, , equ, , equ.asm:9
__head                          = $7D00 ; const, public, def, , ,
__tail                          = $7D00 ; const, public, def, , ,
__size                          = $0000 ; const, public, def, , ,
User avatar
jorgegv
Well known member
Posts: 287
Joined: Wed Nov 18, 2020 5:08 pm

Re: z80asm equ

Post by jorgegv »

Arrggh!!! So I could just have compiled It!! :-D

Anyway, experience acquired...

Thanks Dom
Post Reply