Author Topic: Axe Parser  (Read 552231 times)

0 Members and 2 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #690 on: May 30, 2010, 11:58:10 pm »
does that store 5 in 700 bytes?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #691 on: May 31, 2010, 12:00:17 am »
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

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #692 on: May 31, 2010, 12:10:25 am »
Is it possible for the stack to get so filled with embedded subroutine calls that it just fails? Because I have a subroutine call in my main program that subsequently calls many embedded subroutines over and over again, and by the time code execution is at the Return for the original subroutine, the program just stops. I put in a line to display some arbitrary value right before the final Return and right after where it should return to, and the first one displays but the second does not.

The involved code:
Code: [Select]
Repeat K=15
  getKey→K
  If K=49
    sub(D)
    Disp 65502>Dec
    Pause 5000
  End
End

Lbl 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 5000
Return

As you can see, there are over a dozen subroutine calls in this subroutine alone, and many of those subroutines call other subroutines. The subroutines called and what they do aren't really important; none of them overwrite memory sections they shouldn't or have Gotos to break code order or call the original subroutine again. The most damning evidence is that in the end, 65501 will display, but 65502 will not. This doesn't make much sense, as "Disp 65502>Dec" should come immediately after "Disp 65501>Dec" in code execution.
« Last Edit: May 31, 2010, 12:23:12 am by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #693 on: May 31, 2010, 12:11:14 am »
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
aaah ok awesome ^^

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #694 on: May 31, 2010, 12:26:49 am »
@Runer

Axe 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.  Also, it could be some other command that is not subroutine related that is causing it to freeze.
« Last Edit: May 31, 2010, 12:28:07 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #695 on: May 31, 2010, 12:30:02 am »
@Runer

Axe 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.

As I said, the problem can't be with the subroutines called or what they do. None of them leak memory (they never did before the addition of this subroutine call, and using a lot of displays at the end of this subroutine, I could determine that all variables and such have the same values they had at an earlier point in the program, which worked correctly) , use Gotos, etc. If they did, the program execution would never reach the last few lines of the original subroutine called, "Disp 65501>Dec," and it does. However, it doesn't reach the lines that should run immediately after the return, like "Disp 65502>Dec."
« Last Edit: May 31, 2010, 12:31:45 am by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #696 on: May 31, 2010, 12:30:54 am »
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

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #697 on: May 31, 2010, 12:32:19 am »
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

Good luck, even with some explanatory comments:
Code: [Select]
.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"→Str07

sub(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
  End

End

.<EXIT CLEANUP>
ClrDraw
DispGraph
Fix 0
Fix 4
Fix 6
Archive Str0

.<SUBROUTINES>
.CHECK IF CAN MOVE CURSOR
Lbl 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
  M
Return

.CHECK IF DISPGRAPH NEEDED
Lbl 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
  End
Return

.UPDATE HEX
Lbl 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
  End
Return

.PRINT HEX
Lbl 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
  End
Return

.BYTE TO PRINTED HEX
Lbl BH
  →B
  B/16+Str1sub(PC)
  If I≥254
    I-1→I
  End
  B^16+Str1sub(PC)
Return

.PRINT CHARACTER
Lbl 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
  End
Return

.MOVE CURSOR
Lbl 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 CURSOR
Lbl 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)
  End
Return

.INVERT PIXEL
Lbl 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 PIXEL
Lbl SP
  If =1 xor (sub(PT))
    sub(IP)
  End
Return

.PIXEL TEST
Lbl PT
  If S=8
    pxl-Test(X+80,Y+22)
  Else
    pxl-Test(sub(QX)+X+72,sub(QY)+Y)
  End
Return

.GET BIT
Lbl GB
  →B
  N→O
  For(C,1,7-B)
    O/2→O
  End
  O^2
Return

.SET BIT
.Lbl SB

.Return

.CONVERT QUADRANT TO X
Lbl QX
  Q=1 or (Q=3)*8
Return

.CONVERT QUADRANT TO Y
Lbl QY
  Q≥2*8
Return

