0 Members and 3 Guests are viewing this topic.
First, @meishe91, I'm flattered that you cited me as a reference.Second, a pointer is a value that points to an offset in memory. For instance, a pointer with a value of 10 points to the 10th byte (actually, it points to the 11th byte because it is zero-indexed, but lets say that it points to the 10th byte for now). If that place in memory contains code, you can use a pointer to say, "execute this code." If that place contains data, then you can say, "look at this data." Code and data look the same in memory, the only difference being that executing data may accidently in your RAM.Third, here is how applys to Axe, for methods and code:Code: (Axe Basic) [Select]ClrHomesub(SHReturnLbl SHDisp "Hello World!"When Axe compiles, it saves the location of Lbl SH in the first run. By location, I mean that it saves offset from the beginning. So, if SH comes 10 bytes from the beginning, it remembers that SH is 10 bytes from the beginning.The, it hits the "sub(SH" line. It says to itself, "hey, I know where that is! It's 10 bytes from the beginning!" So, it tells the output program to jump to 10 bytes from the beginning, and come back when it's finished.With storing data, it works the same way. If you have:Code: (Axe Basic) [Select][0102030405060708->Pic1Pt-On(0,0,Pic1Axe remembers that Pic1 points somewhere, and then supplys that location to the Pt-On command.Questions?
ClrHomesub(SHReturnLbl SHDisp "Hello World!"
[0102030405060708->Pic1Pt-On(0,0,Pic1
And, do all values for pointers have to be in hex?
A->{LX}B->{LX+1}C->{LX+2}...and so on
Quote from: ACagliano on April 08, 2010, 12:31:05 amAnd, do all values for pointers have to be in hex?No, but it really doesn't make sense to do it any other way, based on the layout and structure of the memory, among other things.
Well ya, he is the one developing Axe but I don't think he has been working with it in programming nearly as much as some other guys have
I'll let you in on a secret though. My ultimate goal is to make the game "Frog Flap" for the calculator complete with music, grayscale, and saving. That will be my final project when the final version comes out. It's another minigame from warioware btw.
Select(POKE) // Select the AppVar POKEUnarchive POKE // Unarchive it if it already existsGetCalc(27)->A // Create/Overwrite an AppVar 27 bytes in sizeconj(L1,A,27) // Copy L1 to the AppVar
Select(POKE) // Select itUnarchive POKE // Unarchive it if it existsGetCalc()->A // Get a pointer to it!If A// It doesn't existElseconj(A,L1,27) // Load the data to L1End
No, after looking at the documentation, it appears to be done a different way (I have not tested this myself).First of all, I can tell you that "LX" will not work. You can only use L1-L6, and all those are is places in the RAM. You don't actually modify user lists.Now, assuming that you have all of your data in L1, this is how you would save it to the AppVar POKE:Code: [Select]Select(POKE) // Select the AppVar POKEUnarchive POKE // Unarchive it if it already existsGetCalc(27)->A // Create/Overwrite an AppVar 27 bytes in sizeconj(L1,A,27) // Copy L1 to the AppVarAnd to read from it:Code: [Select]Select(POKE) // Select itUnarchive POKE // Unarchive it if it existsGetCalc()->A // Get a pointer to it!If A// It doesn't existElseconj(A,L1,27) // Load the data to L1End
"POKE->Str1Select(Str1) // Select the AppVar POKEIf GetCalc(27)->A // Create/Overwrite an AppVar 27 bytes in sizeconj(L1,A,27) // Copy L1 to the AppVarElse// Not enough memoryEnd