After reading the Small Edit Buffers entry on wikiTI I started trying to use it. However with little luck. The article gives no examples on how to do this in z80 assembly. I managed to get a it working with parsing enabled and putting numbers into OP1, hoverver can't get it to work with parsing disabled. According to wikiTI, supposedly, with parsing disabled it should output an equation to "text_buf", however I can't find any evidence of this variable existing. When I printed the 11 bytes at OP1 to the screen it didn't display "text_buf", when I bcalled "_DisplayEditSysVar" it didn't print what I entered (it is likely unrelated, just found it in the .inc file), jsTIfied doesn't mention it in the variable list, and _ChkFindSym can't find it. Any help/clarification would be appreciated.


PS: The following is some assembly that should exit if it finds the text_buf (and it may look strange as it is sdcc z80 assembly)



Code:

input_loop:


      ld a, #3
      ld (SmallEditCancelParse), a
      xor a, a
      
      ld (SmallEditColumnLeft), a
      ld (SmallEditRow), a
      
      ld a, #2

      ld (SmallEditPromptString), a
      ld a, #':'
      ld (SmallEditPromptString+1), a
      xor a, a
      ld (SmallEditPromptString+2), a
      inc a
      ld (SmallEditRowCount), a


      ld a, #96
      ld (SmallEditColumnRight), a

      
      bcall(_initsmalleditline)
      bcall(_startsmalledit)



      bcall(_startsmalleditreturn)

      jr after_data


name_data:
      .db EquObj
      .ascii "text_buf"
      .db 0x00
after_data:


      ld hl, #name_data
      rst rMOV9TOOP1
      bcall(_ChkFindSym)
      jp c, input_loop
WikiTI says that when parsing is disabled, _StartSmallEdit leaves the name of the variable in OP1 so I'm guessing you can simply call _ChkFindSym without changing what's in OP1.

Alternately, it seems to be saying that text_buf is referring to the variable with type equation and an empty name:
Quote:
Otherwise, OP1 contains the name of "text_buf", which is:

EquObj, 0
Thanks it appears you are correct. When I bcall _ChkFindSym after _startsmalleditreturn it finds the variable. And when I was printing out OP1 and not seeing anything it is likely because the name of the variable is just 0x3 and a null byte. Now I need to figure out how to handle Equation objects. If you have any documentation somewhere on how TIOS stores tokens I would love to see it, but I assume it is somewhere in ti83plus.inc. Using this code I can get numbers to print after imputing the number into the edit box.

Edit: Found the tokens area in ti83plus.inc


Code:

      bcall(_startsmalleditreturn)

      bcall(_ChkFindSym)
      jp c, input_loop

      inc de
      inc de
      ld b, #10

      PRNT:
      ld a, (de)
      inc de

      push de
      push bc

      bcall(_VPutMap)


      pop bc
      pop de

      djnz PRNT
  
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