Commit 65e5b082 authored by Stephen D's avatar Stephen D
Browse files

added files

parent bc1b699c
This diff is collapsed.
This diff is collapsed.
# kaypro-rom
A collection of tools, code, schematics, and documentation to do with my Kaypro II ROM hacking
\ No newline at end of file
A collection of tools, code, schematics, and documentation to do with my Kaypro II ROM hacking
This repo contains:
- Various PDFs which I found useful to reverse engineer the Kaypro
- The disassembled, original firmware (With comments added by me - Please note this is not finished)
- My own Z80 assembler source code (Also unfinished)
Enjoy!
\ No newline at end of file
org 0
di ;interrupts are dumb
ld sp, 0xFFFF ;set up stack
;;Copy video write code into memory
ld hl, video_write
ld de, 0xEC00
ld bc, video_write_length
ldir
;; print init string
ld hl, hello_world_str
ld bc, 0x3200
ld (0xEFFE), bc
ld bc, hello_world_str_length
call print_string
;; set video_address
ld hl, 0x3100
ld (video_address), hl
;; Serial read is non-blocking
main:
IN A, (7)
AND 1 ;check if char in buffer
jp Z, main
IN A, (5) ;Read from keyboard
ld (0xC000), A
ld hl, 0xC000
ld bc, (video_address)
ld (0xEFFE), bc
inc bc
ld (video_address), bc ;increment video address
ld bc, 1 ;only writing 1 byte
call print_string
jp main
video_address: equ 0xDC00
print_string:
;; pointer to string in hl
;; string length in bc
;; VRAM address at 0xEFFF
push bc
ld de, 0xF000
ldir
pop bc
jp 0xEC00
hello_world_str:
defm "Hello World! ---Stephen's Kaypro II---"
hello_world_str_end:
hello_world_str_length: equ hello_world_str_end - hello_world_str
;; don't forget this will be copied to upper memory!
video_write:
;; Switch banks
IN A, (0x1c)
SET 7,A
OUT (0x1c), A
;; Step 4: Copy string into video memory
ld hl, 0xF000
ld de, (0xEFFE) ;Character framebuffer address
ldir
;; Swtich banks back
IN A, (0x1C)
RES 7, A
OUT (0x1C), A
ret ;we're done
video_write_end:
video_write_length: equ video_write_end - video_write
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment