; CHIBI PC-09 Prototype #1 Boot ROM -- Reset Handler ; Copyright (c) 2024-2025 Amber Zeller, Gale Faraday ; Licensed under MIT INCLUDE "buzbee.inc" INCLUDE "hardware.inc" INCLUDE "memtest.inc" INCLUDE "serial.inc" INCLUDE "version.inc" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Hardware Initialization Routines ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SECTION RESET EXPORT RESET RESET orcc #$50 ; Mask IRQ and FIRQ CLRSTACK ; Initialize the system stack clra ; Init A & X to zero out the stack ldx #$0000 NEXT@ sta STACK_BOTTOM,x ; Write a zero and progress to the next byte leax 1,x cmpx #STACK_DEPTH ; See if we're at the top of the stack yet blo NEXT@ ; Loop if we aren't at the end yet lds #STACK_TOP ; Set S to top of newly cleared stack BOOTSCR lda #13 ; 9600 baud ldb #%11 ; 8N1 jsr INITUART ; Initialize serial console ldx #VERMSG ; Print version information jsr POUTZSTR ; Progress to POST POST jsr RAMTEST ; Hand off control to the BUZBEE monitor and print notification of leaving the ; firmware ENTERMON ldx #TXTRUN jsr POUTZSTR jmp BUZBEE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Text/Resources for Reset Handler ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TXTRUN fcn "<3RUN<3"