home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
- *
- *
- * Global functions for the PDP-8 assembler.
- *
- * by Adrian Bool in cooperation with Graham Cox.
- *
- * copyright © phantasm coding 1992.
- *
- *
- ************************************************************/
-
- #include "Global.h"
-
- #include "Global.proto.h"
-
- void PascalToC(str255 cString , char *pString)
- {
- short stringLength;
- short x;
-
- stringLength = (int) pString[0];
-
- if (stringLength > 255) stringLength = 255;
-
- for (x = 1 ; x <= stringLength ; x++) cString[x-1] = pString[x];
- cString[x] = (char) 0;
- }
-
- void CtoPascal(str255 pString , char *cString)
- {
- short stringLength;
-
- stringLength = lengthOfString(cString);
- if (stringLength > 255) stringLength = 255;
-
- copyString(pString+1,cString);
- pString[0] = (char) stringLength;
- }
-
- void copyString(char *dest , char *source)
- {
- short x;
-
- for(x=0; (dest[x] = source[x]) != '\0' ; x++);
- }
-
- short lengthOfString(char *theString)
- {
- short x;
-
- for(x=0 ; theString[x] != '\0' ; x++);
- return(x);
- }