Help with WLA DX for 65C816

Building your first 6502-based project? We'll help you get started here.
Post Reply
User avatar
iamgrazzi
Posts: 7
Joined: 27 Jun 2021
Location: NYC

Help with WLA DX for 65C816

Post by iamgrazzi »

Hello world, long-time listener, first-time caller. I have learned a lot reading through this forum over the past few months, so first of all, thank you!

After exciting success using the 65C02 for a while, I have decided to enter the world of the 65C816 and I am very excited about it. However, I can't for the life of me figure out how to get my code ROM-ready.

I'm trying to use WLA DX and come from the world of vasm, which I adore. I'm trying to emulate vasm functionality - point it at a file written in assembly and it spits out a perfect binary file ready to burn to ROM.

The simplest way I have found to get SOMETHING out of WLA DX is by using this code:

Code: Select all

.MEMORYMAP
SLOTSIZE $8000
SLOT 0 $8000
DEFAULTSLOT 0
.ENDME

.ROMBANKMAP
BANKSTOTAL 1
BANKSIZE $8000
BANKS 1
.ENDRO

	lda #$06
I don't quite understand how to use the memory map and ROM bank map functionality just yet, but I'm sure in time I can figure that out. However, when I send this through the wla-65816 assembler, it spits out a 92-byte file with "garbage" (file name, etc.) preceding the two bytes I actually want to have output.

I'm calling the assembler in terminal on Mac like this: ./wla-65816 -o outputfile 65816-notepad.asm

The documentation for the software is extraordinarily verbose and doesn't seem to cover the simple use-case I am constructing. I am not trying to emulate any cartridges or run this on a known entity, I'm just trying to write code like I would for vasm and then stick it on a ROM for my own bespoke 65C816 creation.

If anybody can help point me in the right direction, I would be eternally grateful. I absolutely love(d) working on my 65C02 projects, but am getting discouraged as to how this transition experience has been thus far. Thank you kindly for your consideration :)
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Help with WLA DX for 65C816

Post by BigEd »

Welcome!

I can't answer the question directly, but in the world of cc65, there's an assembler and a linker, and you need to use the linker to make a binary - the assembler only makes object files which the linker accepts. And you need to tell the linker just a little about the target machine.

A quick look at WLA documentation tells me that it might be similar in this case.

And so, you'd want a recipe to tell the WLA linker that your machine has no special features at all.

All that said, it still looks possible that WLA does not output pure binary files, but CBM format files, which have a two byte start address at the beginning.
User avatar
iamgrazzi
Posts: 7
Joined: 27 Jun 2021
Location: NYC

Re: Help with WLA DX for 65C816

Post by iamgrazzi »

BigEd wrote:
Welcome!

I can't answer the question directly, but in the world of cc65, there's an assembler and a linker, and you need to use the linker to make a binary - the assembler only makes object files which the linker accepts. And you need to tell the linker just a little about the target machine.

A quick look at WLA documentation tells me that it might be similar in this case.

And so, you'd want a recipe to tell the WLA linker that your machine has no special features at all.

All that said, it still looks possible that WLA does not output pure binary files, but CBM format files, which have a two byte start address at the beginning.
Aha! Thank you so much BigEd! That helped me figure it out.

In case anybody else has the same issues I did and wants a quick start: After generating the previously-mentioned file with wla-65816, I then made a short 65816-notepad.txt file that read...

Code: Select all

[objects]
outputfile
From there, I used ./wlalink 65816-notepad.txt rom.rom and bingo, I got a 32 kilobyte file with A9 06 at the beginning, followed by all 00s.

Thank you again!!
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Help with WLA DX for 65C816

Post by BigEd »

Oh, that's great!
Post Reply