annotate lib/alib/b09strlen.a @ 2639:283433fa565c

Added notes to atari.d
author Boisy Pitre <boisy.pitre@nuance.com>
date Tue, 28 Feb 2012 09:26:09 -0600
parents 7d70b7e1cb21
children aaba193af04f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
1 **********************************
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
3 * BASIC09 String Length: find length of a BASIC09 string
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
4 * which can be terminated by a $ff
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
5 * =or= allocated storage size
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
6
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
7 * ENTRY: X=start of string
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
8 * D=max allocated
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
9
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
10 * EXIT: D=actual length
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
11 * all other regs (except cc) preserved
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
12
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
13 nam Find Basic09 String Length
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
14 ttl Assembler Library Module
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
15
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
16
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
17 psect B09STRLEN,0,0,0,0,0
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
18
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
19 B09STRLEN:
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
20 pshs d,x,y
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
21 tfr d,y max. possible size to Y
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
22
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
23 loop
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
24 lda ,x+ get char from string
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
25 inca this effects a cmpa #$ff
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
26 beq exit reached terminator
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
27 leay -1,y if string max leng, no terminator
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
28 bne loop no yet, check more
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
29
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
30 exit
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
31 puls d get max possible size
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
32 pshs y unused size in memory
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
33 subd ,s++ find actual length
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
34 puls x,y,pc
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
35
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
36 endsect
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
37