A collection of tools, code, schematics, and documentation to do with my Kaypro II ROM hacking

hello_world.asm 1.4KB

    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