|
Post by Robin Elvin on Apr 4, 2007 7:50:06 GMT -5
I hope this is the right place to post this - you look like the right kind of people to help!
I'm wanting to start coding in assembly on the C64 again and possibly having a go at the VIC-20 as I've never written anything for it before. Back in the day I used an assembler on the 64 but I've heard there are a few assemblers I could run on a PC and move the code to the 64.
So can anyone tell me the best way to write/test/debug code and then transfer it to a real C64 (or VIC-20)? I'm guessing there's an IDE for writing and compiling 6502 code and probably running the code in VICE for testing. Then I assume some sort of transfer cable or X1541 cable to write a disk. I dunno, I'm rather in the dark on this one.
I should also mention I use Linux so that may restrict my options.
Cheers
|
|
|
Post by gmoon on Apr 4, 2007 13:07:23 GMT -5
|
|
|
Post by Robin Elvin on Apr 4, 2007 15:41:52 GMT -5
Cool, thanks for that. I did have a look at the Kickassembler website today and it certainly looks like the biz.
I can actually run most standard Windows apps under Wine but I wanted to avoid that if possible. If need be I will write any Linux/Unix utils myself but again I wanted to avoid that if possible.
I think my major issue is how to run the assembled code. I'm sorry if I'm missing something obvious but I don't know an easy way to do that.
|
|
|
Post by Robin Harbron on Apr 4, 2007 17:07:59 GMT -5
I think my major issue is how to run the assembled code. I'm sorry if I'm missing something obvious but I don't know an easy way to do that. I'd recommend testing on VICE at first. Are you having trouble getting VICE working? In DASM, I use a stub like this to make the resulting binary exectuable: processor 6502 org $0801 dc.b $0b,$08,$d4,$07,$9e,$32,$30,$36,$31,$00,$00,$00 VICE should be able to automatically start a file like that. Typically files like this have a .prg extension. I'm not familiar with Linux to C-64 transfer solutions, but I'm sure someone has documented some methods.
|
|
|
Post by Robin Elvin on Apr 5, 2007 8:19:33 GMT -5
I'd recommend testing on VICE at first. Are you having trouble getting VICE working? Nope, VICE works perfectly. In DASM, I use a stub like this to make the resulting binary exectuable: processor 6502 org $0801 dc.b $0b,$08,$d4,$07,$9e,$32,$30,$36,$31,$00,$00,$00 VICE should be able to automatically start a file like that. Typically files like this have a .prg extension. Ah, that's the sort of thing I need to know. I assume that's the header of .prg files. I'll go hunt the documentation.
|
|
|
Post by Robin Harbron on Apr 5, 2007 9:15:46 GMT -5
Ah, that's the sort of thing I need to know. I assume that's the header of .prg files. I'll go hunt the documentation. I thought I had written up a better explanation of that stub before, and I had, before we moved this board to petscii.com. Here it is: ssocc.proboards45.com/index.cgi?board=crossd&action=display&thread=1139290968BTW, cool to be talking to another Robin about 65xx code - a new experience for me (I'm assuming you're using your real name)
|
|
|
Post by Kurious on Apr 5, 2007 10:31:32 GMT -5
There's also the ca65 assembler, which is included with the cc65 C compiler.
|
|
|
Post by Robin Harbron on Apr 5, 2007 10:56:01 GMT -5
There's also the ca65 assembler, which is included with the cc65 C compiler. That was included in the thorough list gmoon provided a link to, but it is worth a special mention because it's so powerful. However, it has a steeper initial learning curve, so it might not be ideal for someone just getting started.
|
|
|
Post by Robin Elvin on Apr 10, 2007 3:14:17 GMT -5
BTW, cool to be talking to another Robin about 65xx code - a new experience for me (I'm assuming you're using your real name) Ditto and it is my real name
|
|
|
Post by norfair on Apr 25, 2007 13:56:58 GMT -5
Ah, that's the sort of thing I need to know. I assume that's the header of .prg files. I'll go hunt the documentation. I thought I had written up a better explanation of that stub before, and I had, before we moved this board to petscii.com. Here it is: ssocc.proboards45.com/index.cgi?board=crossd&action=display&thread=1139290968BTW, cool to be talking to another Robin about 65xx code - a new experience for me (I'm assuming you're using your real name) Hello! The thread you linked is interesting! I'm having problems running my binary on VICE though, I'll repost what I posted there: I was able to get the example to run in a monitor (using another tutorial but I'm unable to get it to run when I cross-assemble it with dasm. When I drag the resulting binary into the VICE window, the emulator loads it, "runs" it but it just goes straight to the "ready." line without doing anything much. If I SYS to the ORG address it just clears the screen when it should be cycling colors Any ideas?
|
|
|
Post by gmoon on Apr 25, 2007 19:10:44 GMT -5
I was able to get the example to run in a monitor (using another tutorial but I'm unable to get it to run when I cross-assemble it with dasm. When I drag the resulting binary into the VICE window, the emulator loads it, "runs" it but it just goes straight to the "ready." line without doing anything much. If I SYS to the ORG address it just clears the screen when it should be cycling colors SYS to the org addr won't work--Robin's example loads into BASIC space, and the code inserted there begins with a pointer used by BASIC (next line.) If you SYS there, you're treating that pointer as an instruction (and following that pointer are BASIC tokens, etc.) If you post your code here, I'm sure we can help. BTW--I had NO idea you could drag-n-drop prg files into VICE...Cool!
|
|
|
Post by Robin Harbron on Apr 25, 2007 23:33:33 GMT -5
If I SYS to the ORG address it just clears the screen when it should be cycling colors Any ideas? I wonder if you could be using one of the DASM variants that doesn't default to putting the 2-byte load address at the beginning of the output file. Try this command to assemble it: dasm test.asm -f1 Does that make any difference?
|
|
|
Post by norfair on Apr 26, 2007 18:18:08 GMT -5
I used to use a version of DASM that is popular amongst the NES devloppement community: nesdev.parodius.com/dasm32.zipI've only ever owned a commodore 64 for 1 month ... I tackled with NESdev before that. That's where I first learned the (very very) basics of 6502 asm. That's also why I'm ignorant of the particularities of the C64, like this BASIC pointer business! It's all fascinating though. Anyways when I started hunting down C64 programming documentation I stumbled across www.atari2600.org/DASM/ and I've been using the latest version since. I'm going to try that -f1 switch and get back to you. And about drag n' dropping .prg in vice, not only does it work, but it makes your device 8 point to the directory containing the prg. So you can LOAD other things in the same directory after without any outside manipulations edit: the -f1 switch worked!
|
|
|
Post by Robin Harbron on Apr 26, 2007 19:11:03 GMT -5
edit: the -f1 switch worked! Excellent. Those accursed NES and Atari 2600 people corrupting our DASM with their mods...
|
|
|
Post by gmoon on Apr 27, 2007 6:32:57 GMT -5
Glad you got it worked out. And about drag n' dropping .prg in vice, not only does it work, but it makes your device 8 point to the directory containing the prg. So you can LOAD other things in the same directory after without any outside manipulations For XP, I always setup a bat file named 'vice,' something like this: k:\WinVICE-1.20\x64 -autoload %1or k:\WinVICE-1.20\x64 -autostart %1Then start vice and load prog: vice my.prg (I'm working from cmd shell anyway, so it's easy, and with the shell history only needs to be entered once...) But I generally restart VICE every time. The drag-drop will be helpful.
|
|