Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: adamac16 on November 11, 2010, 05:43:49 am

Title: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:43:49 am
Im not sure this goes here, correct me if i chose the wrong place.

But I have finished Hot_Dog's tutorials and i think i am ready for Learn TI-83+ ASM in 28 days. But before i do that, i want to make a simple practice program. The thing is, I don't know where to start. Or how to begin.
Title: Re: ASM practice (Help)
Post by: Deep Toaster on November 11, 2010, 04:58:43 pm
Try making a program to manipulate and display text in different ways. They're simple, and you can do a lot of stuff :)
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:00:19 pm
ive already got something in mind, but i dont know how to start it oncalc
Title: Re: ASM practice (Help)
Post by: Hot_Dog on November 11, 2010, 05:00:47 pm
ive already got something in mind, but i dont know how to start it oncalc


It might help us if you told us what you had in mind :)
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:06:40 pm
its going to ask the user to press a number key, 1 through 9, then displays the number that they chose
Title: Re: ASM practice (Help)
Post by: AngelFish on November 11, 2010, 05:08:58 pm
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?
Title: Re: ASM practice (Help)
Post by: Hot_Dog on November 11, 2010, 05:12:27 pm
Start by displaying the text "Press a number", and using GetKey() to let the user press a key.

Quote
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?

That's too hard for beginners
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:18:15 pm
well Kerm said it was for beginners. idk
Title: Re: ASM practice (Help)
Post by: Deep Toaster on November 11, 2010, 05:18:24 pm
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?

Remember this is after Hot_Dog's lessons, so that might be a bit advanced...

EDIT: Edit ninja'd by Hot_Dog and ninja'd by adamac16. I really shouldn't leave while posting :P
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:23:29 pm
he probably thought that the lessons i read covered that or something. What do yall suggest i do?
Title: Re: ASM practice (Help)
Post by: AngelFish on November 11, 2010, 05:23:36 pm
Start by displaying the text "Press a number", and using GetKey() to let the user press a key.

Quote
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?

That's too hard for beginners

Oh, okay. I haven't looked through your tutorials as fully as I'd like, so I'm not sure what they contain. I know lookup tables come pretty early (day 11 or 12) in 28 days.

By the way, how would you do it if you actually had to write such a routine Hot_Dog?
Title: Re: ASM practice (Help)
Post by: Deep Toaster on November 11, 2010, 05:24:36 pm
he probably thought that the lessons i read covered that or something. What do yall suggest i do?

Hot_Dog's suggestion. They're his tutorials, after all, so he'd know where your at after reading them :)
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:25:54 pm
woah woah wait what?
im mixed up here.
i was talking about kerm, not Hot_Dog
Title: Re: ASM practice (Help)
Post by: Hot_Dog on November 11, 2010, 05:34:20 pm
Quote
By the way, how would you do it if you actually had to write such a routine Hot_Dog?

If I were an absolute, absolute beginner, I would have 10 CPs, one for each key from 0-9.  However, in this case, you can use GetKey, subtract 142 from register A (since the number keys are values from 142 to 151), and then put A into HL so that B_CALL _DispHL can be used.
Title: Re: ASM practice (Help)
Post by: Deep Toaster on November 11, 2010, 05:39:24 pm
woah woah wait what?
im mixed up here.
i was talking about kerm, not Hot_Dog

I know, I just suggested you try Hot_Dog's suggestion.
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:42:07 pm
Start by displaying the text "Press a number", and using GetKey() to let the user press a key.

Quote
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?

That's too hard for beginners
so do i do that for every number? or just once?
Title: Re: ASM practice (Help)
Post by: Deep Toaster on November 11, 2010, 05:43:24 pm
Start by displaying the text "Press a number", and using GetKey() to let the user press a key.

Quote
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?

That's too hard for beginners
so do i do that for every number? or just once?

Whatever number the user presses. Try it.
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:45:26 pm
Start by displaying the text "Press a number", and using GetKey() to let the user press a key.

Quote
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?

That's too hard for beginners
so do i do that for every number? or just once?

Whatever number the user presses. Try it.

display what?
Title: Re: ASM practice (Help)
Post by: Hot_Dog on November 11, 2010, 05:47:01 pm
Start by displaying the text "Press a number", and using GetKey() to let the user press a key.

Quote
Wouldn't you'd just get the keypress, then have the program run through a look up table and return the value from the table?

That's too hard for beginners
so do i do that for every number? or just once?

What would you do if you were writing a Ti-Basic program?  You would have a label to mark a loop.  You ask a user to press a key, and you see if the key is a number.  If it is, you display the number.  If not, you get another key press.

For example:

Lbl KE

getKey->K
If K > ...and K < ...
Goto DI
Goto KE

Lbl DI:

Disp K


Try it now in terms of ASM
Title: Re: ASM practice (Help)
Post by: adamac16 on November 11, 2010, 05:54:11 pm
i know BASIC. and what do u mean?
Title: Re: ASM practice (Help)
Post by: Deep Toaster on November 11, 2010, 05:55:02 pm
He means you should try to make the program in ASM: the user presses a button, you give the key code.
Title: Re: ASM practice (Help)
Post by: Hot_Dog on November 11, 2010, 05:56:51 pm
He means you should try to make the program in ASM: the user presses a button, you give the key code.

Exactly.  I felt that if you visualized it in Basic, you could better figure out how to start, how to end, and what your goals are