Skool directives

The skool files (sd.skool, bts.skool and the others) contain some directives that are processed during the parsing phase. These ‘skool directives’ are described in the following subsections.

!bts+begin, !bts+end, !sd+begin, !sd+end

These directives are used to define a section of a skool file that should be parsed in Back to Skool mode but ignored in Skool Daze mode (!bts+begin, !bts+end), or vice versa (!sd+begin, !sd+end).

For example (in load.skool):

; !sd+begin
 23809 LD HL,23551   ; {INK 6: PAPER 2
*23812 LD (HL),22    ;
; !sd+end
; !bts+begin
 23809 LD HL,23551   ; {INK 1: PAPER 1
*23812 LD (HL),9     ;
; !bts+end

The result here is that in Skool Daze mode only these lines are processed:

 23809 LD HL,23551   ; {INK 6: PAPER 2
*23812 LD (HL),22    ;

whereas in Back to Skool mode only these lines are processed:

 23809 LD HL,23551   ; {INK 1: PAPER 1
*23812 LD (HL),9     ;


The !defb directive defines bytes to be inserted into the memory snapshot for the skool file being parsed. This is used in sd.skool to define the bytes for the routines that occupy the space for the unused animatory states 104-126 and 232-254, so that those animatory states will not appear blank on the ‘Animatory states’ page.

For example:

c44919 LD DE,46572   ;
 44922 CP 200        ; Reset the carry flag if the animatory state is >= #AS200
                     ; (i.e. if we're dealing with a teacher)
 44924 JP 45429      ;
; !defb=44919:17,236,181,254,200,195,117,177

The !defb directive is required here because the parser (in will only convert the DEFB, DEFW, DEFM and DEFS assembler directives into a sequence of bytes; it does not convert assembly language instructions into the equivalent byte values (it is not a Z80 assembler).


The !refs directive is used in secondary skool files (such as start.skool) to enable JR, JP and CALL instructions to be hyperlinked to entries in the primary disassembly (that is, the one defined in sd.skool or bts.skool).

For example (in start.skool):

; !refs=26880

This defines an empty entry for the routine at 26880 in Skool Daze, so that any JR, JP and CALL instruction with 26880 as the operand can be hyperlinked to the entry for that routine (which is defined in sd.skool). Further down in start.skool we see:

; !refs=20709,21746,21920

which defines empty entries for the routines at 20709, 21746 and 21920 in Back to Skool.

If the desired target of the hyperlink is an entry point within a routine in the primary disassembly (as opposed to the address of the routine itself), both the routine address and entry point address should be given, separated by a colon. For example (in csc-start.skool):

; !refs=61630:61676

This will enable hyperlinks to 61676 in the primary Contact Sam Cruise disassembly, which is an entry point in the routine at 61630.

Table Of Contents

Previous topic

Ref file macros

Next topic

Skool macros