Indirection redirection memory1/6/2024 The PDP-8 is a 12-bit architecture from DEC the first commercially successful minicomputer. Optical character recognition and original formatting effort by Mark Usher.This article includes information originating from Wikipedia. The BBC Microcomputer User Guide was written by John Coll and edited by David Allen for the British Broadcasting Corporation. The tools are therefore provided to enable you to manipulate general tree structures and lists very easily in BASIC. If M is the address of the start of the structure then For example you may need a structure containing a 10 character string, a number and a reference to a similar structure. Note that interesting structures can be generated using ! and $. ![]() Use the string indirection operator to insert a string into a known place in memory Use the word indirection operator to change 4 bytes Use the byte indirection operator to change one byte Set up function key 0 and use it to examine memory beyond &2000. Here are some illustrations of some of the above. ~M+X, M?X:NEXT ¦Mīut don't forget that in MODE 7 it will be displayed as It is easy to write this into one of the user defined function keys and keep it for debugging - like this Line 20 reads "Print in hex (M plus X) and in the next column, in hex, the contents of (M plus X)". There is a simple routine to examine the contents of memory for 12 bytes beyond &2000. Thus M?3 means "the contents of (memory location M plus3)" in other words of location &2003. We have used M as the operand in the example above - for exampleīut in addition both query and pling can be used as binary operators providing that the left hand operand is a variable (such as M9) and not a constant. We have seen how query, pling and dollar can be used as unary operators - that is with only one operand. $M="ABCDEF" will place the string ABCDEF and a carriage return (&0D) in memory from location &2000 on.Īnd one last twist to the use of these operators. ![]() On the other hand $M can be used to read or write a string to memory starting at memory location M. Do not confuse $M with M$ as they are quite different. The last operator in this group is the string indirection operator called dollar. ThusĪnd PRINT ~!M (print in hex, pling M) would giveįour bytes are used to store integers so the pling operator can be used to manipulate integer variables. ![]() The word indirection operator (pling) acts on four successive bytes. The query operator acts on one byte of memory only. Those familiar with other dialects of BASIC will realise that ?M means "the contents of" memory location M, so to set the contents of &2000 to 40 we writeĪnd to print the contents of memory location &2000 we write If you don't understand hex then you will not need to use indirection operators). There are three indirection operators:įor the sake of illustration let us play with memory around location &2000 (that is 2000 hex - an appreciation of hex numbers is essential. They are intended for those using the computer's assembler or those wishing to create their own data structures. They enable the user to read and write to memory in a far more flexible way than by using PEEK and POKE. Indirection operators are not normally available on personal computers. BBC Micro User Guide: Indirection OperatorsĬontents / Reference section / Previous chapter / Next chapter / Index 39 Indirection Operators
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |