Re: There's only one thing a monkey like you spanks Dustbin. 1904 bytes.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


Quoted text here. Click to load it

varptr is an asic command to tell you where that variable contents are  
stored in memory. It's just like a C/C++ pointer.  

In my version, I specified bload was to store the data in the string but  
you clearly didn't. I don't like being sloppy, but if you insist...I've no  
problem putting it in the first six bytes of the default data segment.. I'm  
not going to reuse the information, so here we go:

First, my revised work on your diddy. 1888 bytes:

print"Dusty Buster. Version 3"
print"Written by Pooh the cat April 25th, 2014"
print""
print"Enter filename: ";
input filename$;
bload filename$ b 6
FOR s = 0 to 5  
a=peek(s)
if s = 3 then
GOSUB m:
partialblock=512-c&
endif
if s < 5 then
b=a
endif
NEXT s
GOSUB m:
totalsize&=c&*512
totalsize&=totalsize&-partialblock
print" "
print"Totalsize ";
print totalsize&;
print" bytes"
end
m:
c&=256*a
c&=c&+b
RETURN  

1888 bytes.

And now my 1872 byte version:

print"Dusty Buster. Version 3"
print"Written by Pooh the cat April 25th, 2014"
print""
print"Enter filename: ";
input filename$;
bload filename$ y 6
y=3
gosub m:
partialblock=256*temp
y=2
gosub m:
partialblock=partialblock+temp
y=5
gosub m:
blocks&=256&*temp
y=4
gosub m:
partialblock=512-partialblock
blocks&=blocks&+temp
blocks&=blocks&*512
blocks&=blocks&-partialblock
print" "
print"Totalsize ";
print blocks&;
print" bytes"

end
m:
temp=peek(y)
return

*hahahaha* Your turn.


--  
Take it easy... Don't let the sound of your own wheels drive you crazy.
Lighten up while you still can. Don't even try to understand. Just find a
place to make your stand and take it easy!  


Re: There's only one thing a monkey like you spanks Dustbin. 1904 bytes.


Quoted text here. Click to load it

Not my sloppy programming. Varptr returns a pointer to where the string is  
sitting in memory. You removed the pointer to save bytes I suspect and the  
program is reading six bytes from the file and putting it in the first six  
bytes of the asic data segment. That's subject to getting stomped on at any  
time. You didn't define c to equal anything, so it's zero right now.  


Quoted text here. Click to load it

see this? a was the pointer for bload, stupid.  it's more dependable than  
just storing data in the default data segment in the fashion you've just  
done. LOL. Since you didn't use the pointer, not much point in having the  
varptr command remain. Your welcome.



--  
Take it easy... Don't let the sound of your own wheels drive you crazy.
Lighten up while you still can. Don't even try to understand. Just find a
place to make your stand and take it easy!  


Re: There's only one thing a monkey like you spanks Dustbin. 1904 bytes.


Quoted text here. Click to load it

I'm not sure what you did to cause it to have problems. Did you change the  
a variable to c and forget to remove c=a? as that would give you an issue  
for sure; since a isn't going to be zero at that point.

Which version specifically gave you the issue? they both used bload. And  
did you make modifications when you encountered a problem?

print"Dusty Buster. Version 3"
print"Written by Pooh the cat April 25th, 2014"
print""
print"Enter filename: ";
input filename$;
a=varptr(filename$)
bload filename$ a 6
c=a
FOR s = 1 to 6
a=peek(c)
if s = 4 then
GOSUB m:
partialblock=512-c&
endif
if s < 6 then
b=a
endif
c=c+1
NEXT s
GOSUB m:
totalsize&=c&*512
totalsize&=totalsize&-partialblock
print" "
print"Totalsize ";
print totalsize&;
print" bytes"
end
m:
c&=256*a
c&=c&+b
RETURN  

As this one seems to work fine here.
I tested it against asicc.exe too. correct bytesize returned.


--  
Take it easy... Don't let the sound of your own wheels drive you crazy.  
Lighten up while you still can. Don't even try to understand.  
Just find a place to make your stand and take it easy!


Re: There's only one thing a monkey like you spanks Dustbin. 1904 bytes.


Quoted text here. Click to load it

Dustin I don't like working with amateurs who don't label their code with  
the appropriate version number.  

Please amend your future code accordingly. Thank you.

--  
Jax    :)

Re: There's only one thing a monkey like you spanks Dustbin. 1904 bytes.

127.0.0.1:

Quoted text here. Click to load it

Talk to pooh. This is his code. I just modified it a day or so ago. Only  
reposted for questions related to what he did that broke it.  
  
Quoted text here. Click to load it

Talk to pooh.

  



--  
Take it easy... Don't let the sound of your own wheels drive you crazy.  
Lighten up while you still can. Don't even try to understand.  
Just find a place to make your stand and take it easy!


Re: There's only one thing a monkey like you spanks Dustbin. 1904 bytes.


Quoted text here. Click to load it

Dustin if you change a program you should mention it in the code.  

That's how pro IT departments do it. Have-a-go amateurs don't understand
the importance of documentation. Do it properly!  

--  
Jax    :)

Re: There's only one thing a monkey like you spanks Dustbin. 1904 bytes.


Quoted text here. Click to load it

http://preview.tinyurl.com/nxetvu3
  



--  
Take it easy... Don't let the sound of your own wheels drive you crazy.  
Lighten up while you still can. Don't even try to understand.  
Just find a place to make your stand and take it easy!


Site Timeline