Professional Documents
Culture Documents
not_bin_extension:
pop si ; We pushed during the .BIN extension check
mov bx, si
mov ax, si
call os_string_length
mov si, bx
add si, ax ; SI now points to end of filename...
dec si
dec si
dec si ; ...and now to start of extension!
mov di, bas_ext
mov cx, 3
rep cmpsb ; Are final 3 chars 'BAS'?
jne not_bas_extension ; If not, error out
pop si
mov ax, si
mov cx, 32768 ; Where to load the program file
call os_load_file ; Load filename pointed to by AX
call os_clear_screen
jmp app_selector ; and go back to the program list
not_bas_extension:
pop si
kern_file_name db 'KERNEL.BIN', 0
autorun_bin_file_name db 'AUTORUN.BIN', 0
autorun_bas_file_name db 'AUTORUN.BAS', 0
bin_ext db 'BIN'
bas_ext db 'BAS'
; ------------------------------------------------------------------
; SYSTEM VARIABLES -- Settings for programs and system calls
; ------------------------------------------------------------------
; FEATURES -- Code to pull into the kernel
%INCLUDE "features/cli.asm"
%INCLUDE "features/basic.asm"
%INCLUDE "features/disk.asm"
%INCLUDE "features/keyboard.asm"
%INCLUDE "features/math.asm"
%INCLUDE "features/misc.asm"
%INCLUDE "features/ports.asm"
%INCLUDE "features/screen.asm"
%INCLUDE "features/sound.asm"
%INCLUDE "features/string.asm"
; ==================================================================
; END OF KERNEL
; ==================================================================