CCS64 Forum

A forum to discuss issues about CCS64!
It is currently Tue Oct 17, 2017 9:33 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Sep 15, 2003 2:01 pm 
Offline

Joined: Mon Sep 15, 2003 1:52 pm
Posts: 5
Location: Dresden, Germany
I have the following problem:

How can I change the content of a certain part in the memory? Using "M xxxx" shows the content beginning with the adress xxxx (for example 1f00) but how can I change it? Assembling with "a" doesn`t work because I want to change the text like this:

m 1000
1000 aa bb cc dd ee ff gg HERE IS
1008 aa bb cc dd ee ff gg SOME T
1010 aa bb cc dd ee ff gg TEXT I W
1018 aa bb cc dd ee ff gg ANT TO C
1020 aa bb cc dd ee ff gg HANGE!

Does anybody know how it works? Thank you very much!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2003 1:18 am 
Offline

Joined: Mon Sep 15, 2003 7:14 am
Posts: 66
I usually enter text directly using the hexidecimal codes: $01 for A, $02 for B, all the way up to $1A for Z... Of course, you'd add $40 to each letter if you want ASCII codes instead of screen values.

There should be a way to enter text directly, but I've actually never tried it. This might be one for the wish list.

_________________
Image


Top
 Profile  
 
 Post subject: It worked!
PostPosted: Tue Sep 16, 2003 10:43 am 
Offline

Joined: Mon Sep 15, 2003 1:52 pm
Posts: 5
Location: Dresden, Germany
Thank you! Changing the letters directly didn`t work, using the ascii-codes was the solution.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 11:46 am 
Offline

Joined: Fri Oct 03, 2003 12:19 pm
Posts: 78
what I haven't been able to figure out is how to enter a JSR or JMP in the monitor.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 1:30 am 
Offline

Joined: Mon Sep 15, 2003 7:14 am
Posts: 66
If you mean storing a JMP or JSR into memory using the assembler, that's done the same way as storing other instructions using the "A" command.

If, instead, you mean simulating a JMP by setting the PC register to point to a new location, that's done the same way you set any other register, with the "R" command. For example, "R PC FCE2" will simulate a JMP to memory location FCE2 which is where the C64's reset routine is (unless the currently running program has that ROM banked out).

If, instead, you want to perform a JSR to a location, you'd have to fiddle with the stack and all that, which will probably be more trouble than it's worth. Fortunately, you'll probably hardly ever need to do this. If necessary, it could be easier to assemble the desired JSR in an unused memory location, followed by a JMP back to the current instruction, then change PC to point to the JSR... Or, if changing memory is impractical (I can't think of any reason for that, though!) you can just fake it by noting the current value of the PC register, setting it to point to the subroutine, walking through it, stopping right before the RTS (if your subroutine calls others, make sure you've got the right RTS, and remember to stop before it executes!), and then faking the RTS by manually setting PC back to the prior value. That can be a rather tricky stunt, though. Chances are, you won't ever need it.

If you're in BASIC, you might as well just use the BASIC "SYS" command. That's what it's for. If you need to walk through your routine then you can get into the monitor at the right time by setting an execution breakpoint. That's done with the "BA location E" command. I love the breakpoint feature. Don't debug without it!

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 20, 2003 12:27 am 
Offline

Joined: Fri Oct 03, 2003 12:19 pm
Posts: 78
Well, say i'm cracking a game, an dit's trashed basic, and I want to figure out (by trial and error) the proper jmp location to restart the program (and it doesn't make it easy by setting the restore key's vector) I can't muck with memory because i might break the game.


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

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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