Author Topic: The case of the decreasing RAM  (Read 19756 times)

0 Members and 2 Guests are viewing this topic.

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
The case of the decreasing RAM
« on: June 24, 2010, 12:41:31 pm »
Axe is amazing.  In fact, it is so amazing, that it made me sign up for a forum, an act which I am rarely caught doing.  But to get down to the meat of the problem I am having, a password program I am working on has developed the uncanny ability to eat RAM.  In fact, each time i get the password wrong, then right, it eats 572 bytes of RAM.  I believe that this may have something to do with the assembly code I am using to give the program the ability to turn off the calculator.

This code is EF0850C9

which via the use of calcsys' hex editor and decompiler, I have discovered translates to:
bcall 5008
ret

After testing the code to see if it was the culprit, I learned that every time this code is ran, it eats 6 bytes of ram.
If you factor 572, you get 2, 2, 11 and 13.  So no matter how many times you loop that code, you can't lose 572 bytes.  

Oh, and I looked through all of the symbols and the VAT section of calcsys, and couldn't find anything that matched the size of my missing bytes.  The have been eaten, I tell you!

Does anyone have any idea what could be causing this?

If you want, I could post the source, but it is 516 bytes large and I have no idea exactly what portions are related to the problem.
« Last Edit: June 24, 2010, 10:44:07 pm by DJ Omnimaga »

_player1537

  • Guest
Re: The Case of the Missing RAM
« Reply #1 on: June 24, 2010, 12:46:37 pm »
can you please post the source

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: The Case of the Missing RAM
« Reply #2 on: June 24, 2010, 01:03:09 pm »
Click here for the .8xp file.  If there is a better way of posting code, could you tell me?
« Last Edit: June 24, 2010, 01:14:38 pm by Michael.3545 »

_player1537

  • Guest
Re: The Case of the Missing RAM
« Reply #3 on: June 24, 2010, 01:08:47 pm »
http://sc.cemetech.net
that will work for .8xp (non-asm) pictures, and... something else...
just choose the file and press parse, and then post the output over here :)

