What ways are there to “PEEK” memory sections in (different) BASIC(s)Saving screen pixels to string in ZX BasicWhy were early versions of BASIC different?What is the format of the syntax tables in Apple II Integer BASIC?What books did schools use to teach BASIC?What are the rules for Applesoft BASIC formatting for code?Early BASIC memory managementAre there any old and nowadays active Operating Systems which has only BASIC Programming Language?Strange math syntax in old basic listingWas self-modifying code possible using BASIC?String libraries for BASIC

Looking for a plural noun related to ‘fulcrum’ or ‘pivot’ that denotes multiple things as crucial to success

In Endgame, wouldn't Stark have remembered Hulk busting out of the stairwell?

How many petaflops does it take to land on the moon? What does Artemis need with an Aitken?

Did ancient peoples ever hide their treasure behind puzzles?

Spicing up a moment of peace

Is it unusual for a math department not to have a mail/web server?

Are sweatpants frowned upon on flights?

Normalized Malbolge to Malbolge translator

Is this password scheme legit?

Number of Fingers for a Math Oriented Race

Pen test results for web application include a file from a forbidden directory that is not even used or referenced

Can I lend a small amount of my own money to a bank at the federal funds rate?

Which polygons can be turned inside out by a smooth deformation?

Did the Apollo Guidance Computer really use 60% of the world's ICs in 1963?

The meaning of asynchronous vs synchronous

Why does a sticker slowly peel off, but if it is pulled quickly it tears?

Is it true that different variants of the same model aircraft don't require pilot retraining?

How to handle inventory and story of a player leaving

Why is there not a willingness from the world to step in between Pakistan and India?

Can you illusion a window out of a solid wall?

Does the Tribal card type have inherent mechanical implications?

Should I ask for a raise one month before the end of an internship?

Is the internet in Madagascar faster than in UK?

What's the point of fighting monsters in Zelda BotW?



What ways are there to “PEEK” memory sections in (different) BASIC(s)


Saving screen pixels to string in ZX BasicWhy were early versions of BASIC different?What is the format of the syntax tables in Apple II Integer BASIC?What books did schools use to teach BASIC?What are the rules for Applesoft BASIC formatting for code?Early BASIC memory managementAre there any old and nowadays active Operating Systems which has only BASIC Programming Language?Strange math syntax in old basic listingWas self-modifying code possible using BASIC?String libraries for BASIC






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








5















Question



Was there any BASIC or extension or toolbox for BASIC allowing to PEEK multiple bytes from memory in one instruction - beside the often used DPEEK (or alike) to read a word.



I'm asking specifically for a PEEK alike general purpose function, not specialized ones like for screen access or similar.



Giving examples of specialized functions in addition will still be nice for comparison.




Background



I just learned an awesome new piece of ancient, ancient usage from an answer given by Tofro. There has been a BASIC extension for the Sinclair Spectrum allowing to POKE whole byte sequences to memory. In Beta BASIC a line like



40 POKE 16384,A$


will poke the content of A$ into address 4000h and follow up memory.



This is such a genuine simple and perfect sensible implementation. By now I'm mad at myself. Over the years I created many solutions beating around that bush, but that I've never thought about utilizing PEEK that way. It's brilliant.



Sure, it introduces a little bit of polymorphism into BASIC, which otherwise only goes for a fixed type and optional conversion, like float to int with conventional PEEK/POKE, but that has been done in other places as well.



Now while extending POKE is straight forward (from a language point), the much needed counter part of PEEK is not. That's mainly due the fact that BASIC strings are by default of variable length, thus the interpreter can not take the length to be read from the string (*1,2). Tofro cites in his answer a special access function:



20 LET A$=MEMORY$()(16384 TO 22527)


Not that I would call this elegant, but more important, it's a quite Sinclair-ish notation. So my desire would be to find something more generic with a syntax compatible to more .. lets say standard BASIC.



And that's what I'm looking for




P.S.:



A descovery like this tickles my urge to code. I want this. So far my own approach would be an extension to PEEK like



<var> = PEEK(<adr> [,<len])


Here compatibility is maintained by having an implied length of 1 if not given. In addition it also needs to act different on what type a receiving variable is.



  • If it's an integer (A%) then the bytes addressed get assigned as integer, so optional twisted for byte order (replacing the DPEEK as well).


  • If it's a string (A$) then they get just assigned there.


  • If it's a float (A, A!) everything gets blurry and must be settled by definition.


In fact, having such a function adds several possible errors - like selecting a range to large for the string data type (many BASICS can do only 255 char), or for an integer selecting more bytes than fit in one, and so on.



So I'm even more interested in what kind of solutions in that area were available back then (or today) in BASIC.




*1 - Ignoring for the moment, that this again would be a violation of the basic BASIC design.



*2 - Yes, it would be possible to make the string to contain the wanted amount of bytes beforehand (like in A$=SPACE$(16)) but that'S not only clumsy but as well a horrible design, quite hard to read and error prone.










share|improve this question


























  • when designing something yourself, reading into an array comes to mind as well. or maybe mapping as an array, to avoid copying...

    – Felix Palmen
    11 hours ago











  • @FelixPalmen Hmm, I usually would envision an array as some kind of multiple instance of single variables. So assigning memory data to a string arra seams overly complex. Mapping is a complete different issue. Great idea, and some BASIC like QL?) do allow similar tricks, but thats past the PEEK idea here, This is really about something as basic as PEEK for memory access.

    – Raffzahn
    10 hours ago











  • Just an array of integers of course, similar to a byte[] in some more recent languages. Could allow direct access to a table with less overhead (indexing).

    – Felix Palmen
    10 hours ago











  • @FelixPalmen Jup, that's mustly like the BetterBasic notation of indexing. Here in place operation (aliasing) instead of assigning of values is a great plus. Having such will be useful. Still that's not what I'm looking for. this is really about a factual assignment like PEEK does

    – Raffzahn
    10 hours ago






  • 1





    In my opinion, the MEM device is even more flexible (provided your BASIC/OS can handle random access files well). Beyond strings, it allows to PEEK and POKE other non-scalar types like (multi-dimensional) arrays and other structures in case your BASIC knows such things.

    – tofro
    10 hours ago


















5















Question



Was there any BASIC or extension or toolbox for BASIC allowing to PEEK multiple bytes from memory in one instruction - beside the often used DPEEK (or alike) to read a word.



I'm asking specifically for a PEEK alike general purpose function, not specialized ones like for screen access or similar.



Giving examples of specialized functions in addition will still be nice for comparison.




Background



