| |
Richard
Registered: Dec 2001 Posts: 621 |
Converting screen codes to hex/load addresses
Hi there,
People have been writing programs where you write hexadecimal addresses on screen (I.e. crunchers, linkers, etc) and they are then turned into jump addresses inside the C64's memory banks. Please can you tell us how this this done? Or is there any information about it?
|
|
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
What do you mean? Read the screen input that may say $4000 and convert that in to $40 and $00? |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Screen memory at $0400 is just like any other memory.
The only difference is that when kernal is used, usually the VIC-II reads from it, and often the kernal writes to it (e.g $ffd2). |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
$0400 is just any other memory: can run programs just like any memory location. the fact that its set up as screen memory after turning on your c64 makes you think its a special display only area. its not. |
| |
hollowman
Registered: Dec 2001 Posts: 474 |
The topic is "Converting screen codes to hex/load addresses" , not how to read from screen memory. |
| |
Richard
Registered: Dec 2001 Posts: 621 |
I meant something like this:
Say I input 080D on screen at $0400-$0403 and then I want to convert those four chars into memory to make a jump address. Therefore I would want to place #$0D at $2001 and #$08 at $2002.
Where the monitor should read:
>2000 4C 0D 08 JMP $080D
How is this done?
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
http://codebase64.org/doku.php?id=base:robust_string_input&s=in..
http://codebase64.org/doku.php?id=base:hex_string_to_integer&s=.. |
| |
Majikeyric
Registered: Sep 2002 Posts: 83 |
Something like that :
screen = $0400
temp = $02
lda screen
ldx screen+1
jsr scrtohex
sta jmplab+2
lda screen+2
ldx screen+3
jsr scrtohex
sta jmplab+1
rts
jmplab jmp $ffff
scrtohex jsr scrdigit2hex
asl
asl
asl
asl
sta temp
txa
jsr scrdigit2hex
ora temp
rts
scrdigit2hex cmp #$30
bcc alpha
sbc #$30
rts
alpha adc #9
rts
|
| |
Richard
Registered: Dec 2001 Posts: 621 |
Thanks,
I'll give that a go.
:) |