Enable disable R800 without bios

Page 2/2
1 |

By gdx

Enlighted (6071)

gdx's picture

02-02-2014, 06:11

Hi,

I maked a new Basic instruction to enable the Z80 or the R800.

; Make instruction : CMD Z80/R800
; To initialize instruction: DEFUSR=&HC000:A=USR(0)
;
CHGCPU		EQU 0180H	; Change CPU (Z80/R800)
HCMD		EQU 0FE0DH	; CMD Hook
		ORG 0COOOH	; Routine Address
;
; Hook for CMD
;
INTCMD:		LD BC,5		;New Hook set
		LD DE,HCMD
		LD HL,HDAT
		LDIR
		RET
;
; new HOOK data (5-byte)
;
HDAT:		JP R800ROM
		NOP
		NOP
;
; Routine executed by CMD
;
R800ROM:	CP 5AH
		JR Z,Z80MODE
		CP 052H
		RET NZ
		INC HL
		LD A,(HL)
		CP 038H
		RET NZ
		INC HL
		LD A,(HL)
		CP 030H
		RET NZ
		INC HL
		LD A,(HL)
		CP 030H
		RET NZ
		LD A,081H
		CALL CHGCPU
		JP RETBASIC
Z80MODE:	INC HL
		LD A,(HL)
		CP 038H
		RET NZ
		INC HL
		LD A,(HL)
		CP 030H
		RET NZ
		LD A,080H
		CALL CHGCPU
RETBASIC:	POP AF		; To not get a error
		CALL 0010H	; Pointer to line end
		RET

Assemble this program in binary format and initialize the new instruction by BLOAD"name.bin",R

The instruction are CMD R800 or CMD Z80.

Page 2/2
1 |