I just learned an awesome new piece of ancient, ancient usage from an answer given by Tofro. There has been a BASIC extension for the Sinclair Spectrum allowing to POKE whole byte sequences to memory. In Beta BASIC a line like



40 POKE 16384,A$


will poke the content of A$ into address 4000h and follow up memory.



This is such a genuine simple and perfect sensible implementation. By now I'm mad at myself. Over the years I created many solutions beating around that bush, but that I've never thought about utilizing PEEK that way. It's brilliant.



Sure, it introduces a little bit of polymorphism into BASIC, which otherwise only goes for a fixed type and optional conversion, like float to int with conventional PEEK/POKE, but that has been done in other places as well.



Now while extending POKE is straight forward (from a language point), the much needed counter part of PEEK is not. That's mainly due the fact that BASIC strings are by default of variable length, thus the interpreter can not take the length to be read from the string (*1,2). Tofro cites in his answer a special access function:



20 LET A$=MEMORY$()(16384 TO 22527)


Not that I would call this elegant, but more important, it's a quite Sinclair-ish notation. So my desire would be to find something more generic with a syntax compatible to more .. lets say standard BASIC.



And that's what I'm looking for




P.S.:



A descovery like this tickles my urge to code. I want this. So far my own approach would be an extension to PEEK like



<var> = PEEK(<adr> [,<len])


Here compatibility is maintained by having an implied length of 1 if not given. In addition it also needs to act different on what type a receiving variable is.



  • If it's an integer (A%) then the bytes addressed get assigned as integer, so optional twisted for byte order (replacing the DPEEK as well).


  • If it's a string (A$) then they get just assigned there.


  • If it's a float (A, A!) everything gets blurry and must be settled by definition.


In fact, having such a function adds several possible errors - like selecting a range to large for the string data type (many BASICS can do only 255 char), or for an integer selecting more bytes than fit in one, and so on.



So I'm even more interested in what kind of solutions in that area were available back then (or today) in BASIC.




*1 - Ignoring for the moment, that this again would be a violation of the basic BASIC design.



*2 - Yes, it would be possible to make the string to contain the wanted amount of bytes beforehand (like in A$=SPACE$(16)) but that'S not only clumsy but as well a horrible design, quite hard to read and error prone.










share|improve this question


























  • when designing something yourself, reading into an array comes to mind as well. or maybe mapping as an array, to avoid copying...

    – Felix Palmen
    11 hours ago











  • @FelixPalmen Hmm, I usually would envision an array as some kind of multiple instance of single variables. So assigning memory data to a string arra seams overly complex. Mapping is a complete different issue. Great idea, and some BASIC like QL?) do allow similar tricks, but thats past the PEEK idea here, This is really about something as basic as PEEK for memory access.

    – Raffzahn
    10 hours ago











  • Just an array of integers of course, similar to a byte[] in some more recent languages. Could allow direct access to a table with less overhead (indexing).

    – Felix Palmen
    10 hours ago











  • @FelixPalmen Jup, that's mustly like the BetterBasic notation of indexing. Here in place operation (aliasing) instead of assigning of values is a great plus. Having such will be useful. Still that's not what I'm looking for. this is really about a factual assignment like PEEK does

    – Raffzahn
    10 hours ago






  • 1





    In my opinion, the MEM device is even more flexible (provided your BASIC/OS can handle random access files well). Beyond strings, it allows to PEEK and POKE other non-scalar types like (multi-dimensional) arrays and other structures in case your BASIC knows such things.

    – tofro
    10 hours ago














5












5








5








Question



Was there any BASIC or extension or toolbox for BASIC allowing to PEEK multiple bytes from memory in one instruction - beside the often used DPEEK (or alike) to read a word.



I'm asking specifically for a PEEK alike general purpose function, not specialized ones like for screen access or similar.



Giving examples of specialized functions in addition will still be nice for comparison.




Background



I just learned an awesome new piece of ancient, ancient usage from an answer given by Tofro. There has been a BASIC extension for the Sinclair Spectrum allowing to POKE whole byte sequences to memory. In Beta BASIC a line like



40 POKE 16384,A$


will poke the content of A$ into address 4000h and follow up memory.



This is such a genuine simple and perfect sensible implementation. By now I'm mad at myself. Over the years I created many solutions beating around that bush, but that I've never thought about utilizing PEEK that way. It's brilliant.



Sure, it introduces a little bit of polymorphism into BASIC, which otherwise only goes for a fixed type and optional conversion, like float to int with conventional PEEK/POKE, but that has been done in other places as well.



Now while extending POKE is straight forward (from a language point), the much needed counter part of PEEK is not. That's mainly due the fact that BASIC strings are by default of variable length, thus the interpreter can not take the length to be read from the string (*1,2). Tofro cites in his answer a special access function:



20 LET A$=MEMORY$()(16384 TO 22527)


Not that I would call this elegant, but more important, it's a quite Sinclair-ish notation. So my desire would be to find something more generic with a syntax compatible to more .. lets say standard BASIC.



And that's what I'm looking for




P.S.:



A descovery like this tickles my urge to code. I want this. So far my own approach would be an extension to PEEK like



<var> = PEEK(<adr> [,<len])


Here compatibility is maintained by having an implied length of 1 if not given. In addition it also needs to act different on what type a receiving variable is.



  • If it's an integer (A%) then the bytes addressed get assigned as integer, so optional twisted for byte order (replacing the DPEEK as well).


  • If it's a string (A$) then they get just assigned there.


  • If it's a float (A, A!) everything gets blurry and must be settled by definition.


In fact, having such a function adds several possible errors - like selecting a range to large for the string data type (many BASICS can do only 255 char), or for an integer selecting more bytes than fit in one, and so on.



So I'm even more interested in what kind of solutions in that area were available back then (or today) in BASIC.




*1 - Ignoring for the moment, that this again would be a violation of the basic BASIC design.



*2 - Yes, it would be possible to make the string to contain the wanted amount of bytes beforehand (like in A$=SPACE$(16)) but that'S not only clumsy but as well a horrible design, quite hard to read and error prone.










share|improve this question
















Question



Was there any BASIC or extension or toolbox for BASIC allowing to PEEK multiple bytes from memory in one instruction - beside the often used DPEEK (or alike) to read a word.



I'm asking specifically for a PEEK alike general purpose function, not specialized ones like for screen access or similar.



Giving examples of specialized functions in addition will still be nice for comparison.




Background



I just learned an awesome new piece of ancient, ancient usage from an answer given by Tofro. There has been a BASIC extension for the Sinclair Spectrum allowing to POKE whole byte sequences to memory. In Beta BASIC a line like



