0 Members and 5 Guests are viewing this topic.
Repeat K=15 getKey→K If K=49 sub(D) Disp 65502>Dec Pause 5000 EndEndLbl D sub(SO)→{L}r conj(P-2,L+2,sub(SL)+2) If sub(NS)-{V}≠0 sub(SS)→T {V}→A+1→{V} conj(T,sub(SS),sub(AL)-(sub(DS))-(sub(SO))) {V}-1→{V} Else {V}-1→A End conj({V}*2+V+2→T+2,T,sub(AL)-T-2) sub(AL)-(sub(SL)+4→T)→J→{V+2}r sub(NS)-1→{V+1} A^256→{V} conj(V,T+L→T,J) GetCalc(Str0,J)→V conj(T,V,J) sub(L) Disp 65501>Dec Pause 5000Return
Why yes it does It takes advantage of the fact that when you do 5->{L1+5}, the value returned in Ans is not 5, but L1+5
@RunerAxe doesn't have restrictions on this other than the 150 individual label names. Its more of a hardware limitation. I think the stack size is like 400 bytes or something although I have no idea really I'm basically making up this number. Anyone actually know?It sounds more like you have a memory leak on the programming side than on the parser side. Double check that all the subroutines end in Return and that you aren't using goto between subroutines or trapping recursive subroutines, I don't know if you're using those.
well maybe you can post your code so we can actualy see what is going on. Its possible there might be something you are missing, or hardware thats going wrong
.SPREDIT Sprite Editor.PIXEL SPRITES.5x5[F8F8F8F8F8000000]→Pic1.3x3[E0E0E00000000000].2x2[C0C0000000000000].BLANK SPRITE[0000000000000000000000000000000000000000000000000000000000000000]→Pic0.HEX KEYS∆List(33,34,26,18,35,27,19,36,28,20,47,39,31,46,38,30)→GDB1.HEX TEXT"0123456789ABCDEF"→Str1.APPVAR NAME"vSPREDIT"→Str0.HELP TEXT"2ND: INVERT PIXEL"→Str00"ARROW KEYS: MOVE CURSOR"→Str01"0-F: HEX INPUT"→Str02"DEL/STAT: HEX NAVIGATION"→Str03"F2: NEW 8X8 SPRITE"→Str04"F3: NEW 16X16 SPRITE"→Str05"+/-: CHANGE OPEN SPRITE"→Str06"CLEAR: EXIT"→Str07sub(I) .Disp {V}>Dec .Disp {V+1}>Dec .Disp {V+2}>Dec .Disp i .Disp {V+3}>Dec .Disp {V+4}>Dec .Disp {V+5}>Dec .Disp i .Disp {V+6}>Dec .Disp {V+7}>Dec .Disp {V+8}>Dec .Disp i .Disp {V+9}>Dec .Disp {V+10}>Dec .Disp {V+11}>Dec .Disp i .Disp {V+12}>Dec .Disp {V+13}>Dec .Disp {V+14}>Dec .Disp i .Disp {V+15}>Dec .Disp {V+16}>Dec .Disp {V+17}>Dec .Pause 10000.<MAIN LOOP>Repeat K=15 getKey→K .KEYPAD CHECK sub(K) .HELP CHECK If K=53 ClrDraw Fix 0 Str00→{L₁}ʳ Str01→{L₁+2}ʳ Str02→{L₁+4}ʳ Str03→{L₁+6}ʳ Str04→{L₁+8}ʳ Str05→{L₁+10}ʳ Str06→{L₁+12}ʳ Str07→{L₁+14}ʳ For(A,0,7) Text(0,A*8,{A*2+L₁}ʳ) End DispGraph Repeat getKey≠0 End sub(L) End .CHANGE SPRITE If K=10 and (sub(NS)≠{V}) {V}+1→{V} sub(L) End If K=11 and ({V)≠1) {V}-1→{V} sub(L) End .NEW 8X8 SPRITE If K=52 8sub(N) End .NEW 16X16 SPRITE If K=51 16sub(N) End .DELETE SPRITE If K=49 and (sub(NS)≠1) sub(D) Disp 65502>Dec Pause 5000 sub(L) End .CHANGE PIXEL CHECK If K=54 sub(IP) End 0→H .HEX MOVE FORWARD CHECK If K=32 0→D 3→K 3-X^4→W For(A,0,W) If sub(K)=0 65533→Z sub(MC) End End 1→D sub(DG) End .HEX BACK UP CHECK If K=56 0→D 2→K X-1^4→W For(A,0,W) sub(K) End 1→D sub(DG) End 16→H .HEX ENTRY CHECK For(A,0,15) If K={GDB1+A} A→H End End .HEX ENTRY EXECUTION If H≠16 0→D 3→K H→N 0-(X^4)→Z sub(MC) For(A,0,3) A+4sub(GB)sub(SP) If sub(K)=0 65533→Z sub(MC) End End 1→D sub(DG) 16→H EndEnd.<EXIT CLEANUP>ClrDrawDispGraphFix 0Fix 4Fix 6Archive Str0.<SUBROUTINES>.CHECK IF CAN MOVE CURSORLbl K If K=3 and (X+Y≠14 or (S=16 and (Q≠3)))-(K=2 and (X+Y≠0 or (S=16 and (Q≠0))))→Z or (K=1 and (Y≠7 or (S=16 and (Q≤1)))-(K=4 and (Y≠0 or (S=16 and (Q≥2))))→θ)→M sub(MC) End MReturn.CHECK IF DISPGRAPH NEEDEDLbl DG If D≠0 sub(UH) If S=8 0→E 56→F Else 65→E 16→F End sub(PH) Output(0,0) DispGraph EndReturn.UPDATE HEXLbl UH If S=8 For(A,0,7) conj(A+22*12+10+L†,A+P,1) End Else For(J,0,1) For(T,0,1) For(A,0,7) conj(J*8+A*12+T+9+L†,J*2+T*8+A+P,1) End End End EndReturn.PRINT HEXLbl PH For(A,0,sub(SL)-1) If Q*8+Y=A X≥4+254→I End {A+P}sub(BH) If Q*8+Y=A A*2+(X≥4)→I End End If S=8 I*6→E 56→F For(J,0,95) Pxl-Off(J,55) End Else I^8*4+65→E I/8*6+16→F Line(64,0,64,63) For(J,0,3) J*12+16→T Line(64,T,95,T) End End If E≠0 Line(E-1,F,E-1,sub(CS)+F+5) End For(J,0,sub(CS)+4) If E+J>0 and (E+J≤96) Pxl-On(E+J-1,S=16*7+F-1) End EndReturn.BYTE TO PRINTED HEXLbl BH →B B/16+Str1sub(PC) If I≥254 I-1→I End B^16+Str1sub(PC)Return.PRINT CHARACTERLbl PC →U If I=254 Fix 3 End If S=16*3+90≠E Text(E,F,{U}>Frac) Else If S=8 For(J,0,sub(CS)+5) pxl-Test(91-(sub(CS)),F+J)→{J+L₁} End Text(91-(sub(CS)),F,{U}>Frac) For(J,0,sub(CS)+5) For(T,0,sub(CS)+3) If pxl-Test(94-T,F+J) xor pxl-Test(95-T,F+J) Pxl-Change(95-T,F+J) End End If {J+L₁} xor pxl-Test(91-(sub(CS)),F+J) Pxl-Change(91-(sub(CS)),F+J) End End Else Text(66,1,{U}>Frac) For(J,0,5) For(T,0,3) If pxl-Test(69-T,J+1) xor pxl-Test(96-T,F+J) and (T≠0) Pxl-Change(96-T,F+J) End Pxl-Off(69-T,J+1) End End End End If I=254 Fix 2 End S=8*2+E+4→E If 93-(sub(CS))<E S=16*65→E sub(CS)+F+6→F EndReturn.MOVE CURSORLbl MC sub(DC) If S=8 If X+Z→X=8 0→X Y+1→Y End If X=65535 7→X Y-1→Y End Else If X+Z→X=8 0→X If H=16 Q+1→Q If sub(QX)=0 If Y+1→Y=8 0→Y Else Q-2→Q End End Else If Y+1→Y=8 0→Y Q+1→Q End End End If X=65535 7→X If H=16 Q-1→Q If sub(QX)≠0 If Y-1→Y=65535 7→Y Else Q+2→Q End End Else If Y-1→Y=65535 7→Y Q-1→Q End End End End If Y+θ→Y=8 0→Y Q+2→Q End If Y=65535 7→Y Q-2→Q End sub(DC) sub(DG)Return.DRAW CURSORLbl DC If S=8 Pxl-Change(X*6+4,Y*6+4) Else Pxl-Change(sub(QX)+X*4+1,sub(QY)+Y*4+1) EndReturn.INVERT PIXELLbl IP If S=8 Pt-Change(X*6+2,Y*6+2,Pic1) Pt-Change(X*2+57,Y*2+18,Pic1+16) Pxl-Change(X+80,Y+22) Else Pt-Change(sub(QX)+X*4,sub(QY)+Y*4,Pic1+8) Pxl-Change(sub(QX)+X+72,sub(QY)+Y) End sub(DG)Return.SET PIXELLbl SP If =1 xor (sub(PT)) sub(IP) EndReturn.PIXEL TESTLbl PT If S=8 pxl-Test(X+80,Y+22) Else pxl-Test(sub(QX)+X+72,sub(QY)+Y) EndReturn.GET BITLbl GB →B N→O For(C,1,7-B) O/2→O End O^2Return.SET BIT.Lbl SB.Return.CONVERT QUADRANT TO XLbl QX Q=1 or (Q=3)*8Return.CONVERT QUADRANT TO YLbl QY Q≥2*8Return.CHARACTER SIZE MODIFIERLbl CS S=8*2Return.LOAD SPRITELbl L ClrDraw 0→D sub(DS)+(sub(SO))+V+2→P Fix 0 Fix 3 Text({V}<10*4+81→A,0,{V}>Dec) Fix 2 If A≠81 or ({P-2}=8) Line(A-1,0,A-1,6) End Line(A,6,87,6) For(J,0,6) conj(J*12+10+L†→A,A+1,1) conj(Pic0,A,1) End If {P-2}=8 sub(8) 0→J Else sub(16) 3→J End For(Q,0,J) For(Y,0,7) sub(LR) For(X,0,7) If sub(PT) sub(IP) End End sub(LR) End End 1→D sub(IV) sub(DC) sub(DG)Return.LOAD SPRITE ROWLbl LR conj(Q*8+Y+P,S=8*22+(sub(QY))+Y*12+(sub(QX)≠0)+(S=8)+9+L†,1)Return.NEW SPRITELbl N →S sub(DS)→J sub(NS)+1→{V+1} sub(NS)→{V} conj(V,L₁,sub(AL)) J+L₁→O If sub(AL)-J→C≠0 conj(O+C-1,O+C+1,C)ʳ End C→{O}ʳ S→{sub(AL)+L₁+2→C} 2→{C+1} conj(Pic0,C+2,sub(SL)) GetCalc(Str0,sub(AL)+(sub(SL))+4→T)→V T→{L₁+2}ʳ conj(L₁,V,T) sub(L)Return.DELETE SPRITELbl D sub(SO)→{L₁}ʳ conj(P-2,L₁+2,sub(SL)+2) If sub(NS)-{V}≠0 sub(SS)→T {V}→A+1→{V} conj(T,sub(SS),sub(AL)-(sub(DS))-(sub(SO))) {V}-1→{V} Else {V}-1→A End conj({V}*2+V+2→T+2,T,sub(AL)-T-2) sub(AL)-(sub(SL)+4→T)→J→{V+2}ʳ sub(NS)-1→{V+1} A^256→{V} conj(V,T+L₁→T,J) .Disp {T}>Dec .Disp {T+1}>Dec .Disp {T+2}>Dec .Disp i .Disp {T+3}>Dec .Disp {T+4}>Dec .Disp {T+5}>Dec .Disp i .Disp {T+6}>Dec .Disp {T+7}>Dec .Disp {T+8}>Dec .Disp i .Disp {T+9}>Dec .Disp {T+10}>Dec .Disp {T+11}>Dec .Disp i .Disp {T+12}>Dec .Disp {T+13}>Dec .Disp {T+14}>Dec .Disp i .Disp {T+15}>Dec .Disp {T+16}>Dec .Disp {T+17}>Dec .Disp i .Disp J>Dec .Pause 10000 GetCalc(Str0,J)→V conj(T,V,J) .ClrDraw .ClrHome .Output(0,0) .Disp {V}>Dec .Disp {V+1}>Dec .Disp {V+2}>Dec .Disp i .Disp {V+3}>Dec .Disp {V+4}>Dec .Disp {V+5}>Dec .Disp i .Disp {V+6}>Dec .Disp {V+7}>Dec .Disp {V+8}>Dec .Disp i .Disp {V+9}>Dec .Disp {V+10}>Dec .Disp {V+11}>Dec .Disp i .Disp {V+12}>Dec .Disp {V+13}>Dec .Disp {V+14}>Dec .Disp i .Disp {V+15}>Dec .Disp {V+16}>Dec .Disp {V+17}>Dec .Disp i .Disp J>Dec .Pause 10000 Disp 65501>Dec Pause 5000Return.NUMBER OF SPRITESLbl NS {V+1}Return.APPVAR LENGTHLbl AL {V+2}ʳReturn.SPRITE LENGTHLbl SL If S=8 8 Else 32 EndReturn.SPRITE OFFSETLbl SO {{V}*2+V+2}ʳReturn.SPRITE STARTLbl SS sub(DS)+(sub(SO))+VReturn.ALL SPRITE DATA STARTLbl DS sub(NS)*2+4Return.INITIALIZE 8X8 SPRITE EDITINGLbl 8 Fix 1 sub(IV) 8→S Line(0,0,50,0) Line(50,0,50,50) Line(50,50,0,50) Line(0,50,0,0) Line(55,16,74,16) Line(74,16,74,35) Line(74,35,55,35) Line(55,35,55,16) Line(78,20,89,20) Line(89,20,89,31) Line(89,31,78,31) Line(78,31,78,20)Return.INITIALIZE 16X16 SPRITE EDITINGLbl 16 Fix 0 sub(IV) 16→S Line(70,0,70,15) Line(89,{V}≥10*7,89,15)Return.INITIALIZE POSITION VARIABLESLbl IV 0→Q→X→YReturn.PRIMARY INITIALIZATIONLbl I DiagnosticOff Full Fix 5 Fix 7 UnArchive Str0 !If GetCalc(Str0)→V GetCalc(Str0,4)→V ∆List(0,0,4r)→GDB0 conj(GDB0,V,4) 8sub(N) Else sub(L) End 0→KReturn.<VARIABLES>.A=temp.B=bit number (bit subroutine use).C=temp.D=DispGraph needed.E=text x position.F=text y position.H=hex entry.I=invert character marker.J=temp.K=getKey.M=can move.N=number input to bit subroutines.O=bit subroutine temp.P=pointer to working sprite.Q=quadrant.R=sprite number overlay timer.S=sprite size.T=temp.U=text.V=pointer to appvar.W=temp x position.X=x position.Y=y position.Z=change in x position.θ=change in y position
.DELETE SPRITE If K=49 and (sub(NS)≠1) sub(D) Disp 65502>Dec Pause 5000 sub(L) End
Quigibo, it would be nice to maybe describe what involves pushing/poping and the stack when it comes to Axe code, because it is ASM stuff that isn't referenced in the Axe manual, so it might be confusing to Axe programmers that doesn't know ASM.
Runer, are the numbers off by 2 or by a lot? Try putting it in your other subroutines and see if you narrow down the one that changes it.
there was probably a "push without a pop" somewhere in the code so that by the time it get to the return, it has changed the stack order becasue something else was pushed, hopefully a label and not a number since Axe doesn't allow you to use the stack directly, and so it is actually returning not to the place from where it was called but some other place instead, or a random location if a number got pushed.