Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2019, 08:59:18 PM
Home Famicom World Search Calendar Login Register

+  Famicom World
|-+  Family Computer
| |-+  Famicom / Disk System (Moderators: manuel, L___E___T)
| | |-+  peeking and poking around family basic.
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: peeking and poking around family basic.  (Read 4369 times)
ramidavis
Famicom
**
Gender: Male
United States United States
Posts: 44

loopier than a gosub command.


WWW
« on: October 16, 2012, 03:58:55 AM »

I have been peeking and poking around with an idea, the idea of a program that can modify its self. Crazy
This picture will show you what i have tried.

The first 3 lines are my original program that i entered, from a fresh cold boot.
On the next line, i did some peeking, until i found a value of 34, preceeded by a value of 39, my  ' "  . (the '  is short hand for rem, or remark)
Then i poked in the value of "?", 63, to &h6009, the location of the ' , and relisted line 10. There is our ?, which should be short hand for "print". Cool
I decide to give it a go, but do not like the results. I relist line 10, the ? is still there. Huh
I move the cursor back up to the relisted line 10, press return, and again relist line 10.
Now, the ? has expanded into a full "print".
Is there any specific value i could have poked in there that would have done what i thought it should of done?
(Have the program its self turn line 10 from a rem line to a print statement)
I was going to add the peek and poke on the next line, if they were to work, but since it did not work... Cry
Am i just going about it the wrong way? Or would i have had to shift the whole program line and make room for individual "p" "r" "i" "n" "t" characters?
(If it matters, i was doing this with v3... No idea about 2.0 or 2.1) Help
« Last Edit: October 16, 2012, 04:04:50 AM by ramidavis » Logged
80sFREAK
Sharp C1
*****
Gender: Male
Posts: 1192

Hardware freak


« Reply #1 on: October 16, 2012, 08:53:10 AM »

1) You put "?" character, not token "?"
2) Family Basic storing all operators as 1byte value.
Logged

I don't buy, sell or trade at moment.
ramidavis
Famicom
**
Gender: Male
United States United States
Posts: 44

loopier than a gosub command.


WWW
« Reply #2 on: October 16, 2012, 04:39:44 PM »

what would i poke for the token "?", and not the character "?"  ?

Post Merge: October 16, 2012, 09:40:07 PM
I have found a list of BASIC tokens on a web site (for c64, mind you). It has listed that the "print" command token is 139/$99 (decimal/hex. they use $ for hex on c64).
i decided to poke &h99 (same as $99) into family basic, and i got the clear command!
If any one knows anymore &Hxx values for other family basic tokens, i would be interested!  Smiley
« Last Edit: October 16, 2012, 09:40:07 PM by ramidavis » Logged
80sFREAK
Sharp C1
*****
Gender: Male
Posts: 1192

Hardware freak


« Reply #3 on: October 16, 2012, 09:42:39 PM »

You can find by peeking Wink
Tokens list specific for each variation of basic
Logged

I don't buy, sell or trade at moment.
ramidavis
Famicom
**
Gender: Male
United States United States
Posts: 44

loopier than a gosub command.


WWW
« Reply #4 on: October 16, 2012, 09:46:57 PM »

could you give any clue where to start peeking? are all the tokens stored together, one after another at certain address?
 Grin Grin GOT IT!
&H8b == "print"
« Last Edit: October 16, 2012, 09:54:13 PM by ramidavis » Logged
80sFREAK
Sharp C1
*****
Gender: Male
Posts: 1192

Hardware freak


« Reply #5 on: October 16, 2012, 09:54:43 PM »

All tokens stored as list, so you can scan ROM with PEEK
Logged

I don't buy, sell or trade at moment.
ramidavis
Famicom
**
Gender: Male
United States United States
Posts: 44

loopier than a gosub command.


WWW
« Reply #6 on: October 16, 2012, 10:02:21 PM »

getting there  Cool
Logged
UglyJoe
Administrator
Disk-kun
*****
Gender: Male
United States United States
Posts: 5431



WWW
« Reply #7 on: October 17, 2012, 02:50:50 AM »

Commands start at &H80.  You can start iterating at 0 if you want to see a bunch of character data and other corrupt output.

Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!