CCS64 Forum

A forum to discuss issues about CCS64!
It is currently Sun Oct 22, 2017 3:34 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Machine Language Help
PostPosted: Sun May 23, 2004 11:32 pm 
Offline

Joined: Sun May 23, 2004 11:13 pm
Posts: 3
I got my C-64 in 1984 or 1985 when I was 12 or 13. I dabbled in BASIC programming, but always wanted to try the machine language programs I saw in magazines. I could never figure this out (now I know I needed a monitor) so I moved on. I quit programming sometime as a teenager; mostly because I could never get past this machine language issue and because I could find no one who could adequately tell me the practical difference betweein GOTO and GOSUB--and I wasn't destined to be a software engineer.

Having come across this new/ old Commodore 64 world, I'd still like to write one dumb little program in machine language -- I've been frustrated for a long time!

When I use Alt M to get to the machine language monitor, can someone tell me maybe a two line program to type in and how I run it within the CCS64 Emulator?

Thanks,

Brendon


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 24, 2004 9:43 am 
Offline

Joined: Sat Oct 11, 2003 12:12 pm
Posts: 99
Location: Sauerland, Germany
For an compiler (crosscompiler for the C64 - use C) go there : http://www.cc65.org

For programming visit : http://www.6502.org/source/

... can this help you :shock:

_________________
Image
...A MULTIPLAY-CCS64-WEBSITE // CCS64MULTIPLAY SERVER!


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 24, 2004 10:30 pm 
Offline

Joined: Sun May 23, 2004 11:13 pm
Posts: 3
Rebell,

I was more interested in using the CCS64 monitor. So I press Alt M, type in a small machine language program and then run it.

Or am I missing something :?:


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 24, 2004 11:43 pm 
Offline

Joined: Mon Sep 15, 2003 7:14 am
Posts: 66
The monitor comes with minimal built-in documentation that you can access with F1.

Although the monitor is more useful as a debugging tool, you can use it to put together small programs in the emulated C64's memory.

For example, to start "Assembling" a program, use the A command, followed by an address.
Code:
A C000 LDA #0

CCS64 will automatically provide the next address, so you can continue typing the program thus:
Code:
STA D021
LDA #2
STA D021
JMP C000

At this point, press Enter again without typing anything to get out of the assembler. You can then exit the monitor to return to BASIC, and type SYS 49152 (that would be C000 in decimal) to start your little program. Whoa, strobey.

Now you can go back into the monitor and edit the program while it's running. You can change the colours, make it change the border colour instead of the background, or, if you're advanced enough, you could even find a way to make the program exit back to BASIC (with an RTS command) when you press a key on the emulated C64 keyboard.

Now, that's all well and good for experimenting, but for really complex programming, with labels and that sort of thing, it would probably be better to use a dedicated assembler (more accurately, a Machine Language compiler). For example, I use a little DOS program I wrote myself in QuickBasic to assemble P00 files from text files, although I might start using CC65 instead, considering how popular it seems to be. (That is apparently a C compiler, actually, with an included 6502 ML assembler.)

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 25, 2004 12:09 am 
Offline

Joined: Sun May 23, 2004 11:13 pm
Posts: 3
StevenRoy,

THANK YOU! That was a lot better than hello world!

Brendon


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group