I'm afraid that I'm not an Axe enthusiast, so I can't help you there. Smile If you had been dealing with ASM or BASIC or Hybrid BASIC instead, however, I could point you in the right direction. Smile
We determined in IRC that his problem was that he was trying to store to L1, which is impossible in Axe. L1 is a static pointer to a piece of safe RAM (I forget which). You can store to {L1} and all is fine. The confusion for me came from SC writing {L1} (meaning List1) where what we would need is (correct me if I'm wrong) {{L1}}.
Ahh, that makes perfect sense, in other words {{L1}+0}? I see a lot of sequences of the form {{L1}+N}, which I assume are N bytes into the memory block pointed to by L1?
Correct. In ASM, it would be the equivalent of
Code:
 ld hl,L1
 ld de,N
 add hl,de
 ld a,(hl)
Or, alternatively, you can use the ix register like this:
Code:
ld a,(ix+N)
Smile
I guess you could Wink My example is (what I think) Axe uses. Though it may do some stack foolery
Code:
 ld hl,L1
 push hl
   ld hl,N
   ex de,hl
   pop hl
 add hl,de
 ld l,(hl)
 ld h,0
{{L1}+N}. I think it follows that format so that all the math operations can be nice and easy and loading variables is easier. For instance: {{{L1}+N}{r}+Z}
Code:
 ld hl,Z
 push hl
   ld hl,N
   push hl
     ld hl,L1
     ex de,hl
     pop hl
   add hl,de
   ld ($+3+1),hl
   ld hl,(0000)
   ex de,hl
   pop hl
 add hl,de
 ld l,(hl)
 ld h,0

(That is probably very incorrect, and slow, but it is how I have always perceived the way Axe does pointers and such)
I hope it doesn't actually do it via SMC like that, which could cause significant problems with respect to tricking shells that like to do intelligent writeback (or more specifically, Intelligent Writeback!). Regardless, though, point taken; thanks for the explanation.
It probably doesn't, I was just too tired to think of another way to do ld hl,(hl). Though I do remember seeing something about how Axe uses some different routines depending on if it is compiling an app or a program. That might mean that it is using some SMC, not sure.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement