home *** CD-ROM | disk | FTP | other *** search
- .if .not .def _STRING_
- _STRING_ = 1
-
- ; this is also part of STD.L65
-
- .if .not .def _MACROS_
- .include #macros
- .endif
-
- .macro _STR_DO
- .if %4 & @s1
- jmp *+%1+4
- .byte %$1,0
- DPOKE _string1,*-%1-1
- .else
- @DMOKE %1,_string1,%4
- .endif
- .if %4 & @s2
- jmp *+%2+4
- .byte %$2,0
- DPOKE _string2,*-%2-1
- .else
- @DMOKE %2,_string2,[%4 & @p2] / @p2
- .endif
- jsr %3
- .endm
-
- .macro STRCAT
- @3 .= @p1 + @p2
- .if %0=3
- @3 .= %3
- .endif
- _STR_DO %1,%2,strcat,@3
- .endm
-
- .macro STRCPY
- @3 .= @p1 + @p2
- .if %0=3
- @3 .= %3
- .endif
- _STR_DO %1,%2,strcpy,@3
- .endm
-
- .macro STRCMP
- @3 .= @p1 + @p2
- .if %0=3
- @3 .= %3
- .endif
- _STR_DO %1,%2,strcmp,@3
- .endm
-
-
- .macro _STRN_DO
- .if %5 & @s1
- jmp *+%1+4
- .byte %$1,0
- DPOKE _string1,*-%1-1
- .else
- DMOVE %1,_string1
- .endif
- .if %5 & @s2
- jmp *+%2+4
- .byte %$2,0
- DPOKE _string2,*-%2-1
- .else
- DMOVE %2,_string2
- .endif
- @DMOKE %3,_tmp1,[%5 & @p3] / @p3
- jsr %4
- .endm
-
- .macro STRNCAT
- @3 .= @p1 + @p2 + @p3
- .if %0=4
- @3 .= %4
- .endif
- _STRN_DO %1,%2,%3,strncat,@3
- .endm
-
- .macro STRNCPY
- @3 .= @p1 + @p2 + @p3
- .if %0=4
- @3 .= %4
- .endif
- _STRN_DO %1,%2,%3,strncpy,@3
- .endm
-
- .macro STRNCMP
- @3 .= @p1 + @p2 + @p3
- .if %0=4
- @3 .= %4
- .endif
- _STRN_DO %1,%2,%3,strncpy,@3
- .endm
-
- .macro STRLEN
- @3 .= @p1
- .if %0=2
- @3 .= %4
- .endif
- .if @3 & @s1
- DPOKE _tmp1,%1
- .else
- @DMOKE %1,_string1,@3
- jsr strlen
- .endif
- .endm
-
- .endif
-