Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Mighty Moose on June 15, 2011, 11:58:19 am

Title: [Question] The edit buffer
Post 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:.
Title: Re: [Question] The edit buffer
Post by: thepenguin77 on June 15, 2011, 12:39:37 pm
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.

Code: [Select]
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)
Code: [Select]
|ABCDEFGHIJK|---------------------------------|LMNOPQRSTUVWXYZ|


Edited for clarity about what happens to the byte under the cursor.
Title: Re: [Question] The edit buffer
Post by: ztrumpet on June 15, 2011, 01:30:38 pm
Is the character the cursor is currently on stored in section a or section c?
Title: Re: [Question] The edit buffer
Post by: thepenguin77 on June 15, 2011, 01:33:41 pm
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)
Title: Re: [Question] The edit buffer
Post by: Mighty Moose on June 16, 2011, 09:15:09 am
Thanks a lot!  This should be really helpful.
Title: Re: [Question] The edit buffer
Post by: aeTIos on June 16, 2011, 01:11:11 pm
Woah thepenguin, nice explaination. will be useful for me!