Other Software > Developer's Corner
FBSL - How to use machine code to get your CPU name
Gerome:
Hi,
Looks remarkably like what you used to have to do with a Sinclair ZX81 back in the early 70s ;)
Anyone else remember peeking and poking bytes in memory?
-Carol Haynes (March 18, 2006, 06:21 PM)
--- End quote ---
Peek and Poke exist in FBSL also, but they have been enhanced :)
Peek( [@ ]addr[+offset], [$%!#]numofbytes )
Parameters
[@ ]addr[+offset] : address from where to retrieve value(s). @ and offset are extended options
[$%!#]numofbytes : you have to precise the very number of bytes to retrieve from the addr variable, and you have to precise the very type by prefixing the very offset by $, %, ! or #
------------------------------------
Poke( [@ ]addr[+offset], [$%!#]val )
Parameters
[@ ]addr[+offset] : variable [address] where to write value(s).
[$%!#]val : value(s) to write to at mandated address. You have to precise the very type by prefixing the very offset by $, %, ! or #
So ? :)
Carol Haynes:
Ahhhhhhh - a nostaligia rush has just swept over me .... peek-a-boo ? (I won't try the other version in case of misunderstanding ;))
Gerome:
Dear Carol,
Ahhhhhhh - a nostaligia rush has just swept over me .... peek-a-boo ? (I won't try the other version in case of misunderstanding ;))
-Carol Haynes (March 19, 2006, 05:10 AM)
--- End quote ---
There are 2 main reasons why we've put Peek and Poke to Fbsl :
- 1st reason is that Peek and Poke are part of the common 'basic' languages since a long
- 2nd reason is that we have found a way of extending it that any peek poke amateur will find more than a great interest :)
mouser:
i agree with gerome, for historical reasons every basic should have peek and poke commands.
i wonder if vb.net has them.. if not, boycott it!
Carol Haynes:
i agree with gerome, for historical reasons every basic should have peek and poke commands.
i wonder if vb.net has them.. if not, boycott it!
-mouser (March 20, 2006, 03:02 AM)
--- End quote ---
;) You know it hasn't ... not exactly surprising though as the model used for Visual Studio is pretty much an abstraction to remove direct hardware access.
I haven't use Visual C++, presumably it has malloc() and pointers etc. Does it actually address memory or does it just give that impression? If it does then there really isn't a reason not to include peek and poke in VB.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version