C.5.1 BASIC PAB modifications Aside from the control information contained within the PAB, as already discussed in section C.3, BASIC adds four more bytes to the top of the PAB for specific BASIC-related control information. Ihe new PAB structure within BASIC is drawn in Figure C.5.1. ' 0,1 : LINK TO NEXT PAB IN CHAIN ! ja La iJ ig i ! ‘CHANNEL NUMBER =! ~—sINTERNAL OFFSET ! bene {ae e ' 24 5 : ! 1/0 OPCODE ! FLAG / STATUS ' ene anne Yee eee ! $ 6,7 : ' DATA BUFFER ADDRESS ! ve ce J 13 ‘og ! SLOGICAL RECORD LENGTH ! CHARACTER COUNT \ Be Ce ee ‘ 110,11 be : RECORD NUMBER i |e eee {aan ! 12 1 13 ! ! SCREEN OFPSET : NAME LENGTH : 14... ; ' FIGURE C.5.1 Modified PAB Layout The additional four bytes contain additional control information BASIC needs for its internal PAB linkage structure. The PAB's within the BASIC control structure form a simple linked list, which means each PAB has a pointer to the next PAB in the system. The last PAK in the list has a zero ("O") link, indicating that it is at the end of the list. Rytes 0 and 1 in the BASIC PABe contain the link mentioned above. Byte 2 contains the actual BASIC channel or file number (1-255); byte 3 contains the offset of the current data pointer within the data block. The offset indicated in byte 3 of the BASIC PAB indicates the position of the current data pointer within the data buffer given in bytes 6 and 7. If byte 3 equals zero, the current data buffer is "blank"; i.e. if in "read" mode, a new butter has to be read in before any further processing, but in "write" mode the entire buffer is still available for data storage. 47