;CHange SHell to LINuX
;Michael Vincent

.nolist
#include "tse.inc"
.list

.org    userMem-2
.db     $BB,$6D

start:
 call main
 ld hl, error
 bcall(_puts)
 ret

main:
 ; Find program
 ld hl, tsekrnl
 bcall(_Mov9ToOP1)
 bcall(_ChkFindSym)
 ret c

 ; Check if archived
 ld a, b
 cp 0
 ret nz

 ; Get address
 ex de, hl
 ld e, (hl)
 inc hl
 ld d, (hl)
 inc hl
 add hl, de
 ld de, -9
 add hl, de

 ; Write to variable
 ex de, hl
 ld hl, shell
 bcall(_Mov9b)

 ; Return
 pop hl
 ret

error:
.db "Error!", 0

tsekrnl:
.db ProtProgObj, "TSEKRNL", 0

shell:
.db ProtProgObj, "LINUX", 0, 0, 0

.end
