OK, here's my double speed machine code test...
We now have a 100% machine code program running for nearly 22 minutes before exiting. This first program ran OK for the full 22 minutes, but failed to return to BASIC. After pressing the reset button, I loaded Encoder and dissasembled the memory to find that the actual machine code program had survived intact.
For the second run, I just typed "EXEC&H5000" from the command prompt. Same result.
Code: Select all
10 'M/C DOUBLE SPEED TEST #1
20 FORI=&H5000 TO &H5040:READA$:POKEI,VAL("&H"+A$):NEXT
30 CLS:INPUT"START TEST (Y/N)";K$
40 IF K$="Y"THEN EXEC&H5000 ELSE IFK$="N"THEN END ELSE 30
50 CLS:PRINT"TEST COMPLETE":END
60 DATA 1A,50,FE,1,D,30,8D,0,2C,BF,1,D,8E,0,1,BF,1,12,7F,FF,D7,7F,FF,D9,1C,AF,8E,4,0,ED,81,8C,6,0,26,F9,FC,1,12,26,F1,1A,50,7F,FF,D8,7F,FF,D6,FF,1,D,39,B6,FF,2,BE,1,12,30,1,BF,1,12,3B
The dissasembled machine code...
Code: Select all
5000 1A 50 ORCC #$50
(SET I,F)
5002 FE 010D LDU >$010D
5005 30 8D002C LEAX $5035,PCR
5009 BF 010D STX >$010D
500C 8E 0001 LDX #$0001
500F BF 0112 STX >$0112
5012 7F FFD7 CLR >$FFD7
5015 7F FFD9 CLR >$FFD9
5018 1C AF ANDCC#$AF
(CLR I,F)
501A 8E 0400 LDX #$0400
501D ED 81 STD ,X++
501F 8C 0600 CMPX #$0600
5022 26 F9 BNE $501D
5024 FC 0112 LDD >$0112
5027 26 F1 BNE $501A
5029 1A 50 ORCC #$50
(SET I,F)
502B 7F FFD8 CLR >$FFD8
502E 7F FFD6 CLR >$FFD6
5031 FF 010D STU >$010D
5034 39 RTS
5035 B6 FF02 LDA >$FF02
5038 BE 0112 LDX >$0112
503B 30 01 LEAX 1,X
503D BF 0112 STX >$0112
5040 3B RTI
I then made a slight modification to the program so that it does a cold restart of BASIC after running the test. This second program worked five times in a row without problems.
Each time just typing "EXEC&H5000" to restart the test. It finally froze the machine on the sixth attempt.
Code: Select all
10 'M/C DOUBLE SPEED TEST #2
20 FORI=&H5000 TO &H503E:READA$:POKEI,VAL("&H"+A$):NEXT
30 CLS:INPUT"START TEST (Y/N)";K$
40 IF K$="Y" THEN EXEC&H5000 ELSE IF K$="N" THEN END ELSE 30
50 DATA 1A,50,30,8D,0,2D,BF,1,D,8E,0,1,BF,1,12,7F,FF,D7,7F,FF,D9,1C,AF,8E,4,0,ED,81,8C,6,0,26,F9,FC,1,12,26,F1,1A,50,7F,FF,D8,7F,FF,D6,F,71,7E,B3,B4,B6,FF,2,BE,1,12,30,1,BF,1,12,3B
The dissasembled machine code...
Code: Select all
5000 1A 50 ORCC #$50
(SET I,F)
5002 30 8D002D LEAX $5033,PCR
5006 BF 010D STX >$010D
5009 8E 0001 LDX #$0001
500C BF 0112 STX >$0112
500F 7F FFD7 CLR >$FFD7
5012 7F FFD9 CLR >$FFD9
5015 1C AF ANDCC#$AF
(CLR I,F)
5017 8E 0400 LDX #$0400
501A ED 81 STD ,X++
501C 8C 0600 CMPX #$0600
501F 26 F9 BNE $501A
5021 FC 0112 LDD >$0112
5024 26 F1 BNE $5017
5026 1A 50 ORCC #$50
(SET I,F)
5028 7F FFD8 CLR >$FFD8
502B 7F FFD6 CLR >$FFD6
502E 0F 71 CLR <$71
5030 7E B3B4 JMP >$B3B4
5033 B6 FF02 LDA >$FF02
5036 BE 0112 LDX >$0112
5039 30 01 LEAX 1,X
503B BF 0112 STX >$0112
503E 3B RTI