Ok, more help is what I need. This program I am making basically is a launcher for my formula bank programs that are written in BASIC. I have a keyhook routine at the bottom that will return the user to the asm program if they hit 2nd->quit in the BASIC one. It returns to the ASM prog just fine, but when it reaches the "call run" routine, it doesnt execute the parseinp. ???
Here is the code:
Code: ;Standard template for ti83+ asm programs
#include "ti83plus.inc";File needed to access system routines
.org userMem-2 ;Define where to start in memory
.db $BB,$6D ;AsmPrgm instruction
Prog_executing equ 1; Equates.
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;\/\/\/\/\/\/\/\/\/\/\/\;;
;; FORMULA BANK LAUNCHER;;
;;/\/\/\/\/\/\/\/\/\/\/\/;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
start:
ld a,0
ld (progrun),a
call ADDkey
call drawint
jp menu
ret
drawint:
set TextEraseBelow,(IY + TextFlags)
set TextInverse,(IY + TextFlags)
set fullScrnDraw, (IY + apiFlg4)
res IndicRun,(IY + IndicFlags)
bcall(_clrlcdfull)
bcall(_grbufclr)
ld H,0
ld L,0
ld d,63
ld e,95
bcall(_DrawRectBorder)
ld b,0
ld c,8
ld d,95
ld e,8
bcall(_DarkLine)
ld b,87
ld c,8
ld d,87
ld e,0
bcall(_DarkLine)
ld b,0
ld c,56
ld d,95
ld e,56
bcall(_Darkline)
ld a,1
ld (pencol),a
ld a,0
ld (penrow),a
ld hl,view
bcall(_vputs)
ld a,65
ld (pencol),a
ld a,0
ld (penrow),a
ld hl,view2
bcall(_vputs)
ld a,80
ld (pencol),a
ld a,0
ld (penrow),a
ld hl,view3
bcall(_vputs)
res TextInverse,(IY + TextFlags)
res TextEraseBelow,(IY + TextFlags)
ld a,2
ld (pencol),a
ld a,56
ld (penrow),a
ld hl,optstxt
bcall(_vputs)
ld a,90
ld (pencol),a
ld hl,xtxt
bcall(_vputs)
ld a,10
ld (pencol),a
ld a,10
ld (penrow),a
ld hl,algtxt
bcall(_vputs)
ld a,10
ld (pencol),a
ld a,20
ld (penrow),a
ld hl,geotxt
bcall(_vputs)
ld a,10
ld (pencol),a
ld a,30
ld (penrow),a
ld hl,grftxt
bcall(_vputs)
ret
menu:
bcall(_getkey)
cp k1
jp z,algrun
jp menu
algrun:
ld a,0
ld (progrun),a
ld hl,algebra
bcall(_Mov9ToOP1)
call unarc
ld hl,algebra
bcall(_Mov9ToOP1)
call unhide
ld hl,algprog
bcall(_Mov9ToOP1)
call run
ld a,0
ld (progrun),a
bjump(_JforceCmdNoChar)
ret
unarc:
bcall(_chkFindSym)
jp c,done
ld a,b
cp 0
jp z,done
bcall(_arc_unarc)
ret
unhide:
bcall(_ChkFindSym)
jp c, Done
;HL points to type byte in VAT entry so change it to AppVar.
ld (hl), ProgObj
ret
run:
ld a,1
ld (progrun),a
;set both of these flags before running the program
set prog_executing,(iy+newdispf)
;next the error handler
errhandon(basicErrHandler)
;Run it
bcall(_parseinp)
;After execution, reset error handler and accumulator
errhandoff()
res prog_executing,(iy+newdispf)
xor a
ret
basicErrHandler:
or a;you must have this
ret
ADDkey:
ld hl,keyhook
ld bc,hook_end-keyhook
ld de,appbackupscreen
ldir ;Copy the code to a safe RAM location
;(Not needed if app)
ld hl,appbackupscreen;
in a,(6) ;Get the mem page
bcall($4F66) ;Install the key hook
ret
keyhook: ;The actual routine
add a,e ;This is required for it to work (op-code:83h)
cp kquit
jr z,tester
ret
tester:
ld a,(progrun)
cp 1
jp z,changeatt
ret ;Exit
hook_end:
bjump(_JForceCmdNoChar)
changeatt:
bcall(_cleanall)
jp start
;=======================================DATA====================================
=======
view:
.db " FormulaBank 2003 ",0
view2:
.db " ",0
view3:
.db " ",0
optstxt:
.db "To setup hit 'stat' ",0
xtxt:
.db "x",0
algtxt:
.db "(1) Algebra",0
geotxt:
.db "(2) Geometry",0
grftxt:
.db "(3) Graphing",0
algebra:
.db AppVarObj,"ZFBALG",0
geometry:
.db AppVarObj,"ZFBGEO",0
graphing:
.db AppVarObj,"ZFBGRF",0
algprog:
.db ProgObj,"ZFBALG",0
geoprog:
.db ProgObj,"ZFBGEO",0
grfprog:
.db ProgObj,"ZFBGRF",0
progrun:
.db $12
reter:
.db $12
done:
ret
ret ;Exit program
.end ;End of code
Please Help! |