Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Merlin32 Documentation

184 views
Skip to first unread message

Kent Dickey

unread,
Jun 18, 2020, 12:39:18 AM6/18/20
to
I was trying to use Merlin32, and ran into an annoyance. So my first
question--is there documentation on how to use Merlin32? I downloaded it
from https://github.com/apple2accumulator/merlin32, and I don't see any
documentation there (let me know if I missed it).

I used Merlin-16 on my Apple IIgs all the time, and it works fine to compile
the following short trivial program (the first example in the Merlin Pro
manual, which is available at archive.org):

*DEMO PROGRAM 1
org $300
BELL equ $fbdd
START jsr BELL
rts

I put that in a file demo.s, and ran:

merlin32 . demo.s

(I didn't "install" merlin32, just compiled it, since I don't need the
macros, and didn't want to fiddle with it much before trying it out).

But Merlin-32 barfs over this. It seems to think there are "Link Files"
which can have ORG and DS commands (and some other opcodes) in them, and
other files, which can have code, and EQU, and cannot have ORG (based on
IsLinkFile() in a65816Link.c).

I'm guessing the minimum useful Merlin32 project is two files, with
the Link File including the assembly code, but what exactly is the syntax
I need to use?

I want to eventually compile a semi-substantial amount of code, which will
need blank areas in it, something like:

org $300
[ some code, but not much ]
org $380
[ more code ]

where I want it to just put 0's to fill in space (if any). Can I do that with
Merlin32 in one source file?

Kent

olivier...@cooperteam.eu

unread,
Jun 18, 2020, 5:01:55 AM6/18/20
to
Le jeudi 18 juin 2020 06:39:18 UTC+2, Kent Dickey a écrit :
> I was trying to use Merlin32, and ran into an annoyance. So my first
> question--is there documentation on how to use Merlin32? I downloaded it
> from https://github.com/apple2accumulator/merlin32, and I don't see any
> documentation there (let me know if I missed it).
> Kent

The officiel Merlin 32 page is here :

http://www.brutaldeluxe.fr/products/crossdevtools/merlin/index.html

Regards,

Olivier

Steven Hirsch

unread,
Jun 18, 2020, 9:01:10 AM6/18/20
to
I would be great to have a printable text or PDF of that document. I tried
printing the web page, but it renders with microscopic font sizes and is unusable.

Andrew Roughan

unread,
Jun 18, 2020, 9:05:09 AM6/18/20
to
Kent Dickey <ke...@provalid.com> wrote:
> I want to eventually compile a semi-substantial amount of code, which will
> need blank areas in it, something like:
>
> org $300
> [ some code, but not much ]
> org $380
> [ more code ]
>
> where I want it to just put 0's to fill in space (if any). Can I do that with
> Merlin32 in one source file?

I wouldn’t expect 0’s in the output just by changing an ORG. I would expect
to have to use DS to define space to end up with 0’s.

Regards
Andrew





Kent Dickey

unread,
Jun 18, 2020, 11:35:31 PM6/18/20
to
In article <56a6a515-512e-444a...@googlegroups.com>,
Thanks for the quick reply! This version works fine (for my simple starting
project), and was easier to compile.

I switched to duckduckgo.com a few years ago (when Google searches were
becoming likely to show me social media crap on technical subjects), and it's
odd that duckduckgo doesn't show the brutaldeluxe page in the top hits for
"merlin 32". It just shows the github version. Googling "merlin 32" does
show the brutaldeluxe site as the top hit. This is how I got confused--I
just followed the only apparent site. And it doesn't help that the github
site never directly references the brutaldeluxe site (at least not that I
can see). I didn't realize it was a 3rd party fork since I wasn't really
paying attention.

Kent

Andy McFadden

unread,
Jun 20, 2020, 10:51:26 AM6/20/20
to
On Wednesday, June 17, 2020 at 9:39:18 PM UTC-7, Kent Dickey wrote:
> But Merlin-32 barfs over this. It seems to think there are "Link Files"
> which can have ORG and DS commands (and some other opcodes) in them, and
> other files, which can have code, and EQU, and cannot have ORG (based on
> IsLinkFile() in a65816Link.c).

The updated Merlin 32 has a number of bug fixes and enhancements, but also has this bug, which renders it unusable for SourceGen. I could add an explicit link file like I do for ca65, but Merlin isn't supposed to work this way (IMHO).

The relevant bug is https://github.com/apple2accumulator/merlin32/issues/35

> I want to eventually compile a semi-substantial amount of code, which will
> need blank areas in it, something like:
>
> org $300
> [ some code, but not much ]
> org $380
> [ more code ]
>
> where I want it to just put 0's to fill in space (if any). Can I do that with
> Merlin32 in one source file?

Merlin has syntax for page alignment ("ds \"), but not for other boundaries. There might be some cleverness possible with a macro?

The ACME cross-assembler has an explicit "!align" directive.

Kelvin Sherlock

unread,
Jun 20, 2020, 7:20:20 PM6/20/20
to
DS \ applies at the END of the file, regardless of where it's placed.
However, you could do something like this:

org $300
...
ds $380-*
...

-------
ProLine: kelvin@pro-kegs

Andy McFadden

unread,
Jun 20, 2020, 9:00:04 PM6/20/20
to
On Saturday, June 20, 2020 at 4:20:20 PM UTC-7, Kelvin Sherlock wrote:
> DS \ applies at the END of the file, regardless of where it's placed.

No?

LDA $11
DS \
STA $22

00000000: a511 0000 0000 0000 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
[...]
000000f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000100: 8522 60 ."`

Michael J. Mahon

unread,
Jun 20, 2020, 9:22:25 PM6/20/20
to
Here’s a simple Merlin macro that aligns to the next multiple of any value:

align mac ; Align to 0 mod arg
ds *+]1-1/]1*]1-*
eom

--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

Kelvin Sherlock

unread,
Jun 21, 2020, 2:20:19 PM6/21/20
to

Ahh, you're right. That's only true of RELocatable files.

In <96fc6c56-67e7-4ebb...@googlegroups.com>
-------
ProLine: kelvin@pro-kegs

Andy McFadden

unread,
Jul 10, 2020, 6:51:53 PM7/10/20
to
On Saturday, June 20, 2020 at 7:51:26 AM UTC-7, Andy McFadden wrote:
> The updated Merlin 32 has a number of bug fixes and enhancements, but also has this bug, which renders it unusable for SourceGen.

FWIW, Lane Roathe's fork (https://github.com/lroathe/merlin32) is more stable.

Bill Chatfield

unread,
Jun 14, 2021, 9:08:08 AM6/14/21
to

https://github.com/apple2accumulator/merlin32 is now up to date, including the fix for issue 35.

fadden

unread,
Jun 15, 2021, 11:09:03 AM6/15/21
to
On Monday, June 14, 2021 at 6:08:08 AM UTC-7, billcha...@gmail.com wrote:
> https://github.com/apple2accumulator/merlin32 is now up to date, including the fix for issue 35.

Thanks!
0 new messages