This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Type: Subroutine Category: Loader
LDA #%00111001 \ Set 6522 System VIA interrupt enable register IER STA VIA+&4E \ (SHEILA &4E) bits 0 and 3-5 (i.e. disable the Timer1, \ CB1, CB2 and CA2 interrupts from the System VIA)
The Executive version support speech via the Watford Electronics Beeb Speech Synthesiser, which attaches to the user port, so unlike the other versions, the loader doesn't disable the 6522 User VIA.
Tap on a block to expand it, and tap it again to revert.
LDA IRQ1V \ Store the current IRQ1V vector in VEC, so VEC(1 0) now STA VEC \ contains the original address of the IRQ1 handler LDA IRQ1V+1 STA VEC+1 LDA #LO(IRQ1) \ Set the IRQ1V vector to IRQ1, so IRQ1 is now the STA IRQ1V \ interrupt handler LDA #HI(IRQ1) STA IRQ1V+1
CLI \ Enable interrupts again
The 6502SP version implements a hook that enables you to add arbitrary code to the start-up process. The code needs to be inserted at location &0B00 in the I/O processor, and it needs to start with the characters "TINA".
This variation is blank in the Master version.
LDA #&FF \ Set the text and graphics colour to cyan STA COL LDA TINA \ If the contents of locations TINA to TINA+3 are "TINA" CMP #'T' \ then keep going, otherwise jump to PUTBACK to point BNE PUTBACK \ WRCHV to USOSWRCH, and then end the program, as from LDA TINA+1 \ now on the handlers pointed to by the vectors will CMP #'I' \ handle everything BNE PUTBACK LDA TINA+2 CMP #'N' BNE PUTBACK LDA TINA+3 CMP #'A' BNE PUTBACK JSR TINA+4 \ TINA to TINA+3 contains the string "TINA", so call the \ subroutine at TINA+4 \ \ This allows us to add a code hook into the start-up \ process by populating the TINW workspace at &0B00 with \ "TINA" followed by the code for a subroutine, and it \ will be called just before the setup code terminates \ on the I/O processor \ Fall through into PUTBACK to point WRCHV to USOSWRCH, \ and then end the program, as from now on the handlers \ pointed to by the vectors will handle everything