Populate repository from old progress; massive cleanup and fixes
This commit is contained in:
45
src/reset.s
Normal file
45
src/reset.s
Normal file
@@ -0,0 +1,45 @@
|
||||
; CHIBI PC-09 Prototype #1 Boot ROM -- Reset Handler
|
||||
; Copyright (c) 2024-2025 Amber Zeller, Gale Faraday
|
||||
; Licensed under MIT
|
||||
|
||||
INCLUDE "hardware.inc"
|
||||
INCLUDE "serial.inc"
|
||||
INCLUDE "memtest.inc"
|
||||
INCLUDE "version.inc"
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Hardware Initialization Routines
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
SECTION RESET
|
||||
|
||||
EXPORT RESET
|
||||
|
||||
RESET
|
||||
orcc #$50 ; Mask IRQ and FIRQ
|
||||
jsr INITUART ; Initialize serial console
|
||||
|
||||
CLRSTACK
|
||||
; Initialize the system stack
|
||||
lda #$00 ; Initialize 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
|
||||
ldx #VERMSG
|
||||
jsr POUTZSTR
|
||||
|
||||
; Progress to POST
|
||||
POST
|
||||
jsr RAMTEST
|
||||
|
||||
HALT
|
||||
sync ; Halt and wait for interrupts
|
||||
bra HALT
|
Reference in New Issue
Block a user