Groups | Search | Server Info | Login | Register


Groups > comp.os.cpm > #14009

Re: much enhanced z-80 assembler now available

Newsgroups comp.os.cpm
Date 2023-09-11 10:06 -0700
References (8 earlier) <0fa27cfa-8d62-4b58-b09c-ed67dd791c81@googlegroups.com> <l0i15q$vlq$1@dont-email.me> <c678e9ff-91eb-4222-b8c0-3d2072185cbf@googlegroups.com> <9cc0e84f-ab30-45b4-9402-0f963b2a2b22@googlegroups.com> <4fa2d9e6-2a30-4e24-87f4-d845c2a29cf1n@googlegroups.com>
Message-ID <a6c6b161-ef3a-4594-9378-4f12c6004972n@googlegroups.com> (permalink)
Subject Re: much enhanced z-80 assembler now available
From George Phillips <gp2k00@gmail.com>

Show all headers | View raw


On Thursday, September 7, 2023 at 8:25:30 PM UTC-7, Jonathan Harston wrote:
> Is there a way to use strings in expressions in ZMAC, so I can do 
> the following more efficiently: 

Maybe it would be enough to just do the month as a macro?

VersMM macro
defm 'Mar'
endm

DEFM '0'+(VersDD/10),'0'+(VersDD MOD 10),'-'
VersMM
DEFM '-'

Or use irp to do the month number to name lookup in a cleaner fashion:

VersMM equ 7
m1=0
irp s1,<Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec>
if VersMM == m1
defm '&s1'
endif
m1++
endm

For the year you can stringify it doing something like this:

VersYY equ 2000

str macro sx
defm '&sx'
endm

str %VersYY

Though I guess the answer to your question is that zmac doesn't have string variables and you need to use macros to get the same kind of manipulation.

Back to comp.os.cpm | Previous | NextPrevious in thread | Find similar


Thread

Re: much enhanced z-80 assembler now available Jonathan Harston <jgh@mdfs.net> - 2023-09-07 20:25 -0700
  Re: much enhanced z-80 assembler now available George Phillips <gp2k00@gmail.com> - 2023-09-11 10:06 -0700

csiph-web