Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MerlinAssembler_DancingMouseC64

Merlin Assembler on the C64, including a dancing mouse program in assembly language

This repo is the source code created in this youtube video:

https://youtu.be/aa74VOJALwM

Assembling and running the program

System Configuration

The system being used (or emulated) has:

  • 1541-II Drive 8 (merlin64_assembler.d64)
  • 1541-II Drive 9 (mouse-asm.d64)

Load Merlin and the source code into memory

Type the following commands from the C64 BASIC Ready. prompt:

READY.  
LOAD "*",8

SEARCHING FOR *
LOADING
READY.
RUN

At the Merlin menu, type D, then 9 and press enter.
This will change the working disk drive to 9.
Press C to see a catalog of the disk.
It should look something like this:

0 "source      " cz 2a
5 "dancingmouse"    prg
1 "mouse.s"         prg
1 "initscreen.put"  seq
1 "initsound.put"   prg
4 "spdata.put"      seq
2 "loadsprites.put" seq
2 "wait.put"        seq
2 "animate.put"     seq
2 "waitshort.put"   seq
2 "makesound.put    seq
641 blocks free.

Type L, then the word mouse and press enter.
The screen will clear, and the Editor will be started.

Type L and press enter to see a listing of the source code.

Assembling the program

Type asm and press enter. Type N when it asks to Update the Source.
Once the code has finished assembling, type Q and press enter to return back to the main menu.

Saving the object code to disk

Type o to save the object code to disk.
At the %Object: prompt, type in @:mouse (Replacing the word mouse that was defaulted)
Press enter.
This will create a program called mouse.o on drive 9.

Running the assembled program from Merlin

Press E to enter the Editor.
Type mon and press enter.
At the $ prompt, type in 8000g to run the program.
Once the mouse finished dancing across the screen, type q and press enter to return to the main menu.

Running the compiled program from BASIC

Reboot your C64, and type in these commands at the BASIC prompt:

READY.  
LOAD "mouse.o",9

SEARCHING FOR *
LOADING
READY.
SYS 32768

Running the original BASIC program

READY.  
LOAD "DANCINGMOUSE",9

SEARCHING FOR DANCINGMOUSE
LOADING
READY.
RUN

Programming Challenge

There is a known bug in the program where the mouse will skip to the right side of the screen if the program is run a second or more times, See if you can locate and fix the bug.

Please drop a comment on the video with your fix. I'm curious to see how many people can fix it.

About

Merlin Assembler on the C64, including a dancing mouse program in assembly language

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors