×   Main Menu ALL The 8BS News Manuals (New menu) Links Worth a Look Tools Disc and Basic Webring Site Map 8BS Guestbook Old Guest Book Me The Barnsley Rovers   
8-Bit Software

The BBC and Master Computer Public Domain Library



Next non-space Char PTRB

Submitted by Steve Fewell

Routine: NextCharPTRB
Name: Next non-space Char PTRB
Starting Address: &8F92
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 &8FA8 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

8F92

 

164 027

A4 1B

LDY &1B

8F94

 

230 027

E6 1B

INC &1B

8F96

 

177 025

B1 19

"LDA (&19),Y"

8F98

 

201 032

C9 20

CMP#&20

8F9A

 

240 246

F0 F6

BEQ -10 --> &8F92

8F9C

`

96

60

RTS


Get Next non-space Char PTRB and compare with ','

8FA8

 

032 146 143

20 92 8F

JSR &8F92

8FAB

","

201 044

C9 2C

CMP#&2C

8FAD

`

96

60

RTS

 


 Back to 8BS
Or