Re: A92: what is the equivalent of ...


[Prev][Next][Index][Thread]

Re: A92: what is the equivalent of ...




At 03:59 PM 4/12/99 +0200, you wrote:
>
>what is the equivalent of the tibasic input (nomber) in asm??
>
>
Ok, I'll try to answer you.
Firstly there is no existent routine wich is able to make directly the same
thing like <Input [QuestionStr,] Var>. You have to make your own. I hope
that you've alrady used the flib and tios, because there are some verry
usefull routines.

Firstly you have to define some memory space on your calc (do it with
<dc.b> ). His size depends of the maximum size of your input string. If
later the prog is running there were stored the characters.

If you want to display a [QuestionStr] use the routine <tios::DrawStrXY>
(you have to work with the stack for transfering values). This string is
stored in memory like your input string.

The way how get numbers or characters:
You have to make a loop wich dose the following things. Firstly you get one
character (use the function flib::idle_loop). After it you test the
character. If it is a not allowed key (or character) you wait for the next
one (Goto Loop). If the pressed key is the Enter key exit the loop. If it
is a number between 0 to 9 you store the character in the defined memory
space (point this space with an address register and work with post
increment). If you want that the pressed key is displayed on screen print
the string with <tios::DrawStrXY>. Now you wait for the next key (Goto Loop).
If you want to have BCD (Binary numbers Coded Decimal) you have to
substract 48 of every byte in the defined memory space.

If you have some questions about flib, tios, BCD, stack or else mail me. If
you want I can send you an exemple of assembly code.

e98csuda@eif.ch
Sudan Christoph
CH-1717 St. Ursen


Follow-Ups: