I have been messing around with Mimas Very Happy and wrote a program to open the built-in equation solver.

However:
    I lose 2 bytes of RAM every run
    it messes up things like HomeRun
    it makes the calc generally 3x slower (esp. graphing, apps menu) until an app is launched and quit. Note: 84+BE
    attempting to fix the RAM leak by "inc de" twice results in random crashes later, and corrupted programs
    JForceCmd does nothing


Any help?


Code:
org userMem-2
db $BB, $6D
kSolveRoot = $54
JForceCmd = $402A
MonForceKey = $4021
Start:
 ld hl, Trampoline
 ld de, $8000
 ld bc, End-Trampoline
 ldir
 jp $8000
Trampoline:
 ld hl, userMem
 ld de, End-Start
 bcall DelMem
 ld a, kSolveRoot
 bjump MonForceKey
End:
If you're assuming that that's a safe way to quit from a program, you're sadly mistaken. That's a great way to corrupt tons of stuff. The missing two bytes is the $BB,$6D. What you should be doing is installing a getKey hook or something.
KermMartian wrote:
If you're assuming that that's a safe way to quit from a program, you're sadly mistaken.


oh lol i sort of had to do it because i didnt even have any documentation with me. I was eating lunch!

KermMartian wrote:
What you should be doing is installing a getKey hook or something

you mean like a getkey hook (rawkey/whatever) that is in some saferam, when first runs, it returns kSolveRoot, and deletes itself?

Is there any other possible way?
You should never assume how your ASM program is being run and assume you can safely quit by yourself. In the case of HomeRun, the DCS ParserHook disables HomeRun while a program is being run, then re-enables it afterwards, which explains why HomeRun no longer works after your program runs. There's no clean way to do what you want without exploiting a hook acting as a TSR, in my opinion.
yay my key hook worked! but two things:

1) i have to actually press a key to get it to do anything.. how to make immediately after program quits?

2) recommend a saferam area?
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement