PEEKing to other memory segments past 64k?

Discussions on programming older machines
Post Reply
Junkman
Posts: 9
Joined: Sat Dec 18, 2021 6:36 pm
Contact:

PEEKing to other memory segments past 64k?

Post by Junkman »

With Cartridge BASIC is is possible to peek to different areas of the PCjr from BASIC? I want to read E0000

I have been playing with an eprom burner and a reproduction JR cart pcb. If I burn some text to an eprom and put it in the second socket on the cartage I have I can see the text in dos DEBUG with "d E000:0000"
The cart puts my eprom at E0000. In decimal that is 917504 which is more then 65535 so I can't just PEEK to it.
Brutman
Site Admin
Posts: 1331
Joined: Sat Jun 21, 2008 5:03 pm
Contact:

Re: PEEKing to other memory segments past 64k?

Post by Brutman »

You want to use the DEF SEG statement. DEF SEG is used to define the segment that PEEK will work off of.

For example:

100 DEF SEG=&HB800
110 POKE 0,65

That sets the active segment to the CGA video buffer, allowing the POKE to modify the video buffer contents.
Junkman
Posts: 9
Joined: Sat Dec 18, 2021 6:36 pm
Contact:

Re: PEEKing to other memory segments past 64k?

Post by Junkman »

Thanks! That is what I was missing. I have only ever messed with basic on 8bit micro's like the trs80 so I never had a need to look past 64k :lol:

Now I can scroll the text I burned to the eprom with:

1 DEF SEG=&HE000
10 FOR A = 1 TO 65534
20 B = PEEK(A)
30 PRINT CHR$(B);
40 NEXT A
Post Reply