Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Poke, peek, def seg
#1
I don't understand peek, poke, def seg, and al the stuff like that. What do they do and how do you use them?
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#2
Peek, Poke and Def Seg - Great resource, that qb help is.

PEEK and POKE read and write bytes fro and to near memory. It's where things like variables, arrays, program memory, bios pointers, the screen, the text buffer, all sorts of nifty things are stored. Glenn has a huge list of memory locations and what they do.

Peeking and poking work as such. Let's say you have your memory address and offset (An address points to 16 byte increments, and an offset is the number of bytes from that point). You set your address with DEF SEG, and then you POKE offset, value.

sooo, let's say we look on glenn's nifty list and find:
&HA000 -> vga screen

so we say:
DEF SEG = &HA000
poke pixelsfromzero, colour

where pixelsfromzero is the x location plus the y location times 320. and we have just plotted a pixel faster than qb's PSET. Of course, there's bunches of things in memory, so you can do bunches of things with PEEK and POKE. Though, it's mostly used as a faster alternative to things already implemented in qb statements, like mid$ or pset.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#3
OK... I get it... So wheres Glenn's list?
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#4
http://www.geocities.com/gstumpff/peekpoke.txt

However, it's not really "my" list. I didn't compile it. I just put it at my site. (I was originally pointed to it by someone else. It's no longer where it originally was on the internet, so I put it on my site. (I have pretty much the same information else, but books sitting around my room aren't really easy to show people who aren't actually *here*. Smile ))
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
#5
thanks!

EDIT: MY 100th POST!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#6
.
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
#7
You can also look at ralf brown's interrupt list, it includes a port list and a memory list
Reply
#8
where is that list?
·····································LINEAR INC·····································
Ø-----------------------------------------------------------------------O
From Problem to Solution - We take the shortest distance
Reply
#9
all over the internet. Google it.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#10
http://www-2.cs.cmu.edu/afs/cs.cmu.edu/u...files.html
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)