diff lib/alib/parsnstr.a @ 2474:7d70b7e1cb21

Moved net and alib files into here
author boisy
date Tue, 30 Mar 2010 02:44:42 +0000
parents
children aaba193af04f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/alib/parsnstr.a	Tue Mar 30 02:44:42 2010 +0000
@@ -0,0 +1,37 @@
+* Parse sign bit terminated string to convert it to a
+* null terminated string. Note: if X and Y are the same
+* the existing string will be overwritten -- don't do this
+* with psects...
+
+* OTHER MODULES NEEDED: none
+ 
+* ENTRY: X=start of sign bit terminated string
+*        Y=buffer for null terminated string
+
+* EXIT: D=string size (not including null)
+*       All other regs (except cc) preserved
+
+
+ nam Parse sign-bit terminated string
+ ttl Assembler Library Module
+
+
+ psect PARSNSTR,0,0,0,0,0
+
+
+PARSNSTR:
+ pshs x
+ lbsr STRHCPY copy string
+ tfr y,x point to moved string
+ lbsr STRHLEN find length of string
+ pshs d size
+ leax d,x
+ lda ,-x get final byte
+ anda #%01111111 clear sign bit
+ clrb add null terminator
+ std ,x  
+ puls d,x,pc
+
+
+ endsect
+