Hello all,
I am trying to set up a simply development environment on my Mac to learn 6502 assembly on Apple II, it's got the following components
- Emulator: Mariani (AppleWin Mac port)
- Editor: VS Code
- Assembler: Merlin32
- Disk Image handling: CiderPress2
Basically the workflow is
1. assemble the source using Merlin32
2. using CiderPress2 to import the produced binary into disk image (.po, .do) file
3. using CiderPress2 to set proper attributes (BINARY, AUX)
4. reboot Mariani.
This works well if it's on ProDOS, as the metadata (file type & load addr) are stored as file attribute, not part of binary file itself.
Here is the relevant source
TYP BIN
DSK MYPROG
ORG $8000
... More 6502 instructions
But if the disk image is DOS 3.3, This would not work, as the first 4 byte of the binary will be used as header, once the program is BLOAD'd , the first 4 bytes of code are gone. Not sure if CiderPress overwrote the first 4 bytes with header? so I had to tweak the source like this:
TYP BIN
DSK MYPROG
ORG $8000-4
DS 4, $EA ;4 NOPs.
... More 6502 instructions
It's also strange to me that I can't just put 'DS 4' there without $EA (NOP).
Ideally I'd like to get rid of this header set up in source code, and use post assembly process (CiderPress, etc) so same source/binary can be used for ProDOS or DOS3.3 - Is it possible?
BTW, I think merlin32 has a bug with regard to ORG pseudo command - no matter what value is there, the AuxType in _FileInformation.txt is always $0000.
Thanks!
If I had the money, I'd use a Mac and Virtual ][. I develop on a Linux PC using 6502 assembly. Here is my set up:
• Emulator: KEGS and/or AppleWin using Wine
• Editor: Xed (GTK/Linux) or Xcode (if I was on a Mac)
• Assembler: Merlin32
• Disk Image handling:
dskbsave(my own custom command to bsave to DOS 3.3 image files.)Basically the workflow is:
1. Use a makefile and type
make2. KEGS Conifugration (press F4) > Disk Configuration > cursor down to s6d1 > select dos33.dsk image file
Screenshot_2025-09-16_19-59-15.png
No headers needed.
I'm not super familiar with CiderPress, but in general you will want to specify the file type and address at the time the file is imported, rather than adjusting the metadata afterwards.
CiderPress has a few ways to do this, but one way is to encode it in the file name.
#068000 sets the file type to $06 (BIN) and address to $8000. Note that you actually have to rename the file to include the "#068000" at the end.
CiderPress will take care of adding the DOS header or ProDOS metadata depending on the file system type.
The _FileInformation.txt file is used by Cadius, which only supports ProDOS disk images.
When I'm working with Merlin32 and Cadius I create my own FileInformation.txt template with the metadata I need for my files, rather than relying on the one automatically generated by Merlin32. E.g.:
My _FileInformation.txt file gets copied into a "build" directly along with my binaries generated by Merlin32. Cadius will pickup the metadata automatically:
Thanks for the detailed comment!
I just tried this, and it kind of worked - kind of as 'cp add doesn't seem to be very reliable for some reason. In emulator I delete the file, then run cp add, no error messages but CATALOG with either cp2 or emulator show no file actually added. run same 'cp add' again, bam it shows up.
This might not be related to this particular solution, as I haven't tried to delete from the emulator prior to this, my original cp add command could have the same issue.
One small problem is that I have to rename my binary with the #068000 suffix, but I am going to writre a python script to paruse the assembly source to get the ORG and TYP anyway. so no big deal. Thanks again!