Author Topic: Axe and the VAT  (Read 10131 times)

0 Members and 2 Guests are viewing this topic.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Axe and the VAT
« Reply #15 on: October 07, 2010, 03:16:08 pm »
Ok. I need help now. Here's what I'm trying to do: I used this at first:

Code: [Select]
:sub(VI)
:
:Lbl L
:If sub(VT)=5
:  For(A,1,sub(VNL))
:    Disp {sub(VN)-A+1}>Char
:  End
:  Disp i
:End
:If sub(VNX)
:  Goto L
:End
:Return
:
:.Initialize Vat pointer (using P as pointer)
:Lbl VI
:{E9830}r->P
:Return
:
:.Get Next Entry
:.Returns 1 if End of Vat or 0 otherwise
:Lbl VNX
:P-{P-6}-7->P>={E982E}r
:Return
:
:.Get current entry type
:Lbl VT
:{P}
:Return
:
:.Get Pointer to current name length
:Lbl VNL
:{P-6}
:Return
:
:.Get Pointer to current entry name (backwards)
:Lbl VN
:P-7
:Return

That worked. Now, from there I need to deal only with those programs with a name starting with   %FLD. What I need it to do is check to see if the program's name starts with  %FLD, and if it does, then export the hex representation of the last character of the name to L1. Once that is done, it should add one to the highest value in L1. If someone can do that, I can tackle the rest.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe and the VAT
« Reply #16 on: October 07, 2010, 03:29:10 pm »
Ooh, maybe you could take the mex of the elements in L1 :D
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Axe and the VAT
« Reply #17 on: October 07, 2010, 06:25:10 pm »
Yeah, I'm gonna wind up using the SortD command. But, I can't even get it to work. I keep RAM clearing. Can someone else give it a try and see what code they come up with.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe and the VAT
« Reply #18 on: October 07, 2010, 06:27:58 pm »
If I want to store something into an appvar pointed to by Z, but start at position 1 instead of position 0, would i do

A->Z+1