.CHARACTER SIZE MODIFIER
Lbl CS
  S=8*2
Return

.LOAD SPRITE
Lbl 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 ROW
Lbl LR
  conj(Q*8+Y+P,S=8*22+(sub(QY))+Y*12+(sub(QX)≠0)+(S=8)+9+L†,1)
Return

.NEW SPRITE
Lbl 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 SPRITE
Lbl 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 5000
Return

.NUMBER OF SPRITES
Lbl NS
  {V+1}
Return

.APPVAR LENGTH
Lbl AL
  {V+2}ʳ
Return

.SPRITE LENGTH
Lbl SL
  If S=8
    8
  Else
    32
  End
Return

.SPRITE OFFSET
Lbl SO
  {{V}*2+V+2}ʳ
Return

.SPRITE START
Lbl SS
  sub(DS)+(sub(SO))+V
Return

.ALL SPRITE DATA START
Lbl DS
  sub(NS)*2+4
Return

.INITIALIZE 8X8 SPRITE EDITING
Lbl 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 EDITING
Lbl 16
  Fix 0
  sub(IV)
  16→S
  Line(70,0,70,15)
  Line(89,{V}≥10*7,89,15)
Return

.INITIALIZE POSITION VARIABLES
Lbl IV
  0→Q→X→Y
Return

.PRIMARY INITIALIZATION
Lbl 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→K
Return

.<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

The problematic situation occurs when sub(D) is called here (the only place it is called) and does not return:
Code: [Select]
 .DELETE SPRITE
  If K=49 and (sub(NS)≠1)
    sub(D)
    Disp 65502>Dec
    Pause 5000
    sub(L)
  End

As I said, the last lines of sub(D) execute properly, and seeing as I had no problems with any of the code called in sub(D) before, I don't think the code called is the problem.
« Last Edit: May 31, 2010, 01:42:34 pm by Runer112 »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #698 on: May 31, 2010, 12:40:43 am »
What you're describing is exactly a subroutine problem.  What happened is that 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.

I would recommend a more thorough debugging.  Try this: Disp Asm(E1E5)>Dec,i Put it at the beginning of the subroutine and then again at the end.  If the numbers displayed are not the same number, you have a leak somewhere.  The difference between the numbers divided by 2 tells you how many levels off you are.
« Last Edit: May 31, 2010, 12:42:18 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #699 on: May 31, 2010, 12:41:45 am »
What should I look for as possible causes of a leak? I don't have any Gotos, so I know that can't be it.

EDIT: The two "Disp Asm(E1E5)>Dec" commands don't return the same value :(

EDIT 2: Working down the exact line that messes up the stack. And yes DJ Omnimaga, I know how the stack works with pushing and popping.

EDIT 3: Found the exact line. Checking out all the values in it now.
« Last Edit: May 31, 2010, 12:47:45 am by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #700 on: May 31, 2010, 12:44:36 am »
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.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #701 on: May 31, 2010, 12:48:24 am »
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.
As I said before, Axe doesn't allow you do use the stack unless you use your own assembly code, that's why I never mention it.

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.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #702 on: May 31, 2010, 12:50:03 am »
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.

Off by a lot. I have it down to a specific line now, it's a conj() line so it could definitely be the culprit.

EDIT: Well there's your problem, the conj() size is supposed to be fairly small but it's over 4000.

EDIT 2: FIXED IT  ;D ;D ;D Thanks for the stack inspection assembly code Quigibo, that helped a lot.
« Last Edit: May 31, 2010, 12:54:53 am by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #703 on: May 31, 2010, 12:52:33 am »
But you mentionned it a few post ago, which is why I asked D:
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.
I got confused there, considering Axe doesn't use the stack, yet you mention his code might be doing stuff to it. Or is push/pop something that has nothing to do with the stack?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #704 on: May 31, 2010, 12:57:30 am »
Hah, wow if that isnt spaghetti code i dont know what it ;D I was jumping around with the find button to see if any of the Lbls called eachother in a loop or something.  Sometimes i was jumping around for 8 or more Lbls before i got to an end :P