8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


Page Last Altered:

Next non-space Char PTRA

Submitted by Steve Fewell

Routine: NextCharPTRA
Name: Next non-space Char PTRA
Starting Address: &8ED5
Exit:  Move past spaces in BASIC's Text Pointer A and return the next Character in the string (A).

Description:
Reads past any space characters found at the current position in the PTRA. Returns with the next non-space Character from PTRA in A, and with the PTRA Offset pointing to this value.


Routine &8CD7 returns the next non-space character in PTRA, and also sets
the zero flag is the character is 'X' or 'x', or clears the zero flag is the
character is not 'X' or 'x'. Bit 5 of the ASCII value is cleared to return any
lower case ASCII characters as upper case.

Routine &8CDF returns the next non-space character in PTRA, and also sets
the zero flag is the character is a hash ('#'), or clears the zero flag is the
character is not a hash.

Routine &8CE5 returns the next non-space character in PTRA, and also sets
the zero flag is the character is a comma (','), or clears the zero flag is the
character is not a comma.

Disassembly for the Next non-space Char PTRA routine

8EE0   164 010 A4 0A LDY &0A
8EE2   230 010 E6 0A INC &0A
8EE4   177 011 B1 0B LDA (&0B),Y
8EE6   201 032 C9 20 CMP#&20
8EE8   240 246 F0 F6 BEQ -10 --> &8EE0
8EEA ` 096 60 RTS

Get Next non-space Char PTRA and compare with 'X' or 'x'
8CD7   032 224 142 20 E0 8E JSR &8EE0
8CDA ) 041 223 29 DF AND#&DF
8CDC X 201 088 C9 58 CMP#&58
8CDE ` 096 60 RTS

Get Next non-space Char PTRA and compare with '#'
8CDF   032 224 142 20 E0 8E JSR &8EE0
8CE2 # 201 035 C9 23 CMP#&23
8CE4 ` 096 60 RTS

Get Next non-space Char PTRA and compare with ','
8CE5   032 224 142 20 E0 8E JSR &8EE0
8CE8 , 201 044 C9 2C CMP#&2C
8CEA ` 096 60 RTS

 


 Back to 8BS
Or