Paract Compiler and Interpreter Differ (2023-01-22 17:19 by toml12953 #93481)
When I run the following program to convert an Intel HEX file to a BIN file, the interpreter does it correctly and each byte in the output file is the binary representation of the data in the HEX file. When I compile and run the program with Paract, most of the bytes are OK but some are different. Below are the program and a sample data line
The resulting TEST.BIN file should have the 16 bytes
3E 03 D3 10 3E 11 D3 10 31 00 C0 21 08 F8 E5 CD
which is correct in the interpreter
but when the program is run in the compiler, the file has more bytes and some are incorrect
3E 03 C3 93 10 3E 11 C3 93 10 31 00 C3 80 21 08 C3 B8 C3 A5 C3 8D
Sample data file (test.hex)
INPUT PROMPT "HEX file name (no extension): ":HexName$
WHEN EXCEPTION IN
OPEN #1: NAME HexName$ & ".HEX", ACCESS INPUT
LET FileFound = 1
PRINT "No such HEX file. Try again."
LET FileFound = 0
LOOP UNTIL FileFound = 1
OPEN #2: NAME HexName$ & ".BIN"
LINE INPUT #1, IF MISSING THEN EXIT DO: record$
LET ByteCount = BVAL(record$(2:3),16)
IF ByteCount = 0 THEN EXIT DO
FOR I=1 TO ByteCount
LET OutLn$ = OutLn$ & CHR$(BVAL(record$(9+2*I-1:9+2*i),16))
PRINT #2: OutLn$;
Re: Paract Compiler and Interpreter Differ (2023-01-22 17:59 by SHIRAISHI Kazuo #93482)
I wonder that was caused by the incompatibility between Decimal BASIC English version and BASICAcc in the default character.
Set Option-compatibility-behavior-"Unit of String Manipulation" to Byte
or white in each program unit
OPTION CHARACTER BYTE.
Re: Paract Compiler and Interpreter Differ (2023-01-23 00:52 by toml12953 #93484)
Reply To Message #93482
> I wonder that was caused by the incompatibility between Decimal BASIC English version and BASICAcc in the default character.
> Set Option-compatibility-behavior-"Unit of String Manipulation" to Byte
> or white in each program unit
> OPTION CHARACTER BYTE.
Yes, that was it. When I changed to Byte rather than Character, it worked. Thanks!