Omnimaga
Calculator Community => TI Calculators => ASM => Topic started by: Xeda112358 on November 29, 2010, 08:19:26 pm
-
Does anybody know of a way to check the battery level without using a B_Call? If you have code, hex or mnemonics are fine. Thanks
-
I have assembly ;D You want bit 0 of port 2. It's set if batteries are good, reset if they are low. So:
in a,($02)
rra
jr c,batt_good
batt_bad:
I think you get the general idea :)
-
Oh, that is helpful, thanks. Is there a way to do a multi-level test? Like that B_Call that returns a value from 0 to 4?
-
It involves weird not-completely-understood interrupt stuff. (Hardware timer 2 is involved. Read more at http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:5221 (http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:5221))
-
Uh-oh... I've never learned how to work with interrupts... I could never understand how to make them or set them up. I've read some tutorials, but it isn't working for me...
-
I believe it already exists:
http://www.ticalc.org/archives/files/fileinfo/415/41559.html (http://www.ticalc.org/archives/files/fileinfo/415/41559.html)
-
I believe it already exists:
http://www.ticalc.org/archives/files/fileinfo/415/41559.html (http://www.ticalc.org/archives/files/fileinfo/415/41559.html)
That one uses the B_Call which is what I am trying to avoid...
-
Something tells me that that program uses the OS bcall. If it did otherwise its author would most likely have stated.
Xeda wants an OS-independent one for some unknown reason ;)
Edit: ninja'd
-
Oh, I am working on that app and the program itself with all the calls (even the unused ones) is only about 2000 bytes of code. I figured I could add some more padding to the code and make it get a little closer to using the full 16384 bytes :D. I have been trying to make it independent of OS calls to make it a little faster and so that I can make the calls fit my needs.
-
Ah, okay, that makes sense. Have you duplicated the font routines yet? ;D
-
Nope :D I will be working on that one sometime, but examples would be cool.
-
You can have the KnightOS font code, if you want. Look at font.asm and text.asm in http://knightos.sourceforge.net (http://knightos.sourceforge.net)
-
Sweet, thanks!. I will look at that for sure!
-
Xeda, your best bet is to just go disassemble the bcall yourself because I don't think there is anyone who actually understands how it works.
Go into calcsys>Hex editor. Then switch to page 7b, 3b, or 1b respective to calcs. Goto 5221. Goto the address you are now looking at (address followed by page number). And have fun. You basically just did a manual bcall. :D
-
How do I switch the flash page in CalcSys? I never knew I could do that...
-
[Alpha] R
-
Xeda, your best bet is to just go disassemble the bcall yourself because I don't think there is anyone who actually understands how it works.
Go into calcsys>Hex editor. Then switch to page 7b, 3b, or 1b respective to calcs. Goto 5221. Goto the address you are now looking at (address followed by page number). And have fun. You basically just did a manual bcall. :D
Even easier, go to the Calcsys console and enter DISROM 5221 (or DR 5221 for short) :)
-
Oh, wow. Thanks, I didn't know CalcSys could do any of that. Thanks!
-
I've always wondered how to disassemble the b_calls. Thanks.
-
Very nice. I didn't know calcsys could do that. I'll try it to day and report back.
EDIT: Okay, wait, when I do the 5221 bcall, is it page 7B address 72E8 or address E872? Endianness confuses me.
EDIT2: nvm, 72E8. The DR function was helpful, too.