Again Wayne I will study your suggestion and get back.
Currently the Serial port is initializing and working fine but the RAM access is not. It looks like the SP is not valid. I can get the serial port to output fine if I inline output to the serial port, but if I CALL a Console output routine with a return it fails.
With the following code:-
ORG 0H
START:
IM 1
DI
LD A,11000000B ;Move IO_CTL REG to C0-FF Location so we can use low S100 ports
OUT0 (IO_CTL_REG),A ;3FH, Move to C0 to FF. Also IOSTP = 0
XOR A ; Disable refresh
OUT0 (RCR),A ; E6H
XOR A
OUT0 (BCR1L),A ;0DEH, DMA Byte Count Reg Ch 1L
OUT0 (BCR1H),A ;0DFH, DMA Byte Count Reg Ch 1H
; set default wait states (super conservative for now)
LD A,0F0H ; +3 mem waits, +3 i/o waits
OUT0 (DCNTL),A ; E3H ;DMA/WAIT Ctl Reg
LD SP,0E000H ;<<<<<<<<<<<
; No interrupts, works at 57600 @ 18.432 MHz
XOR A ; PS=0 (/10), DR = /16, SS = /1
OUT0 (CNTLB0),A ; Set Z80180 style baud rates
LD A,14H ; RTS*=1, EFR=0, 8, N, 1
OUT0 (CNTLA0),A
LD A,6CH ; RE, TE, RTS*=0, EFR=1, 8, N, 1
OUT0 (CNTLA0),A
;Some devices where a delay is required after
;configuring the ASCI and before actually trying to send data.
LD B,0 ;Is necessary for for me!
DJNZ $
DJNZ $
LOOP0:
IN0 A,(STAT0) ;C4H,read status
AND 2
JR Z,LOOP0
LD C,33H
OUT0 (TDR0),C ;C6H ---- output is fine
LD HL,0E100H ;RAM
LD (HL),'X' ;Store in RAM
INC HL
LD (HL),'Y'
INC HL
LD (HL),'Z'
INC HL
LD ( HL),'*'
LD HL,0E100H ;RAM
LOOP1:
IN0 A,(STAT0) ;C4H,read status
AND 2
JR Z,LOOP1
LD C,(HL)
OUT0 (TDR0),C ;C6H (no 'X' output, not sure why)
INC HL
LD C,(HL)
CALL CO ;No 'X' output
INC HL
LD C,(HL)
CALL CO
INC HL
LD C,(HL)
CALL CO
HALT
CO: in0 a,(STAT0)
and 02H
jr z,CO
out0 (TDR0),C
LD B,0 ;Delay
DJNZ $
RET
I get continuous 3's.
I need to determine the initial code to change the RAM hardware setup I think from:-
ROM 0-7FFFH
RAM 8000-FFFFH
to
ROM F000-FFFFH
RAM 0-EFFFFH
and relocate the ROM code to F000H-FFFFH.
and adjust the 1MB address space banks to reflect this minimum configuration (can use the rest of the RAM later).
The
reason for all this is a monitor with that configuration would allow
our current "MASTER.Z80" monitor to interface easily with all our current
boards in a Z180 driven S100 bus system (over 50 of them).
A few things, the MASTER monitor only takes up 2K of the ROM, that's why I want it in the top 2k of 64K to run CPM etc. The rest of the current ROM is empty. Thus 2k -> E000H.
I need to relocate that code to valid RAM at E000H and jump to it. Then I need to bank out the RAM at 0-7FFFH and have RAM 0-EFFFH.
That is the configuration that we have be using for over 10 years and allows must of our S100 bus software/hardware to work unchanged.
I really need help configuring the Z180 to this format. Hopefully that would solve the above code problem.
John