diff --git a/bin/s.com b/bin/s.com new file mode 100644 index 0000000..c1c8170 Binary files /dev/null and b/bin/s.com differ diff --git a/src/MONITOR.z80 b/src/MONITOR.z80 index 71b808b..ec083b8 100644 --- a/src/MONITOR.z80 +++ b/src/MONITOR.z80 @@ -6,12 +6,12 @@ ;Assumes memory configuration is all-RAM ; ;The subroutines use these variables in RAM, same area as ROM monitor: -current_location: equ 0x7100 ;word variable in RAM -line_count: equ 0x7102 ;byte variable in RAM -byte_count: equ 0x7103 ;byte variable in RAM -value_pointer: equ 0x7104 ;word variable in RAM -current_value: equ 0x7106 ;word variable in RAM -buffer: equ 0x7108 ;buffer in RAM -- up to stack area +current_location: equ 0xE100 ;word variable in RAM +line_count: equ 0xE102 ;byte variable in RAM +byte_count: equ 0xE103 ;byte variable in RAM +value_pointer: equ 0xE104 ;word variable in RAM +current_value: equ 0xE106 ;word variable in RAM +buffer: equ 0xE108 ;buffer in RAM -- up to stack area ;Will use stack of calling program (CP/M) which is re-initialized at re-boot. ; ; @@ -21,12 +21,12 @@ buffer: equ 0x7108 ;buffer in RAM -- up to stack area #code BOOT, 0x0100 ld hl,code_origin ;start of code to transfer ld bc,code_end-code_start+1 ;length of code to transfer - ld de,07200h ;target of transfer + ld de,0E200h ;target of transfer ldir ;Z80 transfer instruction - jp 07200h + jp 0E200h code_origin: ;address of first byte of code before transfer ; -#code MAIN, 0x7200 +#code MAIN, 0xE200 code_start: jp monitor_start ; ;Puts a single char (byte value) on serial output @@ -54,10 +54,10 @@ write_string: in a,(3) ;read status ; ;Binary loader. Receive a binary file, place in memory. ;Address of load passed in HL, length of load (= file length) in BC -bload: in a,(3) ;get status - and 002h ;check RxRDY bit +bload: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,bload ;not ready, loop - in a,(2) + in a,(0x1E) ld (hl),a inc hl dec bc ;byte counter @@ -91,10 +91,10 @@ get_line: ld c,000h ;line position ld d,a ;after this don't need to preserve hl ld a,l ;subroutines called don't use de ld e,a -get_line_next_char: in a,(3) ;get status - and 002h ;check RxRDY bit +get_line_next_char: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,get_line_next_char ;not ready, loop - in a,(2) ;get char + in a,(0x1E) ;get char cp 00dh ;check if return ret z ;yes, normal exit cp 07fh ;check if backspace (VT102 keys) @@ -378,10 +378,10 @@ load_done: call write_newline ; ;Get one ASCII character from the serial port. ;Returns with char in A reg. No error checking. -get_char: in a,(3) ;get status - and 002h ;check RxRDY bit +get_char: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,get_char ;not ready, loop - in a,(2) ;get char + in a,(0x1E) ;get char ret ; ;Subroutine to start a new line diff --git a/src/bios.z80 b/src/bios.z80 index 2fd7139..47c7f63 100644 --- a/src/bios.z80 +++ b/src/bios.z80 @@ -1,8 +1,8 @@ ; skeletal cbios for first level of CP/M 2.0 alteration ; -ccp: equ 6400h ;base of ccp -bdos: equ 6C06h ;bdos entry -bios: equ 7A00h ;base of bios +ccp: equ 0E400h ;base of ccp +bdos: equ 0EC06h ;bdos entry +bios: equ 0FA00h ;base of bios cdisk: equ 0004h ;address of current disk number 0=a,... l5=p iobyte: equ 0003h ;intel i/o byte disks: equ 04h ;number of disks in the system @@ -180,8 +180,8 @@ diskok: LD c, a ;send to the ccp ; to insert your own code ; const: ;console status, return 0ffh if character ready, 00h if not - in a,(3) ;get status - and 002h ;check RxRDY bit + in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,no_char ld a,0ffh ;char ready ret @@ -189,10 +189,10 @@ no_char:ld a,00h ;no char ret ; conin: ;console character into register a - in a,(3) ;get status - and 002h ;check RxRDY bit + in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,conin ;loop until char ready - in a,(2) ;get char + in a,(0x1E) ;get char AND 7fh ;strip parity bit ret ; diff --git a/src/cpm22.z80 b/src/cpm22.z80 index 90436f0..43d444d 100644 --- a/src/cpm22.z80 +++ b/src/cpm22.z80 @@ -11,7 +11,7 @@ ; Set memory limit here. This is the amount of contigeous ; ram starting from 0000. CP/M will reside at the end of this space. ; -MEM EQU 32 ;for a 62k system (TS802 TEST - WORKS OK). +MEM EQU 64 ;for a 62k system (TS802 TEST - WORKS OK). ; IOBYTE EQU 3 ;i/o definition byte. TDRIVE EQU 4 ;current drive name and user number. diff --git a/src/loader.z80 b/src/loader.z80 index 8045c32..acbb2ed 100644 --- a/src/loader.z80 +++ b/src/loader.z80 @@ -8,13 +8,13 @@ hstbuf equ 0x1200 ;will put 256-byte raw sector here disk_read equ 0x0296 ;subroutine in 2K ROM -cpm equ 0x7A00 ;CP/M cold start entry in BIOS +cpm equ 0xFA00 ;CP/M cold start entry in BIOS main: ld c,1 ;LBA bits 0 to 7 ld b,0 ;LBA bits 8 to 15 ld e,0 ;LBA bits 16 to 23 - ld hl,0x6400 ; Memory address -- start of CCP + ld hl,0xE400 ; Memory address -- start of CCP loop: call disk_read ;subroutine in ROM diff --git a/src/putsys.z80 b/src/putsys.z80 index 786b4d1..de68318 100644 --- a/src/putsys.z80 +++ b/src/putsys.z80 @@ -6,7 +6,7 @@ #target bin #code _HOME, 0x1400 -_bios equ 0x7A00 +_bios equ (0x4A00+0xB000) seldsk equ _bios+0x1b settrk equ _bios+0x1e setsec equ _bios+0x21 diff --git a/src/ram_monitor.z80 b/src/ram_monitor.z80 index 2add648..c07a671 100644 --- a/src/ram_monitor.z80 +++ b/src/ram_monitor.z80 @@ -43,10 +43,10 @@ write_string: in a,(3) ;read status ; ;Binary loader. Receive a binary file, place in memory. ;Address of load passed in HL, length of load (= file length) in BC -bload: in a,(3) ;get status - and 002h ;check RxRDY bit +bload: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,bload ;not ready, loop - in a,(2) + in a,(0x1E) ld (hl),a inc hl dec bc ;byte counter @@ -80,10 +80,10 @@ get_line: ld c,000h ;line position ld d,a ;after this don't need to preserve hl ld a,l ;subroutines called don't use de ld e,a -get_line_next_char: in a,(3) ;get status - and 002h ;check RxRDY bit +get_line_next_char: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,get_line_next_char ;not ready, loop - in a,(2) ;get char + in a,(0x1E) ;get char cp 00dh ;check if return ret z ;yes, normal exit cp 07fh ;check if backspace (VT102 keys) @@ -367,10 +367,10 @@ load_done: call write_newline ; ;Get one ASCII character from the serial port. ;Returns with char in A reg. No error checking. -get_char: in a,(3) ;get status - and 002h ;check RxRDY bit +get_char: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,get_char ;not ready, loop - in a,(2) ;get char + in a,(0x1E) ;get char ret ; ;Subroutine to start a new line diff --git a/src/rom_monitor.z80 b/src/rom_monitor.z80 index 43aa44a..3f8ac2b 100644 --- a/src/rom_monitor.z80 +++ b/src/rom_monitor.z80 @@ -57,10 +57,10 @@ write_string: in a,(3) ;read status ; ;Binary loader. Receive a binary file, place in memory. ;Address of load passed in HL, length of load (= file length) in BC -bload: in a,(3) ;get status - and 002h ;check RxRDY bit +bload: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,bload ;not ready, loop - in a,(2) + in a,(0x1E) ld (hl),a inc hl dec bc ;byte counter @@ -94,10 +94,10 @@ get_line: ld c,000h ;line position ld d,a ;after this don't need to preserve hl ld a,l ;subroutines called don't use de ld e,a -get_line_next_char: in a,(3) ;get status - and 002h ;check RxRDY bit +get_line_next_char: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,get_line_next_char ;not ready, loop - in a,(2) ;get char + in a,(0x1E) ;get char cp 00dh ;check if return ret z ;yes, normal exit cp 07fh ;check if backspace (VT102 keys) @@ -381,10 +381,10 @@ load_done: call write_newline ; ;Get one ASCII character from the serial port. ;Returns with char in A reg. No error checking. -get_char: in a,(3) ;get status - and 002h ;check RxRDY bit +get_char: in a,(0x1F) ;get status + and 001h ;check RxRDY bit jp z,get_char ;not ready, loop - in a,(2) ;get char + in a,(0x1E) ;get char ret ; ;Subroutine to start a new line