[Coco] Assembler directives
Robert Gault
robert.gault at att.net
Wed Mar 20 09:36:54 EDT 2019
Phil,
What you want depends on the specific assembler but since you are using ifeq and ifne you could try
the following. Give each of your Dragons a number:
dragon32 equ 1
dragon64m0 equ 2
dragon64m1 equ 3
etc.
hardware equ dragon32 + dragon64m0 + dragon64m1 + ...
or
hardware equ dragon64m1
Then you could have
ifeq hardware - 6
or
ifeq hardware - 3
you can set the value equal to multiple or single dragon versions.
In any case, you can make nested conditionals much easier to follow if you indent at each level.
ifne dragon64
ifeq dragon200e
FDB $3634
else
FDB $0000
endif
else
FDB $0000
endif
Robert
Phill Harvey-Smith wrote:
> Hi all,
>
> I'm currently working on a version of the disassembled Dragon ROMS that can be assembled to produced
> any of the following :
>
> Dragon 32 ROM,
> Dragon 64 ROM used in map 0
> Dragon 64 ROM copied to RAM at $c000 and used in map 1
> Dragon 200e ROM, this is the Spanish Eurohard's modified Dragon 64
>
> I'm currently using Boisy's mamou** to build this, which works and produces binary identical ROMS.
>
> **Though I'm not averse to using something else e.g. lwasm if there are advantages to doing
> so....just last time I tried lwasm it's assembly times seemed much longer.....
>
> However there are multiple conditional parts assembled with nested ifeq / ifne etc for example :
>
> ifne dragon64
> ifeq dragon200e
> FDB $3634 ; '64'
> else
> FDB $0000
> endc
> else
> FDB $0000
> endc
>
> Is there a more succinct way of expressing this so that multiple conditions can be combined.
>
> e.g. something like C's
>
> #if defined(dragon64) & !defined(dragon200e)
> FDB $3634 ; '64'
> #else
> FDB $0000
> #endif
>
> Cheers.
>
> Phill.
>
More information about the Coco
mailing list