boot.z80 728 B

123456789101112131415161718192021222324252627
  1. ; Cold bootstrap for z80 emulator
  2. ;
  3. ; generate the header file with this command:
  4. ; z80asm -o - boot.z80 | xxd -i >src/boot.h
  5. CCP: equ 0E800h
  6. BIOS: equ CCP + 1600h
  7. org 0000h
  8. boot: ld de,greet
  9. in a,(3) ; display greeting
  10. ld a,0
  11. ld b,48 ; read CCP + BDOS + BIOS into memory
  12. ld de,1 ; skip first sector on first track
  13. ld hl,CCP ; start address
  14. in a,(4) ; disk read request
  15. jp BIOS ; jump to bios cold start
  16. greet: db 13,10,'[JeeLabs Retro Z80]',13,10,0
  17. ds 007Fh-$
  18. db 0 ; so generated code is exactly 128 bytes
  19. end