7 >Sloader2 BudgieSoft screen loader (all versions)  Version 0.21  (# by Richard Murray Winter 1997 2 <: Downloaded from: http://www.heyrick.co.uk/assembler/ F P: Z $+" at "+(/10) : d: n assemble x5("Save .Loader "+~(code%)+" "+~(O%)) '("SetType .Loader &FFC")  : assemble  code% &1000  pass% = 4 6 2 P%=0  O%=code%  [ OPT pass%   MOV R10, R14  MOV R0, #&4C  SWI "XOS_Find"  BVS exit  MOV R5, R0  " ; Skip header , MOV R8, #0 6 .skip_header @ MOV R1, R5 J BL read_byte T ADD R8, R8, #1 ^ CMP R8, #23 h BLT skip_header r | MOV R1, R5  BL read_byte  4 CMP R0, #10 ; Newline - version 0.  BEQ version_zero  0 CMP R0, #49 ; '1' - version 1.  BEQ version_one  0 CMP R0, #50 ; '2' - version 2.  BEQ version_two  # ADR R0, unknown_string ! SWI "OS_PrettyPrint"  SWI "OS_NewLine"  SWI "OS_NewLine"  B exit & 0 .unknown_string :: EQUS "Unable to load this screen - the format" D. EQUS " has not been recognised..." N EQUB 0 X ALIGN b l v& ; *** VERSION ZERO HANDLER ***   .version_zero  B load_old_format   $ ; *** VERSION E HANDLER ***   .version_one  MOV R1, R5  BL read_byte  BL read_byte   B load_old_format    ! ; *** VERSION TWO HANDLER   * .version_two 4 MOV R1, R5 > BL read_byte H BL read_byte R \ B load_new_format f p z  ; *** ǘ MAT ǕER ***   .load_old_format # BL switch_screen_mode  BL get_screen_info  BL load_palette   .old_loop  MOV R1, R5  BL read_byte  MOV R4, R0  BL read_byte  .old_loop2  SUB R0, R0, #1  STRB R4, [R2, #1]!  CMP R0, #0 $ BGT old_loop2 . CMP R2, R3 8 BLT old_loop B L B exit V ` j t ; *** Ǘ MAT ǕER *** ~  .load_new_format # BL switch_screen_mode  BL get_screen_info  BL load_palette   .new_loop  MOV R1, R5  BL read_byte  CMP R0, #255  BLEQ read_loop  STRB R0, [R2, #1]!  CMP R2, R3  BLT new_loop    B exit  ( 2 < ; *** RESOURCES *** F P .switch_screen_mode Z MOV R12, R14 d MOV R0, #&87 n SWI "XOS_Byte" x MOV R1, R5  BL read_byte  CMP R0, R2  SWINE &100 + 22  SWINE "OS_WriteC"   MOV PC, R12   .get_screen_info  ADR R0, vdu_block  ADD R1, R0, #12 & SWI "OS_ReadVduVariables"  LDR R2, [R1]  LDR R3, [R1, #4]  ADD R3, R3, R2  SUB R2, R2, #1  " MOV PC, R14 , 6 .load_palette @ MOV R12, R14 J MOV R4, #0 T ADR R7, os_block ^ .col_loop h MOV R1, R5 r STRB R4, [R7, #0] | MOV R0, #17  STRB R0, [R7, #1]  BL read_byte  STRB R0, [R7, #2]  BL read_byte  STRB R0, [R7, #3]  BL read_byte  STRB R0, [R7, #4]  MOV R0, #&0C  MOV R1, R7  SWI "OS_Word"  MOV R1, R5  MOV R0, #18  STRB R0, [R7, #1]  BL read_byte  STRB R0, [R7, #2]  BL read_byte & STRB R0, [R7, #3] 0 BL read_byte : STRB R0, [R7, #4] D MOV R0, #&0C N MOV R1, R7 X SWI "OS_Word" b ADD R4, R4, #1 l CMP R4, #16 v BLT col_loop  MOV R0, #0   MOV PC, R12   .exit  MOV R2, R0  MOV R1, R5  MOV R0, #0  SWI "XOS_Find"  MOV PC, R10   .read_byte  SWI "XOS_BGet"  MOVVC PC, R14   A .read_loop ; Read and deal with loop data.   MOV R1, R5 */ BL read_byte ; Read colour 4 MOV R4, R0 >/ BL read_byte ; Read length H .loop2 R SUB R0, R0, #1 \ STRB R4, [R2, #1]! f1 CMP R0, #0 ; More to loop? p BGT loop2 z2 CMP R2, R3 ; End of screen?  BLT new_loop  B exit   .vdu_block  EQUD 149  EQUD 7  EQUD -1  EQUD 0  EQUD 0   .os_block  EQUD 0  EQUB 0  ALIGN  ]  $ .