×   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 PTRA

Submitted by Steve Fewell

Routine: NextCharPTRA
Name: Next non-space Char PTRA
Starting Address: &8F9D
Exit:  Move past spaces in BASICs 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 &8D94 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 &8D9C 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 &8DA2 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

8F9D

 

164 010

A4 0A

LDY &0A

8F9F

 

230 010

E6 0A

INC &0A

8FA1

 

177 011

B1 0B

"LDA (&0B),Y"

8FA3

 

201 032

C9 20

CMP#&20

8FA5

 

240 246

F0 F6

BEQ -10 --> &8F9D

8FA7

`

96

60

RTS


Get Next non-space Char PTRA and compare with 'X' or 'x'

8D94

 

032 157 143

20 9D 8F

JSR &8F9D

8D97

)

041 223

29 DF

AND#&DF

8D99

X

201 088

C9 58

CMP#&58

8D9B

`

96

60

RTS


Get Next non-space Char PTRA and compare with '#'

8D9C

 

032 157 143

20 9D 8F

JSR &8F9D

8D9F

#

201 035

C9 23

CMP#&23

8DA1

`

96

60

RTS


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

8DA2

 

032 157 143

20 9D 8F

JSR &8F9D

8DA5

","

201 044

C9 2C

CMP#&2C

8DA7

`

96

60

RTS

 


 Back to 8BS
Or