40 POKE 16384,A$


will poke the content of A$ into address 4000h and follow up memory.



This is such a genuine simple and perfect sensible implementation. By now I'm mad at myself. Over the years I created many solutions beating around that bush, but that I've never thought about utilizing PEEK that way. It's brilliant.



Sure, it introduces a little bit of polymorphism into BASIC, which otherwise only goes for a fixed type and optional conversion, like float to int with conventional PEEK/POKE, but that has been done in other places as well.



Now while extending POKE is straight forward (from a language point), the much needed counter part of PEEK is not. That's mainly due the fact that BASIC strings are by default of variable length, thus the interpreter can not take the length to be read from the string (*1,2). Tofro cites in his answer a special access function:



20 LET A$=MEMORY$()(16384 TO 22527)


Not that I would call this elegant, but more important, it's a quite Sinclair-ish notation. So my desire would be to find something more generic with a syntax compatible to more .. lets say standard BASIC.



And that's what I'm looking for




P.S.:



A descovery like this tickles my urge to code. I want this. So far my own approach would be an extension to PEEK like



<var> = PEEK(<adr> [,<len])


Here compatibility is maintained by having an implied length of 1 if not given. In addition it also needs to act different on what type a receiving variable is.



  • If it's an integer (A%) then the bytes addressed get assigned as integer, so optional twisted for byte order (replacing the DPEEK as well).


  • If it's a string (A$) then they get just assigned there.


  • If it's a float (A, A!) everything gets blurry and must be settled by definition.


In fact, having such a function adds several possible errors - like selecting a range to large for the string data type (many BASICS can do only 255 char), or for an integer selecting more bytes than fit in one, and so on.



So I'm even more interested in what kind of solutions in that area were available back then (or today) in BASIC.




*1 - Ignoring for the moment, that this again would be a violation of the basic BASIC design.



*2 - Yes, it would be possible to make the string to contain the wanted amount of bytes beforehand (like in A$=SPACE$(16)) but that'S not only clumsy but as well a horrible design, quite hard to read and error prone.







basic language-design






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago







Raffzahn

















asked 11 hours ago









RaffzahnRaffzahn

67.8k6 gold badges168 silver badges280 bronze badges




67.8k6 gold badges168 silver badges280 bronze badges















  • when designing something yourself, reading into an array comes to mind as well. or maybe mapping as an array, to avoid copying...

    – Felix Palmen
    11 hours ago











  • @FelixPalmen Hmm, I usually would envision an array as some kind of multiple instance of single variables. So assigning memory data to a string arra seams overly complex. Mapping is a complete different issue. Great idea, and some BASIC like QL?) do allow similar tricks, but thats past the PEEK idea here, This is really about something as basic as PEEK for memory access.

    – Raffzahn
    10 hours ago











  • Just an array of integers of course, similar to a byte[] in some more recent languages. Could allow direct access to a table with less overhead (indexing).

    – Felix Palmen
    10 hours ago











  • @FelixPalmen Jup, that's mustly like the BetterBasic notation of indexing. Here in place operation (aliasing) instead of assigning of values is a great plus. Having such will be useful. Still that's not what I'm looking for. this is really about a factual assignment like PEEK does

    – Raffzahn
    10 hours ago






  • 1





    In my opinion, the MEM device is even more flexible (provided your BASIC/OS can handle random access files well). Beyond strings, it allows to PEEK and POKE other non-scalar types like (multi-dimensional) arrays and other structures in case your BASIC knows such things.

    – tofro
    10 hours ago


















  • when designing something yourself, reading into an array comes to mind as well. or maybe mapping as an array, to avoid copying...

    – Felix Palmen
    11 hours ago











  • @FelixPalmen Hmm, I usually would envision an array as some kind of multiple instance of single variables. So assigning memory data to a string arra seams overly complex. Mapping is a complete different issue. Great idea, and some BASIC like QL?) do allow similar tricks, but thats past the PEEK idea here, This is really about something as basic as PEEK for memory access.

    – Raffzahn
    10 hours ago











  • Just an array of integers of course, similar to a byte[] in some more recent languages. Could allow direct access to a table with less overhead (indexing).

    – Felix Palmen
    10 hours ago











  • @FelixPalmen Jup, that's mustly like the BetterBasic notation of indexing. Here in place operation (aliasing) instead of assigning of values is a great plus. Having such will be useful. Still that's not what I'm looking for. this is really about a factual assignment like PEEK does

    – Raffzahn
    10 hours ago






  • 1





    In my opinion, the MEM device is even more flexible (provided your BASIC/OS can handle random access files well). Beyond strings, it allows to PEEK and POKE other non-scalar types like (multi-dimensional) arrays and other structures in case your BASIC knows such things.

    – tofro
    10 hours ago

















when designing something yourself, reading into an array comes to mind as well. or maybe mapping as an array, to avoid copying...

– Felix Palmen
11 hours ago





when designing something yourself, reading into an array comes to mind as well. or maybe mapping as an array, to avoid copying...

– Felix Palmen
11 hours ago













@FelixPalmen Hmm, I usually would envision an array as some kind of multiple instance of single variables. So assigning memory data to a string arra seams overly complex. Mapping is a complete different issue. Great idea, and some BASIC like QL?) do allow similar tricks, but thats past the PEEK idea here, This is really about something as basic as PEEK for memory access.

– Raffzahn
10 hours ago





@FelixPalmen Hmm, I usually would envision an array as some kind of multiple instance of single variables. So assigning memory data to a string arra seams overly complex. Mapping is a complete different issue. Great idea, and some BASIC like QL?) do allow similar tricks, but thats past the PEEK idea here, This is really about something as basic as PEEK for memory access.

– Raffzahn
10 hours ago













Just an array of integers of course, similar to a byte[] in some more recent languages. Could allow direct access to a table with less overhead (indexing).

– Felix Palmen
10 hours ago





Just an array of integers of course, similar to a byte[] in some more recent languages. Could allow direct access to a table with less overhead (indexing).

– Felix Palmen
10 hours ago













@FelixPalmen Jup, that's mustly like the BetterBasic notation of indexing. Here in place operation (aliasing) instead of assigning of values is a great plus. Having such will be useful. Still that's not what I'm looking for. this is really about a factual assignment like PEEK does

– Raffzahn
10 hours ago





@FelixPalmen Jup, that's mustly like the BetterBasic notation of indexing. Here in place operation (aliasing) instead of assigning of values is a great plus. Having such will be useful. Still that's not what I'm looking for. this is really about a factual assignment like PEEK does

