;
; TEST03.ASM
;
; MALCOLM MACLEOD - 21.03.2017
;
; THIS PROGRAM WAS WRITTEN TO ASSIST WITH DEBUGGING MY SD SYSTEMS SBC-200
; S-100 BOARD.
;
; NOTE THE FIRST TWO LINES (WHICH ARE TAKEN FROM PAGE 2-15 OF THE MANUAL) ARE
; TO RESET THE HARDWARE THAT CAUSED EXECUTION TO OCCUR AT 0xE000.
;
; THIS CODE GOES IN A 2716 EPROM IN ROM0 SOCKET, AT ADDRESS 0xE000.
;
; IT COMPILES UNDER "ZMAC VERSION 19SEP2013" BY GEORGE PHILLIPS USING THE
; COMMAND "ZMAC TEST03.ASM".



	.ORG 0xE000

START:	JP	MAIN_10
MAIN_10:IN	A,(7FH)
MAIN_20:; SETUP USART
	LD	A,4EH
	OUT	(7DH),A
	LD	A,37H
	OUT	(7DH),A
	; SETUP CTC
	LD	A,45H
	OUT	(78H),A
	LD	A,13		; 9600 BAUD
	OUT	(78H),A
	; SETUP TO SEND ALPHABET
	LD	H,41H		; ASCII "A"
	LD	B,0
	LD	C,7CH		; OUTPUT PORT
LOOP:	NOP
	NOP
	DJNZ	LOOP		; LOOP FOR ONE BYTE TIME
	; SEND NEXT CHARACTER	
	OUT	(C),H
	LD	A,H
	SUB	5AH		; ASCII "Z"
STOP:	JR	Z,STOP
	INC	H
	JR	LOOP
		
	.END
