[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Applesoft BASIC coding
In article <fYSdnVqTxdcX-ZvYnZ2dnUVZ_uidnZ2d@comcast.com>,
Michael J. Mahon <mjmahon@aol.com> wrote:
>BLuRry wrote:
>>>BTW, 49235 = 12*4096 + 0*256 + 5*16 + 3.
>>> C 0 5 3
>>
>>
>> If you're lazy like me and have the windows calc program handy, switch
>> it to scientific mode and you can convert between hex and dec numbers
>
>True, but I find this a convenient and self-documenting convention
>for hex numbers in BASIC. (I wish it had a built in HEX notation,
>but since it's Microsoft BASIC, it would probably be 8080-style
>XXXXh. ;-)
>
>-michael
MBASIC on CP/M used &Hxxxx for hex constants and &xxxxx for octal constants.
However, since the source code of Applesoft is available, anyone can
add whatever features they want to Applesoft. I played around with it
in the early 1980's and added, among other things, hex constants using
the $xxxx notation. Other things I added was IF...THEN...ELSE (still
a one-liner though), an ATAN2() function (i.e. an arc tangent which
works in all four quadrants), and DEG and RAD statements which made
the trig functions work in either dgrees or radians (somewhat like on
most calculators with trig functions).
While this was fun, it wasn't really that useful. Token values had to
be changed, which made older Applesoft programs incompatible. And
the interpreter itself had to run in RAM, leaving considerably less
space for Basic programs.
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/