This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 21 Oct 2003 07:52:05 pm    Post subject:

I know how to run BASIC programs from ASM, but there are INVALID errors when I insert a Pause or Prompt into the BASIC prog. I installed an error handler, but then it crashes my calc. I think I need to install flag, but I havent found any yet. Here is my source:


Code:
   errhandon(errcatch)

                ld hl,prog
                bcall(_Mov9ToOp1)
    bcall(_parseINP)
    ret

errcatch:
   xor a
   ret

prog:
.db ProgObj,"TEST",0
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 21 Oct 2003 08:06:58 pm    Post subject:

Sorry...spamming i know, deal with it

I fixed the flag problem, but now unless I use bjum(_JForceCmdNoChar) to exit the proggie, it kills my calculator. I cant use ret or it freezes, what do I do?


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
Progexecuting  equ  1; Equates.

   errhandon(errcatch)
  
   bcall(_zeroop1); Set Op1 to zero
     ld hl,prog; the name of the prog
   bcall(_MOv9ToOp1)  ; copy it to op1
   bit   ProgExecuting,(iy + newDispf)
   push  af   ; Save it.
   set   ProgExecuting,(iy + newDispf)
   bcall(_parseInp); Run program!
   res ProgExecuting,(IY + newDispf)
   jp  sayhello
sayhello:
   ld hl,167            ;just testing to see if continues
   bcall(_disphl)   
                bcall(_clrlcdfull)
   ret ;<---------------- this ret kills the calculator!!!!


errcatch:
   xor a
   ret

prog:
   .db ProgObj,"ZFBALG",0    
 
done:
 
 ret    ;Exit program
.end    ;End of code


Last edited by Guest on 21 Oct 2003 08:18:49 pm; edited 1 time in total
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 21 Oct 2003 09:54:02 pm    Post subject:

You did not clean up right.

;set both of these flags before running the program
set prog_executing,(iy+newdispf)
set cmdExec,(iy+cmdFlags)

;next the error handler
apponerr basicErrHandler

;Run it
bcall parseinp

;After execution, reset error handler and accumulator
appofferr
xor a

basicErrHandler:
or a ;you must have this
ret

This will work better in an app; however, you will have new problems.

Look into bcall cleanup
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 22 Oct 2003 05:44:13 am    Post subject:

Thanks a lot, it works great
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 22 Oct 2003 09:43:13 pm    Post subject:

Problem...when I run it twice in the same session, it does not execute the program. How do I fix that?
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 22 Oct 2003 11:08:06 pm    Post subject:

Be sure to reset both flags after running the program, clear all errors, run bcall cleanup too.

that should take care of it
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement