0 Members and 7 Guests are viewing this topic.
so i can treat it as a string? is there any way to store the output of "input" directly to a string?
Ah. Well here's a breakdown:When you get as low-level as Axe, everything's stored as individual bytes. A variable (A-Z and theta) is 2 bytes (in Axe), a floating-poiint number is 9 bytes, etc. Your calculator has 32,768 bytes of RAM for you to work with. They're just stored one after the other, 32,768 in a row. There's no way to tell the bytes apart, so that's why each one is given an address.Think of it this way: You've got 32,768 houses lined up in a row that look exactly identical. What really matters is what's in each house, which could be a number from 0 to 255. How do you tell them apart? By using addresses. Each address is a number between $8000 and $FFFF, and they all point to a distinct hou-- er, byte. Hence addresses are called pointers You can literally store anything here, since they're all numbers anyway. You could represent a string as a sequence of bytes; maybe one particular string you need starts at address $C38E and runs to $C390 (three bytes). $C38E would be the pointer that points to the string.And then since each pointer is just a number, you can store that in a variable too. The input simply asks the user to input a string, stores it to a string structure somewhere in RAM, and returns the pointer to (address of) the string. That's all that input→P does: it gets an input string, stores it somewhere, then stores the pointer to the string into variable P. You can then display the contents of that string by calling Disp P, for example.(This is because Disp takes a pointer as an argument and displays the string starting at that address. When you do something like "HELLO"→GDB0:Disp GDB0, all that Axe does is stick the bytes of the string "HELLO" into the program memory and define GDB0 as the address of that string.)Hope that helps (and hope that clears some stuff up for other people, too)!
In other news, Frey continues kicking unprecedented levels of ass.
but how would you store the "input" data to a string? would it beinput->pcopy(p,str1,length(p))
How many buffers are there, and how do I use them in Axe?
How do I create a program with GetCalc(? I can create appvars just fine, but trying to create a program crashes. (It really just freezes, actually.)