Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Converting screen codes to hex/load addresses
2008-12-27 09:45
Richard

Registered: Dec 2001
Posts: 619
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?

2008-12-27 09:56
Stryyker

Registered: Dec 2001
Posts: 465
What do you mean? Read the screen input that may say $4000 and convert that in to $40 and $00?
2008-12-27 10:36
tlr

Registered: Sep 2003
Posts: 1717
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).
2008-12-27 11:03
Oswald

Registered: Apr 2002
Posts: 5022
$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.
2008-12-27 11:35
hollowman

Registered: Dec 2001
Posts: 474
The topic is "Converting screen codes to hex/load addresses" , not how to read from screen memory.
2008-12-27 11:38
Richard

Registered: Dec 2001
Posts: 619
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?

2008-12-27 11:52
Oswald

Registered: Apr 2002
Posts: 5022
http://codebase64.org/doku.php?id=base:robust_string_input&s=in..
http://codebase64.org/doku.php?id=base:hex_string_to_integer&s=..
2008-12-28 08:29
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

2008-12-28 20:27
Richard

Registered: Dec 2001
Posts: 619
Thanks,

I'll give that a go.
:)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
cobbpg
Board Rider/Commodor..
bOOZElEE
Sentinel/Excess/TREX
Guests online: 119
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.038 sec.