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!
Change memory contents using the monitor function of ccs
Moderator: Håkan Sundell
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.
There should be a way to enter text directly, but I've actually never tried it. This might be one for the wish list.
It worked!
Thank you! Changing the letters directly didn`t work, using the ascii-codes was the solution.
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!
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!