E-mail Address
Password

Register
arasian > support > education > tutorial

Ti-83 and Ti-84 Assembly Programming
Getting Started
     1.1: About This Tutorial
     1.2: About TI-ASM
     1.3: Writing Your First Program
     1.4: Compiling
     1.5: Debugging
ASM Basics
     2.1: Calls and Jumps
     2.2: Registers
     2.3: Displaying Text
System Controls and Calls
     3.1: Data
     3.2: Register Stack
     3.3: If Statements (Comparing)
     3.4: GetKey and GetCSC
     3.5: System Flags
     3.6: Menus
     3.7: Displaying Pictures
     3.8: For Loops (djnz)
     3.9: White Loops
     3.10: OP Registers
Applications
     4.1: Apps vs ASM
     4.5: KeyHooks
GetKey and GetCSC

There are two statements used to get a key, GetKey and GetCSC. GetKey waits for a keypress, then moves on when a key is pressed. GetCSC briefly checks to see if a key is pressed, and moves on whether it is pressed or not. GetKey is best for menus, while GetCSC is good for multitasking things such as games. Here is a sample code of GetKey:

GetKeyLoop:
      B_CALL(_GetKey)
      cp k1
      jp z,Press1
      cp k2
      jp z,Press2
      jp GetKeyLoop

This will wait for a key to be pressed. If it's a 1, it will go to Press1. If it's a 2, it will go to Press2. If it's neither, it will jump back to the GetKey and wait for another key to be pressed. The key codes are usually pretty easy to guess. The '1' key would be k1. The '+' key would be kAdd. If you ever have a question about a key code, you can look in ti83plus.inc. GetCSC is much the same, but it has "sk" prefixes instead of a 'k' prefix.

GetKeyLoop:
      B_CALL(_GetCSC)
      cp sk1
      jp z,Press1
      cp sk2
      jp z,Press2
      jp GetKeyLoop

The scan key codes (GetCSC) are only the physical keys, while GetKey includes the physical keys and the softkeys (such as [2nd][Mem] or [Alpha][A])

Creative Commons License
The text in this tutorial is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Privacy Policy | Contact Us
(c) 1999-2010 Arasian. All rights reserved.