Buying a Commodore 64 help!

ASM development for the Commodore 64/128 and Commander X16
Post Reply
RetrogamerRhys
Posts: 21
Joined: Mon Oct 07, 2019 3:35 pm

Buying a Commodore 64 help!

Post by RetrogamerRhys » Thu Oct 31, 2019 9:21 am

I'm buying a commodore 64 and I want to know how to use assembley language on it. I know it starts in Basic which is built in but I want to be able to program assembley do I need to load it off a tape or disk? Thanks.

EvilSandwich
Posts: 20
Joined: Wed Nov 13, 2019 7:36 am

Re: Buying a Commodore 64 help!

Post by EvilSandwich » Sat Nov 23, 2019 10:02 am

It depends on what your doing. Thankfully the C64 has a monitor and assembler built right into it.

On the command prompt, type without quotes "MON" to tell the machine that you want to start making an Assembly program.

The format is a tiny bit different than anything you would type in say Notepad++, but the basic format should look familiar.

Try a simple program.

.A2000 INC $D020
.A2003 JMP $2000

After every line, you'll see your code line's HEX equivalent pop up next to it after you press enter and move to the next line. That means, you did it right.

Press Return on a blank line to exit assembly mode.

Then too tell the C64 to run the program you just built, type G2000, which means "Go to memory address $2000 and execute".

Voila! $D020 is where the screen border display memory is kept! You should have flickering colors. To stop the program press Run/Stop+Restore or reset the computer!

This is important. Stay within memory address $1000-$9fff. Anything beyond that is for the C64 system and should be left alone for beginners.

RetrogamerRhys
Posts: 21
Joined: Mon Oct 07, 2019 3:35 pm

Re: Buying a Commodore 64 help!

Post by RetrogamerRhys » Mon Dec 16, 2019 12:27 pm

I have a Cartridge with profi-ass64 on it, can anybody tell me how to use it say to make the border flicker like in the example above. Thanks

FourSeasons
Posts: 16
Joined: Mon Dec 09, 2019 7:38 pm

Re: Buying a Commodore 64 help!

Post by FourSeasons » Mon Dec 16, 2019 5:37 pm

I don't have access to a physical C64 or that cartridge, but according to the documentation (https://www.lyonlabs.org/commodore/onre ... Abacus.pdf), entering this should work:

Code: Select all

10 SYS 32768 ; CALL ASSEMBLER
20 .OPT P
30 *= $C000 ; PGRM START ADDR
40 INC $D020 ; INC BORDER COLOR
50 JMP $C000 ; REPEAT
60 .END

RUN

SYS 49152
The sticking point may be line 10.

When I tried loading the cart image I have for that assembler into an emulator, making that SYS call ran a machine code monitor instead of the assembler.

There may be more information included with the cart, or perhaps given on the cart's label.
Last edited by FourSeasons on Mon Dec 16, 2019 8:59 pm, edited 1 time in total.

FourSeasons
Posts: 16
Joined: Mon Dec 09, 2019 7:38 pm

Re: Buying a Commodore 64 help!

Post by FourSeasons » Mon Dec 16, 2019 8:40 pm

Digging around some more, I found this page for 'Professional Assembler 1.6' for the C64.

https://csdb.dk/release/?id=139650

Could you look a the screenshot at this link and let me know if it looks anything like the software you're trying to use.

If this matches, then I'll dust off my ropey German and take a look through its documentation.

On the other hand, this was a tool created by a member of a demo scene group rather than a commercial release. I'm guessing this means it's unlikely that this was ever on cartridge, but [fx: shrug] you never know.

Could you post a photo of your cart, just to be sure?

RetrogamerRhys
Posts: 21
Joined: Mon Oct 07, 2019 3:35 pm

Re: Buying a Commodore 64 help!

Post by RetrogamerRhys » Tue Dec 17, 2019 3:20 pm

Hi, that's not it sorry, but I will try the code you suggested earlier. Thanks

RetrogamerRhys
Posts: 21
Joined: Mon Oct 07, 2019 3:35 pm

Re: Buying a Commodore 64 help!

Post by RetrogamerRhys » Fri Dec 20, 2019 3:13 pm

The Catridge comes with a piece of software called Hesmon 2.0, which I believe is a monitor program. Anyway of programming the commodore with that and being able to save my work on it? On disk or tape.

FourSeasons
Posts: 16
Joined: Mon Dec 09, 2019 7:38 pm

Re: Buying a Commodore 64 help!

Post by FourSeasons » Sun Dec 22, 2019 7:23 am

Looks like Hesmon https://csdb.dk/release/?id=178510 is just a machine code monitor program.

I don't have a manual for this one, but typically these are more intended to help with debugging than coding. They let you do things like set breakpoints in the code, see the current contents of the CPU registers after the code has run, examine memory, search for strings, etc. More advanced ones will also let you load and save blocks of memory or even disassemble code.

See page 50 and onward in the manual I linked to earlier for an example of one.

Technically you could use them to write new code, but it'd be pretty painful. A regular assembler would be a better bet since they have features that make coding easier. For example, the assembler on your cartridge should allow you to load and save assembler code to disk or tape just like BASIC programs.

By the way, did you have any luck getting the code I posted to work?

If not, could you say how far you were able to get or what error messages you saw?

Also, you might find the book archive linked here useful:

https://archive.org/details/folkscanomy ... mmodore%22

There's a ton of C64 books there from back in the day, including ones on machine language and how to talk to the C64's hardware.

If you don't already have a copy, the official Commodore 64 Programmers Reference Guide is particularly useful:

https://archive.org/details/Commodore_6 ... ommodore_a

RetrogamerRhys
Posts: 21
Joined: Mon Oct 07, 2019 3:35 pm

Re: Buying a Commodore 64 help!

Post by RetrogamerRhys » Sun Dec 22, 2019 11:55 am

I have a Final Catridge 3 + with 64mon on it, will this be suitable to program assembley with?

FourSeasons
Posts: 16
Joined: Mon Dec 09, 2019 7:38 pm

Re: Buying a Commodore 64 help!

Post by FourSeasons » Sun Dec 22, 2019 4:55 pm

If this manual matches the cart you have, then the short answer is yes, you can use it to develop assembler.

https://rr.pokefinder.org/rrwiki/images ... Manual.pdf

That's quite a cool cart, and should make your C64 much more pleasant to work with.

Post Reply

Return to “C64 Assembly Programming”