also, I thought this was an .8xp?  like the source?

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: The Case of the Missing RAM
« Reply #4 on: June 24, 2010, 01:11:41 pm »
Code: [Select]
[quote author=Michael.3545 link=topic=3608.msg44428#msg44428 date=1277398989]
Click [url=https://docs.google.com/leaf?id=0B1AfyYYD6YT9ZTFkYjBiOGItYzkxMS00ZDVjLWIyNmItNmRhODIyZjg3M2U1&hl=en]here[/url] for the .8xk file.  If there is a better way of posting code, could you tell me?
[/quote]

There are 2 ways [ code ] tags and uploading (which becomes available after 5 posts.
« Last Edit: June 24, 2010, 01:12:28 pm by Ikkerens »

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: The Case of the Missing RAM
« Reply #5 on: June 24, 2010, 01:17:23 pm »
Ah, I see. 5 posts.  And I lied, it is an 8xp file, but I edited it so it is right now.  And there isn't any output from the compiler, it compiles fine.  Running the program itself eats the RAM somehow.

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: The Case of the Missing RAM
« Reply #6 on: June 24, 2010, 01:22:41 pm »
Hi and welcome here.

By the source, by the way, he meant to post the code of your Axe program before compiling/parsing. Either the 8xp file or the code will do. Sadly, due to spam protection, the former is impossible until 5 posts, though, so you would need to go for the later for now.

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: The Case of the Missing RAM
« Reply #7 on: June 24, 2010, 01:25:25 pm »
I did post the source.  That 8xp file is the source code.  It has not been axed yet.


And why would I put ...SRC in an assembled program?
« Last Edit: June 24, 2010, 02:25:50 pm by Michael.3545 »

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: The Case of the Missing RAM
« Reply #8 on: June 24, 2010, 01:26:36 pm »
so this is the code:
Code: [Select]
:.PWD
:ClrHome
:DiagnosticOff
:
:
:
:.SET UP APPVAR
:"vPwdTries"→Str1
:GetCalc(Str1)→A
:!If A
:GetCalc(Str1,1)→A
:Return!If A
:3→{A}
:End
:
:
:
:.LOCKDOWN MODE
:If {A}=0
:Disp "    LOCKDOWN"
:Pause 3000
:If getKey(54)
:If getKey(55)
:If getKey(56)
:3→{A}
:End:End:End
:Goto SD
:End
:
:
:
:.SET PASSWORD
:DeltaList(34,26,18,35,27,19,36,28)→GDB1
:
:
:
:.GET INPUT
:Output(1,3,"INPUT PASSWORD")
:Output(4,4)
:For(I,0,7)
:While getKey(0)
:End
:0→K
:Repeat K
:getKey→K
:End
:K→{{L1}+I}
:Disp 63►Frac
:End
:
:
:
:.CHECK INPUT
:1→K
:For(I,0,7)
:If {I+{L1}}≠{I+GDB1}
:0→K
:End:End
:ClrHome
:If K
:Goto AG
:Else
:Goto AD
:End
:
:
:
:.CORRECT
:Lbl AG
:3→{A}
:Disp " ACCESS GRANTED",{i}
:Return
:
:
:
:.INCORRECT
:Lbl AD
:{A}-1→{A}
:Disp " ACCESS  DENIED"
:Pause 3000
:
:.SHUT DOWN
:Lbl SD
:ClrHome
:Asm(EF0850C9)

Generated by SourceCoder (http://sc.cemetech.net)
© 2005-2010 Cemetech (http://www.cemetech.net)

I don't really get what's all the code doing, and why all the code is the way it is, so perhaps u could explain it a little more?
like the .LOCKDOWN MODE part ???
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

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: The Case of the Missing RAM
« Reply #9 on: June 24, 2010, 01:30:03 pm »
Ok thanks, I did not notice the link a few posts earlier, as I opened the page before the edit.

Quote
And why would I put ...SRC in an assembled program?
It was rude and unnecessary. It's not like the 8xp link was that visible anyway (it was even a 8xk file before I posted). Most people are used to full URLs being shown (or attachment names). Otherwise in the end people will no longer help you if you are not respectful to them.
« Last Edit: June 24, 2010, 01:35:00 pm by DJ Omnimaga »

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: The Case of the Missing RAM
« Reply #10 on: June 24, 2010, 01:37:22 pm »
@_player1537
Ah, so THAT is what that link was for.

@LordConiupiter
Here is a description of what the program does.

It is safe to run, it doesn't clear your ram.  It just eats it.   :)

It is meant to be ran using the startup app.

.SET UP APPVAR
checks to see if the appvar already exists, if not, it creates a new one.  The apvar stores how many tries you have left before the program locks down.


.LOCKDOWN MODE
if you get the password (which is 1 2 3 4 5 6 7 8 currently) wrong three times, the next time the program is ran you must press [2ND] [MODE] and [DEL] simultaneously within 3 seconds to reset your remaining tries to 3.

.SET PASSWORD
 is where I store the correct password into GDB1

.GET INPUT
Gets input and stores it to L1

.CHECK INPUT
compares L1 to GDB1

.CORRECT
exits the program normally, giving you acess to the home screen

.INCORRECT
Turns the program off, causing it to be started again next time you turn the calculator.  (remember the startup app)
« Last Edit: June 24, 2010, 01:43:40 pm by Michael.3545 »

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: The Case of the Missing RAM
« Reply #11 on: June 24, 2010, 01:40:31 pm »
Sorry, I guess I assumed you had clicked on my link and somehow come to the conclusion that it wasn't the source.

Next time I will just use http://sc.cemetech.net to avoid all this confusion and get all of the information in one place.

souvik1997

  • Guest
Re: The Case of the Missing RAM
« Reply #12 on: June 24, 2010, 01:59:22 pm »
How did you get it to assemble with a string inside the Output() and Disp?
Disp and Output only accept pointers, not strings.
You have to store the strings to pointers.

« Last Edit: June 24, 2010, 02:04:55 pm by souvik1997 »

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: The Case of the Missing RAM
« Reply #13 on: June 24, 2010, 02:12:14 pm »
Check the size of the program itself. Here's what I see...

Whenever you run the "CalcOff" hex (Asm(EF0850C9)), the calc turns off, but the program doesn't quit. Then, as it turns on, the calculator's Startup App relaunches the program again. Thus, each time the program is used, you add another running instance of the program to memory, and that causes your "missing RAM".


Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: The Case of the Missing RAM
« Reply #14 on: June 24, 2010, 02:18:59 pm »
@souvik1997
It doesn't seem to mind, and it works as it should.

@ACagliano
prgmPWD is 584 bytes, so subtract out whatever header stuff and your probably do get 572.  Now it all makes sense.  Is there any way to work around this problem?  If only I could exit the program and then do the bcall.

EDIT:  Now that I think of it, there MUST be some way of doing this, as other password protection Apps and Programs don't have this problem.  Oh, and where in memory do the copied programs go? I can't seem to find them with calcsys.
« Last Edit: June 24, 2010, 02:22:20 pm by Michael.3545 »