Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
geekboy1011 wrote:
I just did some poking around in a dissasembly of the tios. Only place I see the interrupt being changed is in flash access commands I believe ( Im 1 / di / Out (14h),a )

So I believe we are good all around. But as we test it I will keep an eye out for problem commands.
That is great news indeed. So I think next we should just get those Cn2.2 BASIC commands set, including the IM 1 hook in the pre-CALCnet hook (which is how you tested, correct?). Then I want to just bite the bullet and get Doors CS 7.2 out, since I suspect Doors CS 8 might turn out to be a TI-84+CSE-only project.
Thats a sadface at the DCS8 thing.

Regardless.

We need commands to Put data into buffers and initialize calcnet

Maybe make
GetCalc( the setup/teardown/debug handler
Get( The receive handler
Send( The send handler?


How would we expect the data to be given/revieved from the user? I am personally in favor of lists. As I always found them a pleasure to work with in TiBasic. Someone suggested Strings. Should we support both or just one or the other?
We tried the token overloading and it wasn't feasible, remember? We're going to stick with more sum() commands. It seems to me that in our last discussion we were considering both strings (which could be manipulated with Celtic III's commands) and lists (which are easier for BASIC coders to manipulate, but 2.5KB for a 255-byte frame including its header.
Where in DCS are the hooks contained Kerm? I would like to start some coding
geekboy1011 wrote:
Where in DCS are the hooks contained Kerm? I would like to start some coding
Take a look at the skeletons in dcsblibs.asm:

Code:
    3.27 +
    3.28 +;==============================================
    3.29 +dbfCn2BASICSend:         ;INCOMPLETE
    3.30 +   jp xLIBEndNoOut
    3.31 +dbfCn2BASICGet:            ;INCOMPLETE
    3.32 +   jp xLIBEndNoOut
    3.33 +dbfCn2BASICStop:            ;INCOMPLETE
    3.34 +   jp xLIBEndNoOut
I never knew those even existed Very Happy

to coding away! Right after I reread the topic to make sure it functions the way we want and I include most of the current requests.


Did we want separate tokens for strings and lists Or should I parse the input and branch accordingly?
Just parse and branch accordingly, I think would be best. It's easy enough to check data types.
Alrighty I'll post if I have any questions ^^ (rereading the thread has answered a lot of my questions...and reminded me of a lot of stuff I forgot we talked about)


Ok question. When you setup calcnet do you do anything to disable link activity interrupts that the Tios interrupt would catch and use to mess up your code? I see the silent link and such like that being a problem I am going to disable them via the flags and such but I'm not sure if its actually a problem
Any TI-OS response to I/O activity would be bad. We know that the OS can potential capture and respond to silent link activity in Pause, Input, and Prompt, so we need to disable that. We also need to make sure that the Link Assist is disabled. Link Assist is controlled via Port 0x08 (non-TI-83+ only!), but I'm not sure about silent linking in Pause/Input/Prompt. Can you come up with some tests to see what happens once you get the basic code in place? Maybe try a simple ping-pong test via your ASM pre-Cn2.2 code and see if Input/Prompt/Pause mess things up?
Well thankfully brandonW Told me about this nice flag he documented a while ago but never put on the wiki ( I put it there)
http://wikiti.brandonw.net/index.php?title=83Plus:Flags:3E
Which should disable Silent link entirely.

As well as disabling link assist in general with
http://wikiti.brandonw.net/index.php?title=83Plus:Flags:33

But yes I will run that through a test once The setup routine is in order.
geekboy1011 wrote:
Well thankfully brandonW Told me about this nice flag he documented a while ago but never put on the wiki ( I put it there)
http://wikiti.brandonw.net/index.php?title=83Plus:Flags:3E
Which should disable Silent link entirely.

As well as disabling link assist in general with
http://wikiti.brandonw.net/index.php?title=83Plus:Flags:33
Oh, that is brilliant. Go BrandonW!

Quote:
But yes I will run that through a test once The setup routine is in order.
Superb.
What is the status of the registers when I get control in the parser compared to this?
Quote:
Class 1 Functions
Class 1 tokens all take some positive number of arguments (zero arguments is a syntax error.) These are separated by commas, or in the case of binary operators, by the operator itself. All of the arguments are evaluated before the function is.
The arguments are placed on the FPS in "reverse" order. That is to say, the earliest argument read is deepest in the stack. The final argument is in OP1. The total number of arguments is passed in HL.
Any of the following data types may be used (except where prohibited by syntax rules): Real, List, Matrix, Equation, String, Complex, Complex List. Real numbers are stored on the stack as floating-point. Complex numbers are stored as two consecutive stack entries or in OP1 and OP2 (see the SDK documentation for Push/Pop OP1/3/5.) Other data types are stored as variable names.
A hook may do any of the following:
Leave all arguments as is, and return Z.
Modify arguments, or add or remove them while updating HL appropriately, and return Z.
Remove all arguments from the FPS, place the result of your computation in OP1, and return NZ.
Remove all arguments from the FPS, reset numOP1,(iy+ParsFlag2), and return NZ. (This is generally preferable if you are not returning a useful value, as it will preserve Ans.)


Im assuming its the same and that I just need to subtract 1 to get my true value in HL?
Nope, that's not quite correct. I hook into the code that Iambian wrote to parse arguments off of the FPS and put them in sane spots. You'll want to use (args), (nargs), (sargs), and (sc1) through (sc4) and (var0) through (varD). Check the comments near the top of c3_hook.asm explaining what they're for.
Ok after hashing some stuff out on irc.

Cn2Get will return
    -0 No data pending
    -1 String
    -2 List


They will go into predefined list/strings (names will be short to save space)

The cn2.2 frame structure will be simple

[FlagB] : [Data]

The FlagB will denote if it is a string (0) or a List (1)
the lengths of the string/list are findable by
PacketLength-1 for strings
(PacketLength-1)/9 for lists


I'm leaning towards strings for the calc id's only because its easier to work with letters in basic with strings than it is with lists. Debate?
Not strings in the sense of 5-byte strings though, right? We're talking 10-character ASCII-encoded hex nibbles?
Yeah those I think. I was honestly just gonna copy the id blatantly into a string variable
KermMartian wrote:
Not strings in the sense of 5-byte strings though, right? We're talking 10-character ASCII-encoded hex nibbles?



How would I go about doing that in asm?
I guess you need ASCII hex to bytes and bytes to ASCII hex? For the first one, each byte is (if you'll pardon the C-style notation):

Code:
#define lower16(char) ((char>'9')?(10+char-'A'):char-'0')

byte[i] = lower16(hex[2i])<<4 | lower16(hex[2i+1])
For the second one:
Code:
hex[2i] = (byte[i]&0xf0)>>4
hex[2i+1] = (byte[i]&0xf0)
hmm I wonder if I should just store them as reals actually. In asm it would look the same and the user is not supposed to be arbitrarily messing with Ids anyway. and a broadcast frame would be a real of 0.

The other plus side is the code and data needed would be a lot smaller and reusable. (will be able to compact all the data copy routines into one call)
geekboy1011 wrote:
hmm I wonder if I should just store them as reals actually. In asm it would look the same and the user is not supposed to be arbitrarily messing with Ids anyway. and a broadcast frame would be a real of 0.
That's quite a good idea. Let's go with that.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 5 of 7
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement