Command Post Home Page : F2
|
|
F2: Command Post Editor Functions
The Hex Editor menu item allows you to control the editor in a variety of ways. Many options are available to help you debug your applications and related variables.
Jump
The Jump submenu allows you to jump to and view many different important locations in the calculator's memory.

Jump: 1: Address or Handle
The Jump To Dialog displayed by this option allows you to jump to any unsigned long absolute address, an offset from the current address (relative address), or handle on your calculator.
- The Address type will immediately jump to the address you specify.
- The Relative Address type will add the offset you specify to the current address pointed to by the cursor
- The Handle type will dereference the handle you give it, and move the cursor location to the beginning of the handle. If the handle does not exist, an Invalid Handle Error will be thrown.

Jump: 2: AMS Global Variable
The Jump To dialog displayed by this option allows you to directly access and/or monitor a wide variety of AMS global variables. After selecting the AMS global variable, and any relevant information, you will be taken to the requested memory location. The DIAMOND UP key combination will take you to the beginning of the variable, and the DIAMOND DOWN key combination will take you to the end of the variable if Command Post is able to determine the length of the variable.

There are several cases that need special attention:
- MO_option
- This variable is initialized with a call to MO_currentOptions(); before you are taken to the memory location of the variable
- Any changes made to this variable will not be applied to the AMS because Command Post will not call MO_digestOptions(); for you.
- OO_firstACB
- OO_firstACB will be dereferenced so that it points to the ACB rather than the AppID if you say yes in the dialog that will popup after you press ENTER to dismiss the jump dialog.
- If you say NO after pressing ENTER to dismiss the jump dialog, then you will be taken to the location in memory where the value of the handle is stored.
- HS_getAns
- HS_getEntry
- These are not true AMS global variables, but they can be very useful to developers who are writing software that works with the Home Screen Application.
- The History Item text box will become active, and you are required to enter a valid history item. If the requested item is not found, you will be notified with an error dialog.
Jump: 3: Other Addresses
The other addresses dialog allows you to jump to addresses that do not fit well under the Jump To AMS Global Variables dialog.

Description of the Options:
- Exception Vector (valid range 0 - 255)
- Auto Interrupt (valid range 1 - 7)
- Trap
(valid range: 0- 15)
- The 68000 processor used by the TI-89 / TI-92p / V200 keeps a #1024 byte vector table beginning at $000000. This table contains pointers to routines used by the CPU, operating system, and the user. The vectors are referred to with an index from #0 through #255. Each vector is 4 bytes in length. Due to the stack overflow protection mechanism which does not activate until an address below 0x120 is written to, the vector table is more accurately described as containing vectors from #0 - #71 inclusive for our purposes.
- You will be asked if you want to dereference the pointer. If you choose no, you will be taken to the address of the pointer in the exception vector table (somewhere between 0x0 and 0x400). If you choose yes, the pointer in the exception vector table will be dereferenced, and you will be taken to the location that is pointed to in memory (the actual code or data that is pointed to).
- LCD_MEM
- This jumps to the address from which the LCD state is derived.
- OS Contrast
- This jumps to the one byte variable that contains the current contrast for the calculator. On HW2 calcs, this variable will range from 0 to 30, and on HW1 calcs, it will be 1/2 that (0 - 15).
- HW1/HW2 Mem Mapped I/O
- HW2 Mem Mapped I/O
- This is a range in memory that is often referred to as the ports. These addresses which are mapped in memory allow you to communicate directly with the calculator's hardware.
- KeyBuffer
- This is the area in memory where the Key Queue is located. It is home to (among other things) the infamous kb_vars
- Rom Call
- This will become useful for ROM call replacement table developer's once the disassembler has been completed
Jump: 4: Variable
Choosing this option is the same as bringing up the var-link screen with the 2nd - VarLink combination. Choose a variable, and press ENTER. You will be presented with a choice: Data or SymEntry. Selecting Data will take you to the data that the variable holds; the DIAMOND + UP / DOWN key combinations will be updated to reflect the beginning and end of the variable's data respectively. Selecting Sym Entry will take you to the SYM_ENTRY structure of the variable.
One possible use of this is to change the size of a variable's handle. By jumping to the SYM_ENTRY structure, and then to the last WORD in the structure, you can locate the handle that is associated with the variable.

2: Find
The Find tool-set is a very powerful feature. It allows you to search Forewords and Backwards for Byte, Word, Long, and String values. The search begins at the current cursor address, and continues until a match is found, or the end of memory is reached. The ON key may be used at any time to cancel a search. You may search Forewords and Backwards through memory.
Note: When you are searching for values, sometimes, the find feature will stop at an address, and the hex editor will not display the value that you were searching for. This is because there are some locations in memory that are highly volatile - they change frequently. The find feature found the value that you were looking for, but the hex editor did not display it because it had changed in the short amount of time that it takes to switch from Find Mode to the Hex Edit Mode.
Note: Because the find feature is not limited, if you search for a specific string, it will be found at least once because Command Post keeps the string in a buffer of its own - you may have found the buffer that Command Post uses!

3: Resize Handle
The Resize Handle dialog is an especially powerful tool that requires extreme caution with its use. Given any handle number, and size, it resizes the handle so that it uses the amount of space requested. If an error condition is encountered, you will be notified with an error dialog.
One of the primary uses of the Resize Handle feature is to make variables larger. The last word in the SYM_ENTRY structure for a variable is its handle.

4: Edit
The Edit dialog is an integral and powerful feature of Command Post. It combines the ability to edit Byte, Word, Long, and String values with the expression evaluation power of the AMS, and the ability to apply bit masks such as AND, OR, and XOR.
When editing numerical values (Byte, Word, Long), Command Post will parse the input to produce a result, and then it will round the result (if necessary) down to the nearest whole number (Example: 1.7 is rounded to 1). Expressions such as 3+x are valid when x is defined! You can even use Command Post's peek and poke TI-Basic extensions in this (and every other dialog in Command Post that accepts numerical input) dialog.
 |
 |
Pressing ENTER will place the value 0h18 (24) at the current cursor location. Pressing ESC will cancel the operation. |
Pressing ENTER will place the ASCIIZ formatted string "hi!" at the current cursor location. Pressing ESC will cancel the operation. |
TIP: In the hex editor, press the ENTER key to use the edit dialog.
5: Refresh
Refresh (also available via F5) completely redraws the hex editor display. The editor will redisplay each byte value on the screen. This feature is useful when you are viewing a volatile memory area, and need the current values, or are unsure if the memory that you are viewing has changed.
|