– Raffzahn
10 hours ago




1




1





In my opinion, the MEM device is even more flexible (provided your BASIC/OS can handle random access files well). Beyond strings, it allows to PEEK and POKE other non-scalar types like (multi-dimensional) arrays and other structures in case your BASIC knows such things.

– tofro
10 hours ago






In my opinion, the MEM device is even more flexible (provided your BASIC/OS can handle random access files well). Beyond strings, it allows to PEEK and POKE other non-scalar types like (multi-dimensional) arrays and other structures in case your BASIC knows such things.

– tofro
10 hours ago











3 Answers
3






active

oldest

votes


















8















BBC BASIC didn't use the PEEK or POKE keywords, but had the ? operator and statement which had the same effect. So the statement ?128 = 0 is equivalent to POKE 128, 0, and the expression ?128 is equivalent to PEEK 128. However, it also had ! and $ which did 32-bit and string peeks and pokes and e.g. $128 = "HELLO" would write the ASCII bytes of "HELLO" into locations 128–132, and terminate the string with a carriage-return (0x0D) terminator in location 133.



Syntax such as A?3 could also be used and was equivalent to ?(A+3). This is obviously useful for packing and unpacking structures. This also leads to confusing syntax such as A$1 = "foo". (BBC BASIC written with all of the efficiency tricks turned up to eleven could be hard to read.)



The terminator in the string operation was occasionally undesired, since it might either be unnecessary and clobbering something else in memory, or was the wrong terminator and required a bit of a dance to work around. Such strange limitations quickly push people towards the assembler...






share|improve this answer

























  • I'm a bit confused as how that works with the basic use of '?' in BASIC as abrevation of print. ?128 should print out a line spelled "128<cr>", souldn't it?

    – Raffzahn
    10 hours ago






  • 1





    @Raffzahn Apparently it's known as the query operator. That said, I don't remember if it existed or not on the actual machines. My fuzzy memories of using BBC Basic years ago and wanting direct memory access involved using inline assembly. Or rather, copying inline assembly out of magazines, because at that young age I knew enough to do Basic but not assembly.

    – Dranon
    8 hours ago






  • 1





    BBC Basic used P. for the print abbreviation. IIRC, most of BBC Basic shortcuts were of the letter + . variety

    – SeanC
    2 hours ago


















5















ZX Spectrum Beta Basic



