Getting back to BASICs

Yay for BASIC!

Double yay for the ol’ Commodore 64!

Load"*",8,1

:slight_smile:

That’s nice…Thanks Desmostylus. Sort of Micky Mouse vs Yogi Bear.

Make’s ya appreciate how far computers have come in our lifetimes.

Not me, but I did reverse-engineer the original Altair BASIC written by the 19-year old Bill Gates and Paul Allen and their friend Monte Davidoff.

I was interested to see if Bill could write decent code. Um, yes he certainly could was my conclusion. The interpreter is written in i8080 and the almost-complete annotated disassembly is here :

http://66.216.21.33/altair/4k32/index2.html

That’s pretty cool, Reuben. How long did that take?

Derleth, I would have transliterated your Basic program into F77 as follows:



C  THIS IS A SIMPLE ITERATION PROGRAM IN FORTRAN
      INTEGER A, I
      A = 5
      DO I = 0, 20, 2
         PRINT *, A*I
      END DO
      END

I have reason to believe I was part of a secret government study of young kids and programming because my elementary school class taught me basic computer programming.

I learned some basic Basic (no joke here) in 4th grade and then some more in 5th grade.

I dunno, if I disappear you can assume I was right.

Demo: END DO? Not in any dialect I’ve used. And the DO statement in every dialect I’ve seen needs the line number of the statement that’s just beyond the end of the loop. Your PRINT looks suspect as well, but I think I remember it from g77.

A few points:

The abbreviation doesn’t worry me, but Demo is the actual username of another active poster.

I thought you were a PDP fan. The “END DO” isn’t part of the original F77 spec, but was one of the first things added by DEC to their versions, and widely adopted into others, including MS.

“PRINT f”, where “f” can be “*” or something like “’(1X, 2F3.2, I4)’” is part of the standard.

10 DATA 89,79,85,32,65,76,76,32,83,85,67,75,0
20 READ X
30 IF X <> 0 THEN PRINT CHR$(X); ELSE STOP
40 GOTO 20
99 END

:smiley:

Demostylus: I’m a fan, not a freak. :wink: My books deal with standard F77, so END DO passed over my little head.

(Of course, I know that FORTRAN was only standardized rather loosely compared to C. I’ve just never seen that particular extension.)

Anyway, I’m more interested in PDPs for their assembly language. A decent CISC machine, as opposed to what Intel creates, can hold my interest almost as much as a good RISC machine. My local library has a book that is a tutorial introduction to VAX-11 assembly, BTW, not to mention something else that just makes me smile: A book that steps you through the implementation of a portable (:D) LISP compiler in C. (Published 1989, came with an unfortunately unreadable 5.25" floppy formatted for IBM compatibles.)

And I have probably heard of Demo, but such things don’t usually impugn on the purity of my laziness. :wink:

Oh my.

I’m having flashbacks …

typing … hundreds … of



10 lines
20 of
30 code
40 from
50 PC
60 magazines


just to draw a frog on screen …

(I’m going back to my C++ compiler now - I need an aspirin)

About six months of occasional work - an hour here an hour there, about an hour a day. It would have taken an awful lot longer if Monte Davidoff himself hadn’t greatly helped me with the floating-point math areas. The i8080 of course had no floating-point support, so it had to be done in software. Very expensive too… a full third of the run-time. The project still needs finishing off though, to my shame, better overview pages and a permanent home on the web.

Because it took so long to do just 4K of optimised assembly, I have spent most of the last year working on software tools to make reverse-engineering a lot easier.

<wipes tear from eye>

Ahh, crouching over a ZX81 (with 16K RAMpack), gingerly pressing the ‘dead flesh’ keyboard, praying that ‘wobble’ wouldn’t cause the whole thing to crash, losing a whole afternoon’s work…

We won’t see the likes of those days again.

Ahh… memories… anyone remember monster maze?

YES! It was the second tape I bought for my ZX81. The first was a compilation of about six or seven games written in BASIC (“Sea Wolf” was the only one I can remember).

And perhaps more amazing than Monster Maze was 1K chess; an enterprising programmer actually wrote a playable chess game (with a computer opponent) to run on an unexpanded ZX81.

Despite many people’s disdain for BASIC, I have to give it some credit. BASICA and QuickBasic came “free” with DOS for the longest time, they were procedural and thus easily understood, and (the biggest for me even now), you could do graphics with it! I’ve used Pascal, Prolog, Lisp, Java, C, Smalltalk (shudder), Visual Foo, etc. since then and DOS BASIC is still the only language in which I can do munching squares. (see below also)
My friends and I used to stay behind after school to do 3-D MagicEye, rotating palette and other tricks. (um… I’m sure most of you did that for fun too, so I expect no laughter. :p)

SCREEN 12
FOR t = 0 TO 511
FOR x = 0 TO 500
PSET (x, x XOR t), 6
NEXT x: NEXT t