Omnimaga
Calculator Community => TI Calculators => ASM => Topic started by: darklink.perry on August 15, 2012, 02:03:17 pm
-
Can anyone help me? I learned the basics of assembly language a couple days ago, and I'm building one of my first long term programs. I need to keep people from breaking with the on button (one of the reasons why I turned to asm!) ???
-
Isn't that automatically as the basic interpreter breaks on ON?
EDIT: And Axe programs also don't break on ON ;)
-
But the assembly program I've written can be broken by pressing On...
-
Yes, iirc the ON break is disabled automatically in asm.
But if you are familiar with BASIC I would strongly recommend you learn Axe Parser. (http://ourl.ca/4060/282749)
-
Actually, I have learned that a while ago, but I still wanted to use Assembly.
-
I think he means that his asm program breaks when he presses ON. If you don't use any OS routines (bcalls)(some will still work, but try it to be sure, and do that ON AN EMULATOR), then you can take full control by disabeling interrupts (the di instruction). This makes the CPU only run your code, so it won't do anything like breaking on ON, displaying the run indicator, etc. BUT it will also stop detecting keys when you don't use direct input. There should be a flag for this too, but I don't know which one.
-
ben_g is exactly on the point. But does that mean that I really can't use any B_CALLs?
-
are you by any chance testing with mirageOS? iirc that has break on ON interrupt.
-
I'm not using any shells. I'm just running it regularly.
-
hmm. Not totally sure but iirc bcall _getKey also breaks on ON. other than that i have no clue what could be causing this, never happened to me.
-
I am in fact using B_CALL _getKey. I wanted to use GetCSC, but I want to detect if any key was pressed, and testing for each and every key would be inconvenient.
-
B_CALL(_GetKey) returns with a = 0 when the ON key is pressed. In order to use it again you need to res onInterrupt,(iy+onFlags). Unfortunately, 2nd+ON can still exit the program during a B_CALL(_GetKey). Fortunately, you can use B_CALL(_GetKeyRetOff) (which is what Axe uses) which returns kOff when 2nd+ON is pressed. There might still be a link-port-related way to exit the program, but I don't know for sure.
-
the GetKeyRetOff on compilation says it isn't a label or macro. if I throw out that command, it still does not stop the on key breakage.
-
Get a more (http://brandonw.net/calcstuff/ti83plus.txt) complete (http://jacob.heliohost.org/calc/ti83plus.inc) ti83plus.inc.
-
you can use B_Call($500B) instaed. It's the same.
-
If I use the ti83plus.inc file jacobly provided, it gives me errors for all B_CALLs. If I use the B_CALL $500B, it waits for a keypress, and then continues, breaking on ON.
-
Did you try adding
#define B_CALL(label) rst 28h \ .dw label
at the start of your code? (together with jacobly's .inc file), and do you call it with the brackets?
-
If I add that, using your method returns the same, and using the provided include, all the B_CALLs return errors, all saying the same:
error: Macro B_CALL is missing arguments
-
How do you call them? Do you do
B_CALL(_ExampleBCALL)
orB_CALL _ExampleBCALL
Also, is your assembler case-sensitive? If so, you might want to check the case. Also, don't forget the underscore at the front of the label.
-
I use B_CALL _ExampleBCALL. And I use spasm.
-
Is there a way to test if GetCSC returns with no keys pressed?
As in, if no keys are pressed, will it set off a flag?
-
Try doing B_CALL(_ExampleBCALL), and GetCSC sets a to 0 if no key was pressed.
-
Okay, when I use the other style, it works, but it still breaks on ON.
How frustrating.
-
Okay, here's some code, if it helps.
.option BM_SHD = 2
.option bm_min_w = 96
#define B_CALL(label) rst 28h \ .dw label
#include "ti83plus.inc"
.org $9D93
.db t2ByteTok, tAsmCmp
B_CALL(_RunIndicOff)
ld hl, Splash_Screen
ld de, plotsscreen
ld bc, 768
ldir
B_CALL(_GrBufCpy)
res onInterrupt,(iy+onFlags)
B_CALL(_GetKeyRetOff)
B_CALL(_ClrLCDFull)
ret
Splash_Screen:
#include "images/logo.bmp"
-
The OS didn't actually interrupt your code. If your code exits with onInterrupt,(iy+onFlags) set, then the break error automatically shows up after your program exits.
Edit: and the flag is automatically set when ON is pressed in B_CALL(_GetKey).
Edit 2: ...so all you have to do is put res onInterrupt,(iy+onFlags) before you return.
-
But it doesn't come up with a break error until I press ON. If I press any other button, then it shows the error.
-
Aha! It works! Thank you SO MUCH!