True the prg runs faster, but I always wondered why it takes up more
disk space. When you list the ML prg, there certianly doesn't "seem"
to be more charaters in the ML program, but I haven't tried to count
them either.
Just wondering
Rick
Yes... I spent some time pondering this for years until somebody
explained it to me too. Essentially Blitz doesn't compile it into
ML. Instead, it compiles it into a pseudo type ML.. it is really just
another run-time language, only more efficient than BASIC. The reason
the program is larger is that it has to include the runtime module
(kind of like having a C library when you compile a program in C)
However, I have found that there is a certain threshold that when your
program becomes large enough, the blitzed version will actually be
smaller than the regular BASIC version.
> Why is it that crunching a Basic prg with Blitz, the ML prg ends up
> being more blocks than the original ??
Because this is not crunching but translating from one language into
another.
Let's just look at two simple BASIC commands and how they would look
like in assembler::
print"hello"
Here the BASIC interpreter stores the ``print`` as one byte (token)
followed by one byte per character for the string including the quotation
marks. So this takes 8 bytes. In assembler one has to call a subroutine
with the address of the string to print::
lda #<txt001 ; 2
ldy #>txt001 ; 2
jsr print ; 3
txt001: .bytes "hello", 0 ; 6
Here we have 13 bytes.
Second example::
y=2007
This takes 6 bytes, one for each character. The assembler version
(assuming that `y` is meant to be an integer and not a floating point
number)::
lda #<2007 ; 2
sta y ; 3
lda #>2007 ; 2
sta y+1 ; 3
That's 10 bytes. But *much* faster than the BASIC version because the
BASIC interpreter stores the number as string and converts that string
into a number *each time* the command is executed. Quite braindead.
Ciao,
Marc 'BlackJack' Rintsch
> On Thu, 05 Apr 2007 20:18:28 -0700, Rick Youngman wrote:
>
>> Why is it that crunching a Basic prg with Blitz, the ML prg ends up
>> being more blocks than the original ??
>
> Because this is not crunching but translating from one language into
> another.
>
> Let's just look at two simple BASIC commands and how they would look
> like in assembler::
Except... Blitz! doesn't compile BASIC into ML, it compiles into its own
"high-level" language, Blitz! p-code. These are more and simpler (and
faster) instructions than BASIC's, so that expands the program's size, and
then (as David Murray mentioned), the run-time module that executes the
p-code is attached too.
Brian
--
Thanks
Rick
Just adding one more thing to the compiling question: I found that the
approx tradeoff size was around 75 blocks. Of course this varied depending
on what the program did.
Did anyone here ever use/try PetSpeed? It made Austrocomp appear slow, but
I never found it to be very compatible with the way I wrote, and it make
the resulting app even larger than Austro.
---------------------------------------------------------------------------
Peter Schepers, | Author of : 64COPY, The C64 EMU file converter
Info Systems & Technology | http://www.64copy.com
University of Waterloo, | My opinion is not likely that of the
Waterloo, Ontario, Canada | University, its employees, or anybody
(519) 888-4567 ext 36347 | on this planet. Too bad!
Scuse my ignorance:
PetSpeed ??? a "compiler" like Blitz ??? Never heard of it
before... but that don't mean chit either. Blitz was REAL easy to
use...... is Petspeed similar ???
Rick
> On Apr 6, 7:42 pm, schep...@ist.uwaterloo.ca (Peter Schepers) wrote:
>>
>> Did anyone here ever use/try PetSpeed? It made Austrocomp appear slow...
>
> PetSpeed ??? a "compiler" like Blitz ??? Never heard of it
> before... but that don't mean chit either. Blitz was REAL easy to
> use...... is Petspeed similar ???
I don't think I've heard of Austrocomp. I've heard of Austro-Speed.
Apparently as Austro-Speed went through its versions, the output became
virtually indistinguishable from Blitz!'s. By the way, I've got a
decompiler for Austro-Speed- and Blitz!-compiled programs that I DL'ed from
a BBS years ago.
But, yeah -- there were a variety of BASIC compilers, some with fancier
features than Blitz!.
Brian
--
Petspeed came from the Pet line (thus the name), and was re-released for
the C64 in it's early days... it also wasn't free from what I remember
from the ads for it.
It was a multi-pass compiler (i.e. about 4-5) with _very good_
optimization but if you did anything unusual with BASIC (pokes, tricks)
the compiled program wouldn't work. The speed was excellent/amazing.
Blitz (or Austrocomp as I knew it) was much easier to use, and also to
reverse. Petspeed was very slow to compile and very hard to reverse. It's
output was also larger than Blitz.
The one I first "obtained" was called Austrocomp (from what I remember). I
do recall Austro-Speed and it was likely the same. I recall Blitz was
later, and I always assumed it was the same because it worked so
similarly.
I worked on a decomper for Austro, and had one that almost completely
worked but I never did anything with it. Petspeed seemed impossible to
reverse, and my decomper was only able to reverse a basic outline of the
original BASIC code.
>But, yeah -- there were a variety of BASIC compilers, some with fancier
>features than Blitz!.
Aside from Petspeed and Blitz/Austro, I know of no others.
These are the main differences found between Blitz/Austro complilers.
AUSTRO-COMP AUSTRO-COMP-J
------------------- -------------------
start jump @ $081c: start jump @ $081c:
4C 41 0B 4C 41 0B
ID @ $0826: ID @ $0826:
47 16 3b 16
end of stub: end of stub:
AF 4C 08 AF AF 4C 08 AF
$2d table+pcode $2d table+pcode
$1790 $1783
------------------- -------------------
AUSTRO-SPEED 88 AUSTRO-SPEED v1
------------------- -------------------
start jump @ $081c: start jump @ $081c:
4C 92 0C 4C 8f 0C
ID @ $0826: ID @ $0826:
09 1e 09 1d
end of stub: end of stub:
60 4C 35 A4 60 4C 35 A4
$2d table+pcode $2d table+pcode
$1f93 $1f79
------------------- -------------------
BLITZ: substantially same as AUSTRO-SPEED 88,
only 2 jsr/jmp differs in stub.
pcode is the same
Of course there are other differences in code, but it's irrilevant. Using
these differences a (more or less) universal decompiler is doable. I have
modified one that already decompiled 2 different versions adding the other
2.
http://iancoog.altervista.org/hid/decomp.rar
still in basic, re-blitz it by yourself if you need to run it on a real c64,
on Vice alt-w is enough.
--
-=[]=--- iAN CooG/HokutoForce ---=[]=-
C= is better than C++
> Of course there are other differences in code, but it's irrilevant. Using
> these differences a (more or less) universal decompiler is doable. I have
> modified one that already decompiled 2 different versions adding the other
> 2.
How often do people run into blitz (like) compiled programs?
Any popular programs? Can you give examples? Wouldn't they look just
like assembly language programs?
Christian
> How often do people run into blitz (like) compiled programs?
Depends on how many program you disassemble to look into them to know how
they are made.
> Any popular programs? Can you give examples? Wouldn't they look just
> like assembly language programs?
respectively: Games and tools. No. The "interpreter" stub is in asm, the
pcode no.
> In article <a7GRh.466$3P...@newsread3.news.pas.earthlink.net>,
> Brian Ketterling <twee...@no-potted-meat-products-peoplepc.com> wrote:
>> But, yeah -- there were a variety of BASIC compilers, some with fancier
>> features than Blitz!.
>
> Aside from Petspeed and Blitz/Austro, I know of no others.
Off the top of my head, there were Abacus' BASIC Compiler 64 & 128... pretty
sure there were still others that don't come to mind right now.
Brian
--
script:
>>Aside from Petspeed and Blitz/Austro,
>>I know of no others.
>
>Off the top of my head, there were Abacus'
>BASIC Compiler 64 & 128... pretty
>sure there were still others that don't come
>to mind right now.
The only one I had was SpeedWriter by CodeWriter, (or vice versa?)
salaam,
dowcom
To e-mail me, add the character zero to "dowcom". i.e.:
dowcom(zero)(at)webtv(dot)net.
--
http://community.webtv.net/dowcom/DOWCOMSAMSTRADGUIDE
MSWindows is television,… Linux is radar.