Once I had the Neo6502 emulator up and running on macOS. I wanted to try my hand at Mad Pascal.
I started by downloading and installing Free Pascal.
I then created a project directory called Neo6502 in my user directory. I compiled the Neo6502 emulator there using this guide that I wrote.
Finally, I followed the excellent guide from Wojciech BociaĆski from the Neo6502 Firmware Wiki.
I made a few changes to have everything work properly on macOS. They can be found below.
Clone and compile MADS
git clone <https://github.com/tebe6502/Mad-Assembler.git>
cd Mad-Assembler
fpc -Mdelphi -vh -O3 mads.pas
cd ..
Clone and compile Mad Pascal
git clone <https://github.com/tebe6502/Mad-Pascal.git>
cd Mad-Pascal/src
fpc -Mdelphi -vh -O3 mp.pas
copy mp ..
Write Hello World! program.
cd ../../
nano hello.pas
Paste the following code into nano, then save by typing ctrl-x followed by y .
program hello;
begin
Writeln('Hello neo6502!');
end.
Use Mad Pascal to compile an intermediate assembler file
./Mad-Pascal/mp hello.pas -target:neo -code:5000
Use Mads to compile a binary file.
./Mad-Assembler/mads hello.a65 -x -i:./Mad-Pascal/base -o:hello.bin
Run the program with the emulator.
./neo6502-firmware/emulator/neo hello.bin@5000 run@5000