MEMORY$ is a pseudo-variable that considers the whole 64k of memory a string. By slicing it (Sinclair's way of implementing LEFT$, RIGHT$,...) you can pick memory areas into string variables.



10 REM Move memory to a string
20 LET a$=MEMORY$()(16384 TO 22527)
30 REM Move back
40 POKE 16384,a$


Sinclair QL SuperBASIC and Turbo Toolkit Basic extension



Standard QL BASIC nows how to PEEK and POKE scalar integer types to/from memory



10 x$ = PEEK (x) : REMark PEEK a byte
20 POKE x, x$ : REMark POKE it back
30 x% = PEEK_W (x) : REMark PEEK a 16-bit word
40 POKE_W (x, x%) : REMark POKE it back
45 REMark Note Sinclair QL BASIC doesn't have a 32-bit int type
50 x = PEEK_L (y) : REMark PEEK a 32-bit long, convert it to float
60 POKE_L (y, x) : REMark convert float to long, poke it
70 : REMark last two obviously only work on even addresses


Some toolkits (BASIC extensions) did the logical thing and implemented the same for strings (just like you proposed):



10 x$ = PEEK$ (x) : REMark assume x holds a string in standard QL format
20 : REMark (word length, then characters), fill x$ with it
30 POKE$ (x, x$) : REMark POKE it back
40 x$ = PEEK$ (x, len) : REMark Does the same thing, but takes the string length
50 : REMark as an argument, and PEEKs only the characters


You also had the same for floating point variables



10 x = PEEK_F (y) : REMark assumes y holds 6-byte FP in QL native format
20 POKE_F (y, x) : REMark poke it back without first converting to byte


Sinclair QL MEM pseudo-device



Another elegant (in my opinion, even more elegant than the above) approach to do the same thing is to supply a pseudo-device driver that pretends the memory is a random-access device:



10 OPEN #4, MEM
20 GET #4x,x$ : REMark position file pointer (i.e. address) to x, then read string x$
30 PUT #4x,x$ : REMark put it back
40 CLOSE #4 : REMark close the "file"


Note this works with any other type as well, including arrays (and is, thus, way more flexible than the above approach of extending PEEK and POKE). The MEM device driver I am working with has the added feature that you can add an address to the device name like



10 a = ALCHP (1024) : REMark allocate 1k of common heap, put the address into a
20 OPEN #4,"MEM_" & a : REMark device name is now MEM_<address>.
30 : REMark You can now work with relative offsets from a
40 : REMark and not from 0


Because the QL had some rudimentary network and a file server function, you could even open the "MEM" pseudo device on a server, and "PEEK and POKE" there:



10 OPEN #4,NET1_MEM_131072


Would open #4 to the screen memory of the QL with network station address 1. You could then save (or modify) the screen from the other box on a file on your local drives. Not extactly "safe", but nerdy ;)






share|improve this answer



























  • Oops? why deleting it? Anyway, Thanks a lot. great writeup. So sinclair used different PEEKs. Ok. The Memory-Device is cool. But when using with a base address, tehre is no upper likint, right? Allocating 1K on the heap would still allow it to write past that length?

    – Raffzahn
    10 hours ago






  • 1





    Somehow created a duplicate answer. Yes to your question: No airbags, no belts, no braces in that specific driver. You could, however, extend the device name encoding to implement an upper limit, like "MEM_<lower>_<upper>" and range check access - The QL's device name encoding allowed that. But that was not part of that specific implementation.

    – tofro
    10 hours ago



















0















POKE and PEEK were used a lot in the Commodore 64 BASIC V2, as it was completely lacking in high-level commands to manipulate the screen, sprites, IO and so on.



For example:



POKE 53281, 0


would set the screen background to black.



Conversely



C = PEEK(53281)


would return an integer corresponding to the screen background colour and place it in variable 'C'.






share|improve this answer

























  • How is this related to the question?

    – Felix Palmen
    8 hours ago






  • 1





    I probably misunderstood the question title now that I read it again.

    – Alan B
    8 hours ago













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "648"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f12168%2fwhat-ways-are-there-to-peek-memory-sections-in-different-basics%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









8















BBC BASIC didn't use the PEEK or POKE keywords, but had the ? operator and statement which had the same effect. So the statement ?128 = 0 is equivalent to POKE 128, 0, and the expression ?128 is equivalent to PEEK 128. However, it also had ! and $ which did 32-bit and string peeks and pokes and e.g. $128 = "HELLO" would write the ASCII bytes of "HELLO" into locations 128–132, and terminate the string with a carriage-return (0x0D) terminator in location 133.



Syntax such as A?3 could also be used and was equivalent to ?(A+3). This is obviously useful for packing and unpacking structures. This also leads to confusing syntax such as A$1 = "foo". (BBC BASIC written with all of the efficiency tricks turned up to eleven could be hard to read.)



The terminator in the string operation was occasionally undesired, since it might either be unnecessary and clobbering something else in memory, or was the wrong terminator and required a bit of a dance to work around. Such strange limitations quickly push people towards the assembler...






share|improve this answer

























  • I'm a bit confused as how that works with the basic use of '?' in BASIC as abrevation of print. ?128 should print out a line spelled "128<cr>", souldn't it?

    – Raffzahn
    10 hours ago






  • 1





    @Raffzahn Apparently it's known as the query operator. That said, I don't remember if it existed or not on the actual machines. My fuzzy memories of using BBC Basic years ago and wanting direct memory access involved using inline assembly. Or rather, copying inline assembly out of magazines, because at that young age I knew enough to do Basic but not assembly.

    – Dranon
    8 hours ago






  • 1





    BBC Basic used P. for the print abbreviation. IIRC, most of BBC Basic shortcuts were of the letter + . variety

    – SeanC
    2 hours ago















8















BBC BASIC didn't use the PEEK or POKE keywords, but had the ? operator and statement which had the same effect. So the statement ?128 = 0 is equivalent to POKE 128, 0, and the expression ?128 is equivalent to PEEK 128. However, it also had ! and $ which did 32-bit and string peeks and pokes and e.g. $128 = "HELLO" would write the ASCII bytes of "HELLO" into locations 128–132, and terminate the string with a carriage-return (0x0D) terminator in location 133.



Syntax such as A?3 could also be used and was equivalent to ?(A+3). This is obviously useful for packing and unpacking structures. This also leads to confusing syntax such as A$1 = "foo". (BBC BASIC written with all of the efficiency tricks turned up to eleven could be hard to read.)



The terminator in the string operation was occasionally undesired, since it might either be unnecessary and clobbering something else in memory, or was the wrong terminator and required a bit of a dance to work around. Such strange limitations quickly push people towards the assembler...






share|improve this answer

























  • I'm a bit confused as how that works with the basic use of '?' in BASIC as abrevation of print. ?128 should print out a line spelled "128<cr>", souldn't it?

    – Raffzahn
    10 hours ago






  • 1





    @Raffzahn Apparently it's known as the query operator. That said, I don't remember if it existed or not on the actual machines. My fuzzy memories of using BBC Basic years ago and wanting direct memory access involved using inline assembly. Or rather, copying inline assembly out of magazines, because at that young age I knew enough to do Basic but not assembly.

    – Dranon
    8 hours ago






  • 1





    BBC Basic used P. for the print abbreviation. IIRC, most of BBC Basic shortcuts were of the letter + . variety

    – SeanC
    2 hours ago













8














8










8









BBC BASIC didn't use the PEEK or POKE keywords, but had the ? operator and statement which had the same effect. So the statement ?128 = 0 is equivalent to POKE 128, 0, and the expression ?128 is equivalent to PEEK 128. However, it also had ! and $ which did 32-bit and string peeks and pokes and e.g. $128 = "HELLO" would write the ASCII bytes of "HELLO" into locations 128–132, and terminate the string with a carriage-return (0x0D) terminator in location 133.



Syntax such as A?3 could also be used and was equivalent to ?(A+3). This is obviously useful for packing and unpacking structures. This also leads to confusing syntax such as A$1 = "foo". (BBC BASIC written with all of the efficiency tricks turned up to eleven could be hard to read.)



The terminator in the string operation was occasionally undesired, since it might either be unnecessary and clobbering something else in memory, or was the wrong terminator and required a bit of a dance to work around. Such strange limitations quickly push people towards the assembler...






share|improve this answer













BBC BASIC didn't use the PEEK or POKE keywords, but had the ? operator and statement which had the same effect. So the statement ?128 = 0 is equivalent to POKE 128, 0, and the expression ?128 is equivalent to PEEK 128. However, it also had ! and $ which did 32-bit and string peeks and pokes and e.g. $128 = "HELLO" would write the ASCII bytes of "HELLO" into locations 128–132, and terminate the string with a carriage-return (0x0D) terminator in location 133.



Syntax such as A?3 could also be used and was equivalent to ?(A+3). This is obviously useful for packing and unpacking structures. This also leads to confusing syntax such as A$1 = "foo". (BBC BASIC written with all of the efficiency tricks turned up to eleven could be hard to read.)



The terminator in the string operation was occasionally undesired, since it might either be unnecessary and clobbering something else in memory, or was the wrong terminator and required a bit of a dance to work around. Such strange limitations quickly push people towards the assembler...







share|improve this answer












share|improve this answer



share|improve this answer










answered 11 hours ago









pndcpndc

6,4352 gold badges28 silver badges42 bronze badges




6,4352 gold badges28 silver badges42 bronze badges















  • I'm a bit confused as how that works with the basic use of '?' in BASIC as abrevation of print. ?128 should print out a line spelled "128<cr>", souldn't it?

    – Raffzahn
    10 hours ago






  • 1





    @Raffzahn Apparently it's known as the query operator. That said, I don't remember if it existed or not on the actual machines. My fuzzy memories of using BBC Basic years ago and wanting direct memory access involved using inline assembly. Or rather, copying inline assembly out of magazines, because at that young age I knew enough to do Basic but not assembly.

    – Dranon
    8 hours ago






  • 1





    BBC Basic used P. for the print abbreviation. IIRC, most of BBC Basic shortcuts were of the letter + . variety

    – SeanC
    2 hours ago

















  • I'm a bit confused as how that works with the basic use of '?' in BASIC as abrevation of print. ?128 should print out a line spelled "128<cr>", souldn't it?

    – Raffzahn
    10 hours ago






  • 1





    @Raffzahn Apparently it's known as the query operator. That said, I don't remember if it existed or not on the actual machines. My fuzzy memories of using BBC Basic years ago and wanting direct memory access involved using inline assembly. Or rather, copying inline assembly out of magazines, because at that young age I knew enough to do Basic but not assembly.

    – Dranon
    8 hours ago






  • 1





    BBC Basic used P. for the print abbreviation. IIRC, most of BBC Basic shortcuts were of the letter + . variety

    – SeanC
    2 hours ago
















I'm a bit confused as how that works with the basic use of '?' in BASIC as abrevation of print. ?128 should print out a line spelled "128<cr>", souldn't it?

– Raffzahn
10 hours ago





I'm a bit confused as how that works with the basic use of '?' in BASIC as abrevation of print. ?128 should print out a line spelled "128<cr>", souldn't it?

– Raffzahn
10 hours ago




1




1





@Raffzahn Apparently it's known as the query operator. That said, I don't remember if it existed or not on the actual machines. My fuzzy memories of using BBC Basic years ago and wanting direct memory access involved using inline assembly. Or rather, copying inline assembly out of magazines, because at that young age I knew enough to do Basic but not assembly.

– Dranon
8 hours ago





@Raffzahn Apparently it's known as the query operator. That said, I don't remember if it existed or not on the actual machines. My fuzzy memories of using BBC Basic years ago and wanting direct memory access involved using inline assembly. Or rather, copying inline assembly out of magazines, because at that young age I knew enough to do Basic but not assembly.

– Dranon
8 hours ago




1




1





BBC Basic used P. for the print abbreviation. IIRC, most of BBC Basic shortcuts were of the letter + . variety

– SeanC
2 hours ago





BBC Basic used P. for the print abbreviation. IIRC, most of BBC Basic shortcuts were of the letter + . variety

– SeanC
2 hours ago













5















ZX Spectrum Beta Basic



MEMORY$ is a pseudo-variable that considers the whole 64k of memory a string. By slicing it (Sinclair's way of implementing LEFT$, RIGHT$,...) you can pick memory areas into string variables.



10 REM Move memory to a string
20 LET a$=MEMORY$()(16384 TO 22527)
30 REM Move back
40 POKE 16384,a$


Sinclair QL SuperBASIC and Turbo Toolkit Basic extension



Standard QL BASIC nows how to PEEK and POKE scalar integer types to/from memory



10 x$ = PEEK (x) : REMark PEEK a byte
20 POKE x, x$ : REMark POKE it back
30 x% = PEEK_W (x) : REMark PEEK a 16-bit word
40 POKE_W (x, x%) : REMark POKE it back
45 REMark Note Sinclair QL BASIC doesn't have a 32-bit int type
50 x = PEEK_L (y) : REMark PEEK a 32-bit long, convert it to float
60 POKE_L (y, x) : REMark convert float to long, poke it
70 : REMark last two obviously only work on even addresses


Some toolkits (BASIC extensions) did the logical thing and implemented the same for strings (just like you proposed):



10 x$ = PEEK$ (x) : REMark assume x holds a string in standard QL format
20 : REMark (word length, then characters), fill x$ with it
30 POKE$ (x, x$) : REMark POKE it back
40 x$ = PEEK$ (x, len) : REMark Does the same thing, but takes the string length
50 : REMark as an argument, and PEEKs only the characters


You also had the same for floating point variables



10 x = PEEK_F (y) : REMark assumes y holds 6-byte FP in QL native format
20 POKE_F (y, x) : REMark poke it back without first converting to byte


Sinclair QL MEM pseudo-device



Another elegant (in my opinion, even more elegant than the above) approach to do the same thing is to supply a pseudo-device driver that pretends the memory is a random-access device:



10 OPEN #4, MEM
20 GET #4x,x$ : REMark position file pointer (i.e. address) to x, then read string x$
30 PUT #4x,x$ : REMark put it back
40 CLOSE #4 : REMark close the "file"


Note this works with any other type as well, including arrays (and is, thus, way more flexible than the above approach of extending PEEK and POKE). The MEM device driver I am working with has the added feature that you can add an address to the device name like



10 a = ALCHP (1024) : REMark allocate 1k of common heap, put the address into a
20 OPEN #4,"MEM_" & a : REMark device name is now MEM_<address>.
30 : REMark You can now work with relative offsets from a
40 : REMark and not from 0


Because the QL had some rudimentary network and a file server function, you could even open the "MEM" pseudo device on a server, and "PEEK and POKE" there:



10 OPEN #4,NET1_MEM_131072


Would open #4 to the screen memory of the QL with network station address 1. You could then save (or modify) the screen from the other box on a file on your local drives. Not extactly "safe", but nerdy ;)






share|improve this answer



























  • Oops? why deleting it? Anyway, Thanks a lot. great writeup. So sinclair used different PEEKs. Ok. The Memory-Device is cool. But when using with a base address, tehre is no upper likint, right? Allocating 1K on the heap would still allow it to write past that length?

    – Raffzahn
    10 hours ago






  • 1





    Somehow created a duplicate answer. Yes to your question: No airbags, no belts, no braces in that specific driver. You could, however, extend the device name encoding to implement an upper limit, like "MEM_<lower>_<upper>" and range check access - The QL's device name encoding allowed that. But that was not part of that specific implementation.

    – tofro
    10 hours ago
















5















ZX Spectrum Beta Basic



MEMORY$ is a pseudo-variable that considers the whole 64k of memory a string. By slicing it (Sinclair's way of implementing LEFT$, RIGHT$,...) you can pick memory areas into string variables.



10 REM Move memory to a string
20 LET a$=MEMORY$()(16384 TO 22527)
30 REM Move back
40 POKE 16384,a$


Sinclair QL SuperBASIC and Turbo Toolkit Basic extension



Standard QL BASIC nows how to PEEK and POKE scalar integer types to/from memory



10 x$ = PEEK (x) : REMark PEEK a byte
20 POKE x, x$ : REMark POKE it back
30 x% = PEEK_W (x) : REMark PEEK a 16-bit word
40 POKE_W (x, x%) : REMark POKE it back
45 REMark Note Sinclair QL BASIC doesn't have a 32-bit int type
50 x = PEEK_L (y) : REMark PEEK a 32-bit long, convert it to float
60 POKE_L (y, x) : REMark convert float to long, poke it
70 : REMark last two obviously only work on even addresses


Some toolkits (BASIC extensions) did the logical thing and implemented the same for strings (just like you proposed):



10 x$ = PEEK$ (x) : REMark assume x holds a string in standard QL format
20 : REMark (word length, then characters), fill x$ with it
30 POKE$ (x, x$) : REMark POKE it back
40 x$ = PEEK$ (x, len) : REMark Does the same thing, but takes the string length
50 : REMark as an argument, and PEEKs only the characters


You also had the same for floating point variables



10 x = PEEK_F (y) : REMark assumes y holds 6-byte FP in QL native format
20 POKE_F (y, x) : REMark poke it back without first converting to byte


Sinclair QL MEM pseudo-device



Another elegant (in my opinion, even more elegant than the above) approach to do the same thing is to supply a pseudo-device driver that pretends the memory is a random-access device:



10 OPEN #4, MEM
20 GET #4x,x$ : REMark position file pointer (i.e. address) to x, then read string x$
30 PUT #4x,x$ : REMark put it back
40 CLOSE #4 : REMark close the "file"


Note this works with any other type as well, including arrays (and is, thus, way more flexible than the above approach of extending PEEK and POKE). The MEM device driver I am working with has the added feature that you can add an address to the device name like



10 a = ALCHP (1024) : REMark allocate 1k of common heap, put the address into a
20 OPEN #4,"MEM_" & a : REMark device name is now MEM_<address>.
30 : REMark You can now work with relative offsets from a
40 : REMark and not from 0


Because the QL had some rudimentary network and a file server function, you could even open the "MEM" pseudo device on a server, and "PEEK and POKE" there:



10 OPEN #4,NET1_MEM_131072


Would open #4 to the screen memory of the QL with network station address 1. You could then save (or modify) the screen from the other box on a file on your local drives. Not extactly "safe", but nerdy ;)






share|improve this answer



























  • Oops? why deleting it? Anyway, Thanks a lot. great writeup. So sinclair used different PEEKs. Ok. The Memory-Device is cool. But when using with a base address, tehre is no upper likint, right? Allocating 1K on the heap would still allow it to write past that length?

    – Raffzahn
    10 hours ago






  • 1





    Somehow created a duplicate answer. Yes to your question: No airbags, no belts, no braces in that specific driver. You could, however, extend the device name encoding to implement an upper limit, like "MEM_<lower>_<upper>" and range check access - The QL's device name encoding allowed that. But that was not part of that specific implementation.

    – tofro
    10 hours ago














5














5










5









ZX Spectrum Beta Basic



MEMORY$ is a pseudo-variable that considers the whole 64k of memory a string. By slicing it (Sinclair's way of implementing LEFT$, RIGHT$,...) you can pick memory areas into string variables.



10 REM Move memory to a string
20 LET a$=MEMORY$()(16384 TO 22527)
30 REM Move back
40 POKE 16384,a$


Sinclair QL SuperBASIC and Turbo Toolkit Basic extension



Standard QL BASIC nows how to PEEK and POKE scalar integer types to/from memory



10 x$ = PEEK (x) : REMark PEEK a byte
20 POKE x, x$ : REMark POKE it back
30 x% = PEEK_W (x) : REMark PEEK a 16-bit word
40 POKE_W (x, x%) : REMark POKE it back
45 REMark Note Sinclair QL BASIC doesn't have a 32-bit int type
50 x = PEEK_L (y) : REMark PEEK a 32-bit long, convert it to float
60 POKE_L (y, x) : REMark convert float to long, poke it
70 : REMark last two obviously only work on even addresses


Some toolkits (BASIC extensions) did the logical thing and implemented the same for strings (just like you proposed):



10 x$ = PEEK$ (x) : REMark assume x holds a string in standard QL format
20 : REMark (word length, then characters), fill x$ with it
30 POKE$ (x, x$) : REMark POKE it back
40 x$ = PEEK$ (x, len) : REMark Does the same thing, but takes the string length
50 : REMark as an argument, and PEEKs only the characters


You also had the same for floating point variables



10 x = PEEK_F (y) : REMark assumes y holds 6-byte FP in QL native format
20 POKE_F (y, x) : REMark poke it back without first converting to byte


Sinclair QL MEM pseudo-device



Another elegant (in my opinion, even more elegant than the above) approach to do the same thing is to supply a pseudo-device driver that pretends the memory is a random-access device:



10 OPEN #4, MEM
20 GET #4x,x$ : REMark position file pointer (i.e. address) to x, then read string x$
30 PUT #4x,x$ : REMark put it back
40 CLOSE #4 : REMark close the "file"


Note this works with any other type as well, including arrays (and is, thus, way more flexible than the above approach of extending PEEK and POKE). The MEM device driver I am working with has the added feature that you can add an address to the device name like



10 a = ALCHP (1024) : REMark allocate 1k of common heap, put the address into a
20 OPEN #4,"MEM_" & a : REMark device name is now MEM_<address>.
30 : REMark You can now work with relative offsets from a
40 : REMark and not from 0


Because the QL had some rudimentary network and a file server function, you could even open the "MEM" pseudo device on a server, and "PEEK and POKE" there:



10 OPEN #4,NET1_MEM_131072


Would open #4 to the screen memory of the QL with network station address 1. You could then save (or modify) the screen from the other box on a file on your local drives. Not extactly "safe", but nerdy ;)






share|improve this answer















ZX Spectrum Beta Basic



MEMORY$ is a pseudo-variable that considers the whole 64k of memory a string. By slicing it (Sinclair's way of implementing LEFT$, RIGHT$,...) you can pick memory areas into string variables.



10 REM Move memory to a string
20 LET a$=MEMORY$()(16384 TO 22527)
30 REM Move back
40 POKE 16384,a$


Sinclair QL SuperBASIC and Turbo Toolkit Basic extension



Standard QL BASIC nows how to PEEK and POKE scalar integer types to/from memory



10 x$ = PEEK (x) : REMark PEEK a byte
20 POKE x, x$ : REMark POKE it back
30 x% = PEEK_W (x) : REMark PEEK a 16-bit word
40 POKE_W (x, x%) : REMark POKE it back
45 REMark Note Sinclair QL BASIC doesn't have a 32-bit int type
50 x = PEEK_L (y) : REMark PEEK a 32-bit long, convert it to float
60 POKE_L (y, x) : REMark convert float to long, poke it
70 : REMark last two obviously only work on even addresses


Some toolkits (BASIC extensions) did the logical thing and implemented the same for strings (just like you proposed):



10 x$ = PEEK$ (x) : REMark assume x holds a string in standard QL format
20 : REMark (word length, then characters), fill x$ with it
30 POKE$ (x, x$) : REMark POKE it back
40 x$ = PEEK$ (x, len) : REMark Does the same thing, but takes the string length
50 : REMark as an argument, and PEEKs only the characters


You also had the same for floating point variables



10 x = PEEK_F (y) : REMark assumes y holds 6-byte FP in QL native format
20 POKE_F (y, x) : REMark poke it back without first converting to byte


Sinclair QL MEM pseudo-device



Another elegant (in my opinion, even more elegant than the above) approach to do the same thing is to supply a pseudo-device driver that pretends the memory is a random-access device:



10 OPEN #4, MEM
20 GET #4x,x$ : REMark position file pointer (i.e. address) to x, then read string x$
30 PUT #4x,x$ : REMark put it back
40 CLOSE #4 : REMark close the "file"


Note this works with any other type as well, including arrays (and is, thus, way more flexible than the above approach of extending PEEK and POKE). The MEM device driver I am working with has the added feature that you can add an address to the device name like



10 a = ALCHP (1024) : REMark allocate 1k of common heap, put the address into a
20 OPEN #4,"MEM_" & a : REMark device name is now MEM_<address>.
30 : REMark You can now work with relative offsets from a
40 : REMark and not from 0


Because the QL had some rudimentary network and a file server function, you could even open the "MEM" pseudo device on a server, and "PEEK and POKE" there:



10 OPEN #4,NET1_MEM_131072


Would open #4 to the screen memory of the QL with network station address 1. You could then save (or modify) the screen from the other box on a file on your local drives. Not extactly "safe", but nerdy ;)







share|improve this answer














share|improve this answer



share|improve this answer








edited 9 hours ago

























answered 11 hours ago









tofrotofro

18k3 gold badges38 silver badges101 bronze badges




18k3 gold badges38 silver badges101 bronze badges















  • Oops? why deleting it? Anyway, Thanks a lot. great writeup. So sinclair used different PEEKs. Ok. The Memory-Device is cool. But when using with a base address, tehre is no upper likint, right? Allocating 1K on the heap would still allow it to write past that length?

    – Raffzahn
    10 hours ago






  • 1





    Somehow created a duplicate answer. Yes to your question: No airbags, no belts, no braces in that specific driver. You could, however, extend the device name encoding to implement an upper limit, like "MEM_<lower>_<upper>" and range check access - The QL's device name encoding allowed that. But that was not part of that specific implementation.

    – tofro
    10 hours ago


















  • Oops? why deleting it? Anyway, Thanks a lot. great writeup. So sinclair used different PEEKs. Ok. The Memory-Device is cool. But when using with a base address, tehre is no upper likint, right? Allocating 1K on the heap would still allow it to write past that length?

    – Raffzahn
    10 hours ago






  • 1





    Somehow created a duplicate answer. Yes to your question: No airbags, no belts, no braces in that specific driver. You could, however, extend the device name encoding to implement an upper limit, like "MEM_<lower>_<upper>" and range check access - The QL's device name encoding allowed that. But that was not part of that specific implementation.

    – tofro
    10 hours ago

















Oops? why deleting it? Anyway, Thanks a lot. great writeup. So sinclair used different PEEKs. Ok. The Memory-Device is cool. But when using with a base address, tehre is no upper likint, right? Allocating 1K on the heap would still allow it to write past that length?

– Raffzahn
10 hours ago





Oops? why deleting it? Anyway, Thanks a lot. great writeup. So sinclair used different PEEKs. Ok. The Memory-Device is cool. But when using with a base address, tehre is no upper likint, right? Allocating 1K on the heap would still allow it to write past that length?

– Raffzahn
10 hours ago




1




1





Somehow created a duplicate answer. Yes to your question: No airbags, no belts, no braces in that specific driver. You could, however, extend the device name encoding to implement an upper limit, like "MEM_<lower>_<upper>" and range check access - The QL's device name encoding allowed that. But that was not part of that specific implementation.

– tofro
10 hours ago






Somehow created a duplicate answer. Yes to your question: No airbags, no belts, no braces in that specific driver. You could, however, extend the device name encoding to implement an upper limit, like "MEM_<lower>_<upper>" and range check access - The QL's device name encoding allowed that. But that was not part of that specific implementation.

– tofro
10 hours ago












0















POKE and PEEK were used a lot in the Commodore 64 BASIC V2, as it was completely lacking in high-level commands to manipulate the screen, sprites, IO and so on.



For example:



POKE 53281, 0


would set the screen background to black.



Conversely



C = PEEK(53281)


would return an integer corresponding to the screen background colour and place it in variable 'C'.






share|improve this answer

























  • How is this related to the question?

    – Felix Palmen
    8 hours ago






  • 1





    I probably misunderstood the question title now that I read it again.

    – Alan B
    8 hours ago















0















POKE and PEEK were used a lot in the Commodore 64 BASIC V2, as it was completely lacking in high-level commands to manipulate the screen, sprites, IO and so on.



For example:



POKE 53281, 0


would set the screen background to black.



Conversely



C = PEEK(53281)


would return an integer corresponding to the screen background colour and place it in variable 'C'.






share|improve this answer

























  • How is this related to the question?

    – Felix Palmen
    8 hours ago






  • 1





    I probably misunderstood the question title now that I read it again.

    – Alan B
    8 hours ago













0














0










0









POKE and PEEK were used a lot in the Commodore 64 BASIC V2, as it was completely lacking in high-level commands to manipulate the screen, sprites, IO and so on.



For example:



POKE 53281, 0


would set the screen background to black.



Conversely



C = PEEK(53281)


would return an integer corresponding to the screen background colour and place it in variable 'C'.






share|improve this answer













POKE and PEEK were used a lot in the Commodore 64 BASIC V2, as it was completely lacking in high-level commands to manipulate the screen, sprites, IO and so on.



For example:



POKE 53281, 0


would set the screen background to black.



Conversely



C = PEEK(53281)


would return an integer corresponding to the screen background colour and place it in variable 'C'.







share|improve this answer












share|improve this answer



share|improve this answer










answered 8 hours ago









Alan BAlan B

6953 silver badges9 bronze badges




6953 silver badges9 bronze badges















  • How is this related to the question?

    – Felix Palmen
    8 hours ago






  • 1





    I probably misunderstood the question title now that I read it again.

    – Alan B
    8 hours ago

















  • How is this related to the question?

    – Felix Palmen
    8 hours ago






  • 1





    I probably misunderstood the question title now that I read it again.

    – Alan B
    8 hours ago
















How is this related to the question?

– Felix Palmen
8 hours ago





How is this related to the question?

– Felix Palmen
8 hours ago




1




1





I probably misunderstood the question title now that I read it again.

– Alan B
8 hours ago





I probably misunderstood the question title now that I read it again.

– Alan B
8 hours ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Retrocomputing Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f12168%2fwhat-ways-are-there-to-peek-memory-sections-in-different-basics%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480