View Single Post
Old 27th Dec 2021, 8:53 pm   #33
coolsnaz2
Triode
 
Join Date: Aug 2020
Location: Wallington, Greater London, UK.
Posts: 22
Default Re: Yet another MK14 tape interface (ESP32).

Updated version that does not use JS or RET, and solves issues I had with offsets. Program now needs to run in RAM but should be relocatable.

Code:
	.CR scmp
	.TF BL7.hex, INT
	;
	; Converted to SBASM by IFM 2021

        .OR 0x0880
COUNT	.BS 1
LEN  	.BS 1
TASK 	.BS 1


START	LDI 0x01

STTASK	ST TASK

GBYTE	LDI 8		;Loop Bits In Byte
	        ST COUNT
LOOP        CSA
	        ANI 0x20
	        JZ LOOP
	        SIO
LOOP2      CSA		
	        ANI 0x20
	        JNZ LOOP2
	        DLD COUNT
	        JNZ LOOP
		
	        LD TASK
TASK1	ANI 0x01	;Task1 is High Byte of load address
	        JZ TASK2
	        LDE
	        XPAH 1
	        LDI 0x02
	        JMP STTASK
		
TASK2	LD TASK		;Task2 is Low Byte of load address
	        ANI 0x02
	        JZ TASK4
	        LDE
	        XPAL 1
	        LDI 0x04
	        JMP STTASK	
		
TASK4	LD TASK		;Task4 is Length of load
	        ANI 0x04
	        JZ TASK8
	        LDE
	        ST LEN
	        LDI 0x08
	        JMP STTASK		

TASK8	LD TASK		;Task8 is load of data
	        ANI 0x08
	        JZ TASK10
	        LDE
	        ST @+1(1)
	        DLD LEN
	        JNZ GBYTE
	        LDI 0x10
	        JMP STTASK		
		
TASK10	LD TASK		;Task10 is High byte of execution address
	        ANI 0x10
	        JZ TASK20
	        LDE
	        XPAH 3
	        LDI 0x20
	        JMP STTASK
		
TASK20	LDE		;Task20 is High byte of execution address
	        XPAL 3
	        XPPC 3
Still able to load Moon Lander in under a second. Also found mistake in the code I posted on the 16th Dec 21, JZ LOOP2 should be JNZ LOOP2.
coolsnaz2 is offline   Reply With Quote