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: 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?

2008-12-27 09:56
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?
2008-12-27 10:36
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).
2008-12-27 11:03
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.
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: 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?

2008-12-27 11:52
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=..
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: 621
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
Andy/AEG
Alakran_64
Paladin/G★P
LordCrass
MWR/Visdom
Knut Clausen/SHAPE/F..
Guests online: 88
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (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.059 sec.