8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


Page Last Altered:

AAC9 =PTR

Submitted by Steve Fewell

Description:

Store #&00 on the stack. This is the OSARGS (&FFDA) option to retrieve the file's PTR value.
Call routine &BA4A to check that the next character at the BASIC Text Pointer B location (&0B-&0C) is a '#'-character.
If not then issue 'Missing #' error message. Evaluate the expression after the '#' [Type mismatch error if string value
found], and set Y to the number found after the '#' character (this is the file channel number).

Call OSARGS (with X [the parameter block] set to the IWA (#&2A) - this is the 4-byte parameter block that the file's PTR
value will be returned to.
After the call to OSARGS (&FFDA), the IWA will contain the PTR value for the file that is opened on channel Y.

Call &AA90 to exit with A = #&40 (as the result value is an Integer).


Disassembly for the =PTR routine

AAC9   169 000 A9 00 LDA#&00
AACB H 072 48 PHA
AACC J 032 074 186 20 4A BA JSR &BA4A Check for '#' (PTR B), Set Y to file channel number (PTR B)
AACF * 162 042 A2 2A LDX#&2A
AAD1 h 104 68 PLA
AAD2   032 218 255 20 DA FF JSR &FFDA   OSARGS
AAD5   128 185 80 B9 BRA -71 --> &AA90 Exit with A=&40

 


 Back to 8BS
Or