User Tools

Site Tools


base:kernalbasicinit
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


base:kernalbasicinit [2015-04-17 04:32] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Initialization of Kernal and Basic system variables ======
 +
 +The following code does a software reset.
 +
 +<code>
 +systeminit
 +    SEI
 +    CLD
 +    LDX #$FF
 +    TXS
 +    JSR $FF84    ; IOINIT - Initialize I/O
 +
 +    ; Initialize SID registers (not done by Kernal reset routine):
 +
 +    LDX #$17
 +    LDA #$00
 +lp1 STA $D400,X
 +    DEX
 +    BPL lp1
 +
 +    ; RAMTAS (JSR $FF87) - Initialize System Constants
 +
 +    ; $FF87 is not actually called because it would do
 +    ; a RAM-test which lasts a few seconds.
 +    ; The following code does the same as RAMTAS but
 +    ; without the RAM-test:
 +
 +    LDA #$00
 +    TAY
 +lp2 STA $0002,Y
 +    STA $0200,Y
 +    STA $0300,Y
 +    INY
 +    BNE lp2
 +
 +    LDX #$00
 +    LDY #$A0
 +    JSR $FD8C
 +
 +    JSR $FF8A    ; RESTOR - Restore Kernal Vectors
 +    JSR $FF81    ; CINT - Initialize screen editor
 +    CLI
 +
 +    ; Basic initializations (optional):
 +
 +    JSR $E453    ; Initialize Vectors
 +    JSR $E3BF    ; Initialize BASIC RAM
 +    JSR $E422    ; Output Power-Up Message
 +    LDX #$FB
 +    TXS
 +</code>
  
base/kernalbasicinit.txt · Last modified: 2015-04-17 04:32 by 127.0.0.1