i have a few questions.
question 1: How come tasm only let me store a number up to four in a user variable.
Question 2: How do i create a list and store dimension and the elements in it without having to type a bunch of code? I tried using the token command TL1 but tasm had problems with it as well.
Question 1: You mean like this?
Code: ld a,(this)
ld a,255
ld (this),a
this:
.db 0
There should be no problem with that at all...
Question 2: There are a bunch of routines. Try AsmGuru to find out about them.
For question 2, TL1 is only the token that signifies the list. You would need to _findsym for it, and then do some ldir to load the data to and from it. It is much easier to use your own array, unless you need floating point precision.
Chipmaster wrote:
For question 2, TL1 is only the token that signifies the list. You would need to _findsym for it, and then do some ldir to load the data to and from it. It is much easier to use your own array, unless you need floating point precision.
Aye, definitely. For example, if you need 25 single-byte numbers, just do .db 0 25 times, label it something like List, then do this to load the 4th element, for example:
Code: ld hl,List
ld de,4
add hl,de
Then you can store to (hl), load from (hl), etc.
KermMartian wrote:
For example, if you need 25 single-byte numbers, just do .db 0 25 times
Or better yet, just equate a section of AppBackUpScreen for it, and reduce the size of your program by 25 bytes
True, true.
Code: List .equ AppBackupScreen
i can do variables like that i thought i had to put
Code:
...the beggining stuff...
call _op1set4
call _pushreal01
call _zeroop1
ld hl,'a'
ld (op1+1),hl
call _stoother
oh and if i wanted to display a variable at a certain point using kerms way how could i do that because if i set coordinates and type .db i would have to have quotation marks.
Ummm, what? OK, what you need to understand is that there's two types of variables. There's the variables you use in BASIC, which are floating point and use a complicated format that's hard to use in asm. Then there's just using bytes to store 0-255 or -127-128, or a word (two byte) to store 0-65536 or -32767-32768. I really recommend that you read ASM in 28 Days; it explains all of this very well.
I agree. We're not here to teach you ASM - that's what tutorials are for - instead, we are here to fill in any gaps or correct any misunderstandings. At least read day 1-7,18-20 of asmin28days before we continue this discussion.
Chipmaster wrote:
I agree. We're not here to teach you ASM - that's what tutorials are for - instead, we are here to fill in any gaps or correct any misunderstandings. At least read day 1-7,18-20 of asmin28days before we continue this discussion.
Definitely. And Chipmaster, Klay Mation ~= Kerm Martian?
KermMartian wrote:
And Chipmaster, Klay Mation ~= Kerm Martian?
Klay Matian = (Kerm + Clay) & (Martian + Mation) = funny
i guess i will take a look at it but dont i have to get rid of the bcall because i have an 83.
The bcalls in most cases are just plain old calls on the 83. There are only a few of them that the 83+ has that the 83 doesn't. Most are the same.
The things that are called by bcall(_routine) or b_call(_routine) on the TI-83+ are simply call _routine on the TI-83.
alright well i read the ones you suggested and well i decided i would give a stack a try but when i tryed to use it tasm couldnt find it. and well what variables can i use exactly besides the registers because i need to use them for keeping stats and i dont want them to be deleted in the program because of the acc and stuff like that.
What do you mean, a stack? The stack is built into the calculator, and only advanced programmers would even have reason to attempt building their own stacks...
Read ASM in 28 days, it would really help you. You can create just about infinite variables for your own use.
Search for a write back routine for 83. This way, your variables will be updated in the "actual" version of the program in RAM, iirc. Also, the stack is simply push and pop a register pair.
If you're writing it for a shell such as Doors CS or Ion, writeback is automatic; you don't even have to do anything fancy.
so i can use xmin and stuff like that to hold my numbers.
No. No no. No no no. For the 1,278,345,320th time, you are not limited by the BASIC variables! Stop thinking like BASIC; asm is completely different. Stuff like A, [F], XMin, Str0, etc are just TI-OS shortcuts to explain hex addresses in RAM where the actual bits and bytes that make up each variable are stored. Creating your own "variable" has ABSOLUTELY nothing to do with that system. All you need is a label and a .db or .dw, and then you can store and recall to that label via ld a,(label) and ld (label),a supereasily.