30 The Processor and the Operating System The "base" page is a wrap-around page. It consists of the upper half of the last page in the machine (addresses 1770008 to 1777778) and the lower half of the zero page (addresses 0 to 7778). This is the same as a page which runs from - 512 to + 511, effectively "wrapping around" address O. During execution, the program counter (P) points to the address of the current instruction. The "current" page is those 1 024 words of memory centered upon the current instruction. There- fore, the current page is a continually changing page, extending from (P)- 512 to (P)+ 511.
Data Structures It is common to access BASIC variables from an assembly language routine then retrieve the contents, manipulate them, or alter them. To be effective at it, you should be aware of how BASIC stores a value in each of its data types. values, integers, and strings. Each is stored in its own unique structure. There are four data types in BASIC: full-precision numeric values, short-precision numeric Integers The simplest of the types is the integer. A~ integer consists of a single word. Values between - 32 768 and + 32 767 can be stored in the word. Negative values are stored in two's com- plement form.
An integer looks like- I J S i9nBit 15 14 OBit Value Strings Strings are the next simplest structure. A string is a succession of bytes, one character to a byte. A string may be of variable length. To be able to designate the length, the string is preceded by a word which contains the number of bytes in the string. If a string has an odd number of bytes in it, then the left-over byte in the word containing the last character of the string is wasted. A typical string of length n looks like - '-- byte n-2 I byte n-1 byte n I ~(Iength) byte 1 byte 2 byte 3 byte 4 byte 5 byte 6 --