On Tue, 3 Jan 2012, Ethan Dicks wrote:
I wrote at lot of hybrid BASIC/6502-machine-code
programs back in the
day. In the Commodore world (PET BASIC all the way through the
C-128), you had the USR() function, which was handy if you wanted to
pass one floating-point arg to your program and/or wanted your routine
to pass you back a value - just POKE the address of your code into the
documented USR() vector location so BASIC could hit it via a
JMP-indirect instruction ($6C), or if you didn't need to pass args
in/out (or you were willing to play parser tricks), just directly call
your routine with SYS. It was all clearly described in the manuals -
I wouldn't call it a kludge, just a method that was probably present
in Microsoft BASICs that might not have been present in versions of
BASIC that was, for lack of a better term, more Dartmouth-like.
Note: using the BASIC floating point accumulator as a means to pass a
value back from a machine language routine resulted in a program that
would work on 5150, but would NOT work on ANY of the clones (Compaq, etc.)
In 1982, PC-WORLD did a comparison of clones. They referred to Xeno-copy
as "the acid test", because the copy that they had would run on 5150s,
but not any clone. The copy that they had was not a current one - it
clearly stated on the title page that that version was only for real IBM
PCs and to contact the publisher for versions for other machines. My
publisher, may the rot in pieces, deliberately kept that market split, to
"increase sales, and frustrate piracy". (They had a lot of experience
being pirates) PC-World didn't bother to mention that, nor that the
current version ran on anything that ran PC-DOS (I had immediately
changed the code to bring back the return code from INT13h in a memory
location). It cost sales. It also gave me the idea for
"XenoPhobe : The Acid Test" which was a never released program
specifically for quantifying compatability.
Confessions: many commercial programs in those days were written in
BASIC ! and then that information would be hidden.
Overheard at a Comdex party:
Q: What language is your program written in?
A: Sorry, can't answer that.
Q: Oh. Which BASIC compiler do you use?
I rewrote in C before I began doing my own marketing.
(HINT: which C compiler author argued that K&R did NOT specify puts()
appending a newline?)
There was not a SCHEME compiler available at the time, and some of the
early SCHEME compilers were unable to use their 64K of stack space for
recursion of anything more than trivial classroom exercises. I assume
that the current ones have improved that.
I wrote a bunch of additional commercial software, but nothing ever again
in BASIC.
--
Grumpy Ol' Fred cisin at
xenosoft.com