I need the asm version of the basic commands:
Send({222,500})
and
Get X

My robot device works if i use the basic commands on it. I have an asm app that needs to communicate to it the very same way.

I have read and tried the routine example from the TI 83 plus system routines document. I am building a real list using L1 and sending it. My calculator is a TI-84 plus. Below is the code. I am using brass/latenite. My macros cause the app to pause and wait for user to hit enter. It fails on the SendVarCmd, obviously.

Thanks in advance for your help.



Code:


   PauseWithStatus(Strings.AlphaCondition)
   
   ; Look up L1 and store 1 to element 30.
   LD HL,L1name
   bcall(_Mov9ToOP1) ; OP1 = name
   ;
   bcall(_FindSym) ; look up
   .breakpoint Got_L1addy_to_DE
   RET C ; return if undefined

   ld a, b   ; b is 1 if archived
   or a
   jp nz, err
   
   ld a, ListObj      ; set type of list
   
   bcall(_IncLstSize)
   .breakpoint just_incrementedList
   
   push de   ; ptr to list
   push hl   ; last element #
   
   bcall(_OP1Set1)      ; op1 = 222
   ld a, 82h
   ld (op1+1), a
   ld a, 12h
   ld (op1+2), a
   ld a, 20h
   ld (op1+3), a
   
      
   pop hl
   pop de            ; restore
   push de         ; save ptr to list
   bcall(_PutToL)
   
   
   .breakpoint just_inserted_3_toL1
   
   pop de            ; restore
   
   bcall(_incLstSize)
   
   .breakpoint incremented_second_time
   
   push de      ; ptr to list
   push hl      ; last element # (new dimension)
   
   bcall(_OP1Set1)
   
   ld a, 82h
   ld (op1+1), a
   ld a, 50h
   ld (op1+2), a
   ld a, 00h
   ld (op1+3), a
   
   pop hl         ; restore last element
   pop de         ; restore ptr
   
   bcall(_PutToL)   ; save op1 to the list
   
   .breakpoint just_inserted_2_toL1
   
   PauseWithStatus(Strings.BetaCondition)
   
   ld hl, L1name
   rst rMOV9TOOP1
   bcall(_SendVarCmd)
   bit comFailed, (IY+getSendFlg)
   jp nz, sendFailed
   PauseWithStatus(Strings.CharlieCondition)
   bcall(_AppGetCbl)
   bit comFailed, (IY+getSendFlg)
   jp nz, getFailed
   PauseWithStatus(Strings.DeltaCondition)


sendFailed:
getFailed:
err:
   RET

L1name:
   .db ListObj,tVarLst,tL1,0
Welcome to Cemetech, puromtec! Would you perhaps care to Introduce Yourself? I understand that Daniel (tifreak8x) directed you here; I hope that you enjoy your stay and find it friendly and educational. Anyway, SendVarCmd will indeed send variables, but I'm not convinced that your code above is correct (as indeed your calculator seems to think as well!). I'll edit this post with comments on your code, unless you ninja me.
Correcting my code is a tall order I'm sure..but in the mean time, can you give me a hint about what you think is wrong.
- Does that set the first list element to 122, not 222?
- This dies immediately if the list doesn't already exist or is archived. Is that what you want?
- Why inclistsize? That could make it go to any number of items.

Personally, I would instead look for it, delete it if it exists, then create it as a two-element list and fill it in. I'm also unfamiliar with this IncListSize call, and from your code I'm not convinced that you're not inserting the 500 before the 222 (or 122), depending how that bcall works.
Thanks for reply...

>Does that set the first list element to 122, not 222?

....Ok, so yeah, good catch, however 122 and 222 are both valid commands it turns out. It's arbitrary in this case which one I use.

>This dies immediately if the list doesn't already exist or is archived. Is that what you want?

...In debug on the emulator and on the physical calculator, it passes through the initialization of the list and fails at SendVarCmd.


>Why inclistsize?

...the TI-83 docs seems to indicate this is used when you add rows to the list. I have watched the list in memory get built successfully (using LateNite).

My other idea was to do a .db "Send({222,500})" in my code and then use the system parser routine on it. This *might* be what the TI calculator is actually doing when you run the basic. I don't know.

Your assistance is greatly appreciated.
I compiled your code using the Doors CS SDK and gave in a quick spin. It seems to tack on an extra ,122,500} each time it is run, as I expected, so after three runs L1 is {122,500,122,500,122,500}. I would also expect it to fail on an emulator with no CBL/CBR device connected and emulated, which of course is the case. The question is why it fails on a hardware calculator with the device connected...
I'll delete the list in my version for good housekeeping. Maybe the physical calculator needs this and it will work, will find out later.

>why it fails on a hardware calculator with the device connected...

Whatever the reason, I'll try to look next at that parsing method, though I do not fully understand it. (not able to look at docs now, just trying to remember) I think the parser is meant to parse equations and put the result in OP1, if the result is a variable, the temporary name is put in OP1? What do you think?
The parser performs all the stuff that the homescreen and program execution need; I have used it extremely extensively for Doors CS. If you were to use the parser, you'd basically create a temporary program, load the tokens (not the literal string!) for Send({222,500}) into it, and then pass the program name in op1 to the parser. I don't recommend using that method except as a total last resort, though; it's fairly awkward and kludgy.
1. Added code to actually delete the var
2. Sent it to calculator
3. Ran my app
4. Got to point where it should turn wheels of TI-Robot
5. Nothing happened for a few seconds (cuss word said)
6. WHEELS START TURNING!! Eyes wide open out of complete amazement!

Dude, you have helped me big time! I've put blood and sweat into this for more than a year and left this little detail for the end and it looked rather gloomy for a while. Got about 2% left to do on this app. I'll have to put you in the credits now, if you don't mind.
That's great to hear, good job!
Quote:
Dude, you have helped me big time! I've put blood and sweat into this for more than a year and left this little detail for the end and it looked rather gloomy for a while. Got about 2% left to do on this app. I'll have to put you in the credits now, if you don't mind.
That's awesome, I'm very happy to have been able to help! You can credit me as Christopher Mitchell or Kerm Martian, whichever you prefer (if you do indeed decide to credit me, no pressure Wink ). I hope you'll show us the finished product at some point, and perhaps stick around if you have other cool hardware or software projects going on.
  
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 1 of 1
» All times are UTC - 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