mirror of https://git.sr.ht/~rabbits/uxn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
514 B
28 lines
514 B
@strcmp ( a* b* -- a-end* b-end* order nonzero if strings differ |
|
OR a-end* b-end* 00 00 if strings match ) |
|
STH2 |
|
,&entry JMP |
|
|
|
&loop ( a* a b / b* ) |
|
SUB ,&nomatch JCNk ( a* a-b nonzero / b* ) |
|
POP2 ( a* / b* ) |
|
INC2 INC2r |
|
&entry ( a* / b* ) |
|
LDAk LDAkr STHr ( a* a b / b* ) |
|
ORAk ,&loop JCN |
|
|
|
&nomatch ( a* a-b flag / b* ) |
|
STH2r SWP2 ( a* b* a-b flag ) |
|
JMP2r |
|
|
|
@strlen ( string-ptr* -- length^ ) |
|
LIT2r 0000 |
|
,&entry JMP |
|
|
|
&loop |
|
INC2 INC2r |
|
&entry |
|
LDAk ,&loop JCN |
|
POP2 STH2r |
|
JMP2r |
|
|
|
|