Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.waterman From: akcs.waterman@hpcvbbs.UUCP (Jason Todd Waterman) Newsgroups: comp.sys.handhelds Subject: Re: ** NEED CRC FOR USE IN ASC-> help. Keywords: crc Message-ID: <27a3dad3:1536.4comp.sys.handhelds;1@hpcvbbs.UUCP> Date: 28 Jan 91 08:40:17 GMT References: <277f5c07:1536comp.sys.handhelds@hpcvbbs.UUCP> <27834f15:1536.3comp Lines: 47 For those who don't have access to a C compiler or don't want to go to their computer every time they want to use ASC->, I have converted Li Sheng's C program to a 48SX program. To use it just upload it to your 48SX in ASCII mode with translate code 3, then place the string on level 1 and execute CRC. Arguments Results 2: 2: "your string" 1: "your string" 1: Checksum: #xxxxh Note: You must be in Hex mode to display the proper checksum. Once you obtain the checksum, just append it to the end of your string in reverse order and execute ASC->. Program Listing: ----------------Cut Here---------------- %%HP: T(3)A(D)F(.); \<< DUP SIZE 1 SWAP # 0h 'CRCN' STO FOR c DUP c c SUB NUM \-> n \<< IF 'n<58' THEN n 48 - ELSE n 55 - END \>> DUP \-> x \<< IF 'x<0' 'x> 15' OR THEN DROP 'CRCN' PURGE "CRC Error: Invalid String" DOERR ELSE R\->B 'CRCN' RCL SWAP XOR # Fh AND # 1081h * 'CRCN' RCL # 10h / XOR 'CRCN' STO END \>> NEXT 'CRCN' RCL 'CRCN' PURGE "Checksum" \->TAG \>> ----------------Cut Here----------------