Omnimaga
Calculator Community => TI Calculators => ASM => Topic started by: Joshuasm32 on April 27, 2013, 02:17:48 pm
-
I there a way to do this through ASM on the TI-84 Plus SE?
:ASM(prgmPRGMNAME
:If K=101 //Or whatever the keystroke is for [ON] in the program; Can it be stored to K instead of Ans?
:___
:w00t:
-
Actually it's pretty easy, but I don't really have the time to put a prog right now :-X hopefully someone will notice this thread.
-
What do you want to do actually? get a keystroke for On? or do you want to catch an [on] keypress in basic o.o
-
Can I keep [ON] from breaking the program and have it register as a keystroke in either variable K (preferred) or Ans by using an ASM sub-program? ???
-
codebender, yes. If you know ASM, you can learn how to easily with tutorials on tifreak. However, if you do not, good luck searching for one.
The best I can do is give you onblock, but it doesn't have a keypress registry for ON
-
Well, you could compile a program in Axe for NoShell:
:.KEY
:Repeat getKey //only use this if you want it to loop
:End
:getKey->Ans
And it will give you getKey codes in Ans, [ON] having a code of its own. (Ans is the only variable I know how to access with Axe.) Keycodes will be different from those in BASIC; look at
http://axe.eeems.ca/keycodes.png
Hope that works.
-
The only trouble will be that you need to have a custom interrupt to make sure the OS doesn't throw an error. Hopefully somebody with time comes along to help :/ Essentially, you would need the ONBLOCK program active to prevent ON causing an error, then a separate program to scan for key presses and ON. That would essentially be:
AsmPrgm
DB03
E608
EE08
2003
3A3F84
EF8C47
EFBF4A
C9
It returns 8 if ON is pressed, else it returns the values in the link that dinosteven linked to.
-
Teach me hex, oh wise Xeda
-
Dapianokid : just look at some z80 ASM reference, they often have opcodes. ;)
-
Thank you! :thumbsup:
-
Well, I spent all day on this. But here's what I came up with:
ld a, $98
ld ($9900), a
inc a
ld i, a
ld h, a
ld d, h
ld bc, $100
ld l, c
ld e, b
ldir
ld a, e ; e is 1
bcall(_setXXOp1)
bcall(_decO1Exp)
ld hl, data
ld de, $9898
ld bc, dataEnd-data
ldir
im 2
bcall($4744) ; basic getkey, stores it in op2
in a, (04)
and 8
jr z, isOn
bcall(_zeroOp1)
isOn:
bcall(_fpAdd)
bcall(_stoAns)
ret
data:
ex af, af'
bit 1, (iy + 8)
jr nz, $+4
im 1
;$$:
in a, (04)
and 1
jr z, noProblemHere
xor a
out (03), a
ld a, %00001011
out (03), a
noProblemHere:
ex af, af'
rst 38h
ret
dataEnd:
If you wait a couple hours, someone will make this a lot smaller.
The way it works is that you call the program (attached) just like getKey, everything works exactly the same except that if ON is being pressed, it adds 0.1 to the number. You only have to call it once to block the ON button. It will unblock itself when your program quits (and it may even unblock in input, though, I haven't tried).
(The reason it took all day was because I had a rather fatal error in zStart that prevented this from working.)