Omnimaga
Calculator Community => TI Calculators => ASM => Topic started by: Mighty Moose on June 15, 2011, 11:58:19 am
-
Okay, so I know that the TIOS uses the edit buffer for things like the program editor, etc. My question is this: Is there a way to set up the edit buffer without opening the promptEdit/program editor? Thanks in advance :thumbsup:.
-
Yes there is. Firstly, you are going to want this (http://ourl.ca/7915/141979). This was a guide released by TI when they actually liked us.
I could copy and paste the example out of editbuf.pdf. But I feel it would be more beneficial if you saw it in it's original format.
Also, the edit buffer is not set up like you would expect it to be, so here is my guide to someone else.
When the calculator puts info into an edit buffer, it splits the data up into two sections: What is in front of the cursor, and what is behind the cursor. These two sections are stored at either end of the free ram.
Edit buffer:
a b c
|----------|------------------------------|-----|
1 2 3 4
1 - EditTop
2 - EditCursor
3 - EditTail
4 - EditBtm
a - Before the cursor
b - unused data
c - under and after the cursor
So the data: ABCDEFGHIJK|L|MNOPQRSTUVWXYZ, would look like this: (|| is cursor)
|ABCDEFGHIJK|---------------------------------|LMNOPQRSTUVWXYZ|
Edited for clarity about what happens to the byte under the cursor.
-
Is the character the cursor is currently on stored in section a or section c?
-
That was exacty the question I had before I started a recent venture. It is in C. You could almost image that the cursor is a normal computer cursor, and that it is in front of the byte you are currently on. That makes sense anyways because insert mode puts the character before the character you are currently on.
This means, editCursor is always pointing to nothing. (Unless of course you're out of space)
-
Thanks a lot! This should be really helpful.
-
Woah thepenguin, nice explaination. will be useful for me!