28Ø PRINT "VALUE: " ; VALUE / 1Ø 29Ø END
Example B:
1Ø CHAR = Ø
2Ø IDNAME = 1
3Ø INSTRUCTION = &H80 4Ø VALUE = 80
5Ø VALUE$ = HEX$ (VALUE/100)
55WHILE LEN (VALUE$)<4: VALUE$ ="Ø"+VALUE$: WEND 6Ø IF LEN (VALUE$) > 4 THEN VALUE$ =RIGHT$ (VALUE$,4)
65DATA1 = VAL ("&H" + LEFT$ (VALUE$, 2)) 7Ø DATA2 = VAL ("&H" +RIGHT$ (VALUE$, 2))
75DATA3 = Ø 8Ø DATA4 = Ø
9Ø CHKSUM = (DATA1 + DATA2 + DATA3 + DATA4) AND &H7F
1ØØ REM MEMORY RELEASE PREVIOUS 4.xx1 (Example 4.ØØØ, 4.2ØØ) MUST USE 11Ø REM NEXT LINE INSTEAD LINE 9Ø OR PROGRAM DOES'NT WORK
12Ø REM CHKSUM =(DATA1 + DATA2 + DATA3 + DATA4) AND &HFF 13Ø OPEN "COM1: 96ØØ,N,8,1,CD,CS,DS,RS" FOR RANDOM AS #1 14Ø PRINT #1, CHR$ (IDNAME) ; : REM TRANSMIT IDNAME TO OSP
15Ø WHILE LOC (1) = Ø: WEND: REM WAIT RECEIVING IDNAME FROM OSP
16Ø IDNAME = ASC (INPUT$ (1 , 1)): REM READ RECEIVED IDNAME FROM OSP 17Ø PRINT #1, CHR$ (INSTRUCTION) ;
18Ø WHILE LOC (1) = Ø : WEND
19Ø INSTRUCTION = ASC (INPUT$ (1 , 1)) 2ØØ PRINT #1, CHR$ (DATA1) ;
21Ø WHILE LOC (1) = Ø : WEND 22Ø CHAR = ASC (INPUT$ (1 , 1)) 23Ø PRINT #1, CHR$ (DATA2) ; 24Ø WHILE LOC (1) = Ø : WEND 25Ø CHAR = ASC (INPUT$ (1 , 1)) 26Ø PRINT #1, CHR$ (DATA3) ; 27Ø WHILE LOC (1) = Ø : WEND 28Ø CHAR = ASC (INPUT$ (1 , 1)) 29Ø PRINT #1, CHR$ (DATA4) ; 3ØØ WHILE LOC (1) = Ø : WEND 31Ø CHAR = ASC (INPUT$ (1 , 1)) 32Ø PRINT #1, CHR$ (CHKSUM) ; 33Ø WHILE LOC (1) = Ø : WEND 34Ø CHAR = ASC (INPUT$ (1 , 1)) 35Ø PRINT "Transmitted."
39Ø END
51