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 PTRB

Submitted by Steve Fewell

Routine: NextCharPTRB
Name: Next non-space Char PTRB
Starting Address: &8ED5
Exit:  Move past spaces in BASICs Text Pointer B and return the next Character in the string. Y is the PTR B offset of the character

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


Routine &8EEB returns the next non-space character in PTRB, 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 PTRB routine

8ED5   164 027 A4 1B LDY &1B
8ED7   230 027 E6 1B INC &1B
8ED9   177 025 B1 19 LDA (&19),Y
8EDB   201 032 C9 20 CMP#&20
8EDD   240 246 F0 F6 BEQ -10 --> &8ED5
8EDF ` 096 60 RTS

Get Next non-space Char PTRB and compare with ','
8EEB   032 213 142 20 D5 8E JSR &8ED5
8EEE , 201 044 C9 2C CMP#&2C
8EF0 ` 096 60 RTS

 


 Back to 8BS
Or