ld a,b or a jp nz,ErrPkgNotFound ex de,hl ld c,(hl) inc hl ld b,(hl) inc hl inc b dec b jr nz,+_ ld a,c cp 4 jp c,ErrBadToken _: ld c,(hl) inc hl ld b,(hl) inc hl ld a,b or c jp z,ErrBadToken ld de,(parsePtr) call binSearch jp nz,ErrBadToken ld (parsePtr),de ld c,(hl) inc hl ld b,(hl) inc hl ld de,moduleExec ldir jp moduleExec binSearch: ;HL points to the binLUT ;BC is the size ;DE points to the token to find ld (binLUT),hl ld (binmax),bc ld hl,0 ld (binmin),hl ;binsearchloop: ld hl,(binmax) ld bc,(binmin) or a sbc hl,bc ret c rr h \ rr l add hl,bc call bincompare ret z jr c,+_ ;means input