or A->{Z+1
A->{Z+1}

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Axe and the VAT
« Reply #19 on: October 07, 2010, 06:36:56 pm »
If I want to store something into an appvar pointed to by Z, but start at position 1 instead of position 0, would i do

A->Z+1


or A->{Z+1
A->{Z+1}

I know that now. But I'm saying that I can't get the routine to work. Here's what I'm trying to do:

1. Scan the VAT for all DCS folders (protected programs with the name  %FLD[n], where n is a number.

Code: [Select]
So, a DCS user with four folders on their calc would look like this:

prgm%FLD[1]
prgm%FLD[2]
prgm%FLD[3]
prgm%FLD[4]

2. Figure out what the [n] value on the last folder program is (we'll call that value [n']) and create a name string that reads    prgm%FLD[n'+1]

For some reason my attempts keep crashing, so I would like to see if anyone else can help out.

EDIT: The [n] value can be a number ranging (in hex) from 00-FF.
« Last Edit: October 07, 2010, 06:51:20 pm by ACagliano »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe and the VAT
« Reply #20 on: October 07, 2010, 06:52:37 pm »
Would this work:
Code: [Select]
:"%FLD["->Str1
:sub(VI)
:
:Goto A
:Repeat sub(VNX)
:Lbl A
:For(A,0,4)
:If {P+A-6}!={Str1+A}
:Goto B
:End
:End
:{P-1}->{L1}
:If {L1}>{L1+1}
:{L1}->{L1+1}
:End
:Lbl B
:End
:{L1}-48->L1
:Return
:
:.Initialize Vat pointer (using P as pointer)
:Lbl VI
:{E9830}r->P
:Return
:
:.Get Next Entry
:.Returns 1 if End of Vat or 0 otherwise
:Lbl VNX
:P-{P-6}-7->P>={E982E}r
:Return
:
:.Get current entry type
:Lbl VT
:{P}
:Return
:
:.Get Pointer to current name length
:Lbl VNL
:{P-6}
:Return
:
:.Get Pointer to current entry name (backwards)
:Lbl VN
:P-7
:Return
L1 should hold the number of the highest folder, but my routine only should work for the first 10 folders. :)

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Axe and the VAT
« Reply #21 on: October 07, 2010, 07:11:56 pm »
Would this work:
Code: [Select]
:"%FLD["->Str1
:sub(VI)
:
:Goto A
:Repeat sub(VNX)
:Lbl A
:For(A,0,4)
:If {P+A-6}!={Str1+A}
:Goto B
:End
:End
:{P-1}->{L1}
:If {L1}>{L1+1}
:{L1}->{L1+1}
:End
:Lbl B
:End
:{L1}-48->L1
:Return
:
:.Initialize Vat pointer (using P as pointer)
:Lbl VI
:{E9830}r->P
:Return
:
:.Get Next Entry
:.Returns 1 if End of Vat or 0 otherwise
:Lbl VNX
:P-{P-6}-7->P>={E982E}r
:Return
:
:.Get current entry type
:Lbl VT
:{P}
:Return
:
:.Get Pointer to current name length
:Lbl VNL
:{P-6}
:Return
:
:.Get Pointer to current entry name (backwards)
:Lbl VN
:P-7
:Return
L1 should hold the number of the highest folder, but my routine only should work for the first 10 folders. :)


I wound up doing this...

Code: [Select]
:.VATCHK
:"%FLD"->Str1    // That  [ shouldn't be there. It was a representation on my part.
:sub(VI)
:0->{L1+1}
:
:Goto A
:Repeat sub(VNX)
:Lbl A
:For(A,0,4)
:If {P+A-6}!={Str1+A}
:Goto B
:End
:End
:{P-1}->{L1}
:If {L1}>{L1+1}
:{L1}->{L1+1}
:End
:Lbl B
:End
:{L1}-48->L1
:Return
:
:.Initialize Vat pointer (using P as pointer)
:Lbl VI
:{E9830}r->P
:Return
:
:.Get Next Entry
:.Returns 1 if End of Vat or 0 otherwise
:Lbl VNX
:P-{P-6}-7->P>={E982E}r
:Return
:
:.Get current entry type
:Lbl VT
:{P}
:Return
:
:.Get Pointer to current name length
:Lbl VNL
:{P-6}
:Return
:
:.Get Pointer to current entry name (backwards)
:Lbl VN
:P-7
:Return

That seems to work, but I'll do more extensive testing. Can you please try it as well. I want to make sure it works on more than just my calc. And try to create more DCS folders and see if it changes the result (it should). Thanks alot.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Axe and the VAT
« Reply #22 on: October 09, 2010, 12:09:06 pm »
It doesn't crash. That's a start. But it always returns the character e, no matter how many folders there are. Should it?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe and the VAT
« Reply #23 on: October 09, 2010, 12:18:01 pm »
Try this:
Code: [Select]
:.VATCHK
:"%FLD"->Str1    // That  [ shouldn't be there. It was a representation on my part.
:sub(VI)
:0->{L1+1}
:
:Goto A
:Repeat sub(VNX)
:Lbl A
:For(A,0,3)
:If {P-A-6}!={Str1+A}
:Goto B
:End
:End
:{P-10}->{L1}
:If {L1}>{L1+1}
:{L1}->{L1+1}
:End
:Lbl B
:End
:{L1}-48->L1
:Return
:
:.Initialize Vat pointer (using P as pointer)
:Lbl VI
:{E9830}r->P
:Return
:
:.Get Next Entry
:.Returns 1 if End of Vat or 0 otherwise
:Lbl VNX
:P-{P-6}-7->P>={E982E}r
:Return
:
:.Get current entry type
:Lbl VT
:{P}
:Return
:
:.Get Pointer to current name length
:Lbl VNL
:{P-6}
:Return
:
:.Get Pointer to current entry name (backwards)
:Lbl VN
:P-7
:Return

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Axe and the VAT
« Reply #24 on: October 09, 2010, 12:43:03 pm »
Nope. Same thing. It always returns the e as the next folder, even when I create a new one to see if it changes.

I got it working.


Repeat sub(VNX)

should be

While sub(VNX)
« Last Edit: October 10, 2010, 11:44:48 am by ACagliano »