Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Peek / Poke
#1
I downloaded gleens list with adresses to peek and poke and i read this:

Momory locations 1264 to 1279 are not used by either DOS or BASIC. Data can be passed from one program to another by POKEing and PEEKing.

So, lets say i want to pass the string "Cool" to antoher program, how do i do it with PEEKing and POKEing.. And also since there are only 15 meomory "segments?" free, I can only pass a limited amout of data between two programs? Right?

Could somebody explain how it's done, how much i can pass over and if this can screw with someother programs.. (It did only say DOS and BASIC don't use those memory locations)..
ttp://hem.passagen.se/qb.basta
Reply
#2
offsets, and there are 16 of them, not 15. (Offset 1264 counts as one memory location.)

Let's say you have PROGRAM1 wanting to pass "Cool" to PROGRAM2. In PROGRAM1:


DEF SEG = 0
BYTE = ASC("C")
POKE 1264, BYTE
BYTE = ASC("o")
POKE 1265, BYTE
POKE 1266, BYTE
BYTE = ASC("l")
POKE 1267, BYTE
DEF SEG


Then, in PROGRAM2:

STRNG$ = ""
DEF SEG = 0
FOR I = 0 TO 3
STRNG$ = STRNG$ + CHR$(PEEK(1264 + I))
NEXT I
DEF SEG
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)