Feeds

back to article Basic instinct: how we used to code

Reg Hardware Retro Week Logo I’ve recently caught myself, like some horrific solo re-write of the Monty Python Four Yorkshiremen sketch, waxing lyrical to my two iPod-wielding young ‘uns about the good old days; when men were men, computers were effectively clockwork, and computer games… well, come to think about it, they …

COMMENTS

This topic is closed for new posts.

Page:

Bronze badge
Happy

The star trek game

> Basic Computer Games by David Ahl, probably the source (ahem) of the Star Trek game,

it is older, and had been circulated in various forms among mainframe and minicomputer BASIC users. My earliest feat of porting software was making a Honeywell GCOS version of the Star Trek run on my ORIC-1 around 1983. I typed it in from a fanfold listing, which I had printed when working the summer at the computing centre of a power company, helping operate the Honeywell mainframe. After getting in the logic and many evenings of debugging, I made it display the battle status more nicely, updating the screen instead of scrolling. It barely fit into the ORIC-1 (48k version), and I recall I had to work around various quirks and bugs in the ORIC BASIC. Like having to explicitly pop the loop stack if the code jumps out of a FOR loop prematurely.

I still feel the old microcomputer BASICs were great for learning the basics of programming. For one thing you got immediate response (no compiling, just enter your program and type RUN), no need for separate editor, and the way the numbered lines of code directly corresponded to what the program does drove home the fact that computers just blindly obey you commands, in the order you specify, and do no real thinking on their own.

7
0
Anonymous Coward

Re: The star trek game

My dad worked for Honeywell (as a CSE) and I can remember sitting in his office (some time in the late 70's) and playing Star Trek on one of his terminals. It was great, and kept me out of trouble, because any time he was actually using the computer I'd send messages to myself via the pneumatic tube system in the building...of course, racing to see if I could 1) actually locate the right office and 2) beat the tube delivery. Of course, since I was 8 (and it was a long time ago) I don't recall ever getting in trouble, even though this was a good sized hospital. I think it did some of the patients good to watch an 8yo kid run down the halls staring at the ceiling and listening for the message canister... ah, happy memories.

If a kid did that today, they'd probably put the entire building under lockdown and call the SWAT team.

11
0
Anonymous Coward

Re: The star trek game

Haha, I did that too :) A friend of my dad's had some early CP/M-based small business machine, possibly a Cromemco but I don't remember, and it had versions of both Star Trek and Eliza that I printed out, took home and ported to my CBM PET. Happy days....

1
0
Thumb Up

Re: The star trek game

More than just learning the basics of programming, it taught you the basics of computers. Learning VIC-20 BASIC taught me what a bit and a byte are. It made me appreciate that when you "poke" a memory register the computer did stuff. I'm sure there are countless other things it taught me I now take for granted.

Compare that with the BBC journalist learning the "basics" using HTML and Javascript.

2
0

Re: The star trek game

We had a very early 6800 "system" in the electronics lab at school and I remember when we got the code for star trek (n.b. this was hex code that had to be typed in before we could save it to ?paper tape - may have been floppy) but there was a problem as it was too big to fit into the 1kB memory so there was a mad rush to put together a 4kB memory *expansion card* so that we could run it!

0
0
Silver badge

Re: The star trek game

"It made me appreciate that when you "poke" a memory register the computer did stuff"

For me, it wasn't so much as PEEK and POKE of random memory addresses on an older computer, but rather IN and OUT on a much more modern IBM PC clone with QBasic.

Specifically, figuring if I did an OUT on I/O address 0x225 (and 0x224 too if I recall correctly), then hitting alt-enter and bringing up the Windows 95 volume control; the volume had indeed changed.

What followed was an attempt to reverse engineer the mixer chip on the SoundBLASTER 16, then a successful attempt at making god awful sounding noises out of the computer's speakers.

1
0

Classy article

310 GOTO 340

It feels "strange" to write that now as if I've gone back in time to an ancient civilisation...

3
0
Anonymous Coward

Re: Classy article

Speaking of ancient civilisations, anyone else ever have to program in RTL/2 ? It managed to take the worst features of C and Pascal and combine them in one language...

0
0
Devil

Re: Classy article

GOTO? When I was programming GOTO was definitely frowned upon (as was the ALTER statement in COBOL), PROCs and FNs please!

0
0

Hmm..

"1990: that last year of primary school when I was shown my first computer, a Sinclair ZX80. "

I assume you mean '1980' ?

2
0
Joke

Re: Hmm..

unless he was one of those kids that smelt of wee..

3
0
Facepalm

Re: Hmm..

Yep, 1981 actually. No idea where that 1990 came from. Must fix that faulty flux capacitor...

0
0

Re: Hmm..

Not the only typeo, from page 2

"To prove your worth, you had to submit a pencil-written program to the Prefect in charge, who checked it, at which point "you could you" put them onto tape. "

"you could you" ???

0
0
Silver badge
Thumb Up

Re: Hmm..

I was from a poor family, I didn't get a C64 till the late 80s.

Still worked perfectly well as a learning tool though. Learning how to play ATV Simulator and Kickstart 2, that is....

Steven R

0
0
Silver badge
Headmaster

Re: Hmm..

If you're going to be picky, you should learn to spell "typo".

2
0
Anonymous Coward

Re: Hmm..

poor family ? I got a C128 in '87, and even the grandparents had to chip in. Cost was about 40000 Belgian francs, or 1000 in new money. So about 3 months mortgage payments for the family at that time. I did get a colour monitor and a cassette deck included though !

0
0
Happy

1990?

Isn't that getting a little late to see your first Speccie? Those were the Amiga days.

0
1
Anonymous Coward

Re: 1990?

Not really, the Amiga was considerably more expensive than the Spectrums at that time and even Commodore was still selling the C64 as the popular entry level model for the home market.

0
0

Well, learning to code in BASIC had its advantages. If you can learn to make a somewhat complex program that works even though you don't have function calls and the only loop you have is GOTO, chances are you'll do even better once you're given all the amenities of modern languages. Provided that you don't keep writing the whole program in one function and using GOTO for loops, of course...

2
0
Meh

"How we used to code"

... Simon's BASIC.

0
0
Silver badge
Devil

Ughh... Still shudder when I recall those days

Ugh... Crippled language with crippled syntax and crippled capabilities resulting in crippled brains.

I ended up writing a set of routines to emulate a proper stack including recursion in order to be able to use in high school. I had those memorized and started every program by typing them in (don't you love languages which have no external library capabilities). That annoyed the hell out of some of the faculty :)

I wish Fort (and Logo) for that matter were more popular. They made for some much cooler (and more understandable) "education" languages.

0
13

Re: Ughh... Still shudder when I recall those days

Nothing wrong in a language which only has 'goto' for flow control. How do you think assembler implements those fancy 'Do..While' and 'For...Next' structures? That's right - 'IF...THEN', manually decremented/incremented counters and 'GOTO' - much that same as you'd have to do ti in BASIC.

If you understand how it works at a low-level, it's easier to appreciate it at high-level.

Steve

21
0
Thumb Up

Re: Ughh... Still shudder when I recall those days

Actually, the funny thing was, the short-comings of BASIC, meant it was more a of a stepping stone: like a lot of other people I know, got into into machine code in fairly within a couple of years. Rodney Zaks has a lot to answer for...

4
0
Silver badge

Re: Ughh... Still shudder when I recall those days

The only things crippled about BASIC were the minimalist implementations that people made to shoehorn it into 1K of RAM. Proper ANSI-standard BASIC isn't a bad language to program in, and on VMS VAXen (maybe other systems) you could compile it and get decent performance as well.

Don't forget that BASIC was developed at Dartmouth college as a simplified (hence the "B") way to teach programming, so that beginners didn't have to start with FORTRAN or Algol. It did that job well.

No BASIC on my Solaris desktop though, snif :(

6
0
Anonymous Coward

Re: Ughh... Still shudder when I recall those days

> How do you think assembler implements those fancy 'Do..While' and 'For...Next' structures?

BNE - Branch if not equal

BEQ - Branch if equal

BPL - Branch if positive

BNE - Branch if negative

All of the above (and there are more) are branch relative depending upon a condition. This is how the IF..Then..Else is implemented in assembler. These are not GOTO, which would be JMP in assembler.

I spent the 80's writing assembler for a living (6502, Z80, 80x86, 68000 etc) and whilst the JMP (GOTO) instruction could get you out of trouble, it was an instruction you tried to avoid because overuse of it would result in unmanageable code.

2
0
jai
Silver badge

Re: LOGO!!!

Yay, I remember learning Logo on my dad's hand-me-down Apple II

Like a lot of people have said, I think the grounding I had as a kid in learning these basic procedural languages has paid off when I've come to pick up a new language. I wonder what it's like for kids today - do they still start by teaching Basic? Or do they jump-start 7 year olds with a course in object orientated theory before setting them up to write a "hello world" class for a .net app?

1
0

"Don't forget that BASIC was developed at Dartmouth college as a simplified (hence the "B") way to teach programming..."

You are aware, aren't you, that the "Beginner's All-Purpose Symbolic Instruction Code" is a retro-fitted phrase? BASIC was called BASIC because it was basic. Afterwards, people asked "But what does it stand for?" and someone came up with this truly horrible suggestion.

I was using BASIC in 1971 on a PDP-10 at Hatfield Polytechnic over a phone line from our school. But I didn't hear anything about "Beginner's etc etc" until sometime in the 1980s - round about the time that the story that BASIC was invented by Bill Gates started.

1
3

Re: Ughh... Still shudder when I recall those days

I dunno, do you really understand the advantages of writing good readable source until you have spent a day trying to decipher something truly horrible? You can write decent structured code in Basic., its just that the temptation is not to, and like a number of temptations, if you give intoit you or someone else may suffer horribly in the future. Good lesson for life there really...

3
0
Silver badge

Re: Ughh... Still shudder when I recall those days

There was always JSR as well (and on some processors, conditional JSRs as well). Certainly on the 8 bit systems the use of JSR taught you well the value in stack management (very limited stack space for return points) and how to deal with passing values into these subroutines.

And just when you thought you were getting a handle on it all you then got into the ball-ache abortion mess that's x86 assembly code and were forced to waste more clock cycles juggling registers and stack pointers than doing anything that was actually useful. Unfortunately modern x86 code isn't often much better, it's just that the processors are considerably faster.

1
1
Bronze badge
Thumb Down

Re: Ughh... Still shudder when I recall those days

You mean proper ANSI-standard BASIC with variable names of one letter and one digit? That sure made for readable code.

I'd been using BBC Basic for years when I encountered ANSI-standard during a Uni project on a mini. That came as a BIG shock!

2
1
Facepalm

Re: Ughh... Still shudder when I recall those days

I hope you also avoided using the BNE instruction, seeing as how you think it has two different meanings.

BMI, maybe? (Not to be confused with BMI Baby.)

2
0
Big Brother

Re: Ughh... Still shudder when I recall those days

Reminds me of a quote from 70s programming guru Edsger Dijkstra - "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. "

Mind you, he was just as rude about FORTRAN, COBOL, PL1 and APL

0
0
Silver badge
Unhappy

Re: Ughh... Still shudder when I recall those days

Whenever I read this quote I can't help wondering if "Edsger Dijkstra" is Dutch for "superior patronising jerk". Most competent Basic developers were only to glad to move to new programming model.

But what do I know? I'm presumably "mentally mutilated". I hate Basic with a ferocity born of several years working in VB6.

3
0
Silver badge
Thumb Up

> You are aware, aren't you, that the "Beginner's All-Purpose Symbolic Instruction Code" is a retro-fitted phrase?

No, it isn't.

"Several versions of the popular Jargon File once claimed that BASIC is a backronym created in the 1970s (recent versions have corrected this). Evidence from the original Dartmouth BASIC manual (1964) show this to be untrue, but numerous online dictionaries and reference works on the Internet have now proliferated the earlier Jargon File's error."

3
0
Anonymous Coward

Re: Ughh... Still shudder when I recall those days

> I hope you also avoided using the BNE instruction, seeing as how you think it has two different meanings.

Give us a break. Its been over 20 years since I last looked at any assembler and my memory isn't what it used to be.

3
0
Silver badge
Happy

Re: Ughh... Still shudder when I recall those days

> If you understand how it works at a low-level, it's easier to appreciate it at high-level.

True, although I do have to admit to some relief that no other langauge that I know of implemented the FORTRAN Arithmetic IF ! (cue dozens of posts with language examples...)

0
0
Bronze badge

Edsger Dijkstra

Dijkstra thought that the proper subject of Computer Science was algorithms. He never had any time for those who thought that Operations or Language Design were proper subjects for Computer Science.

When he talks about Program Languages, he talks from his point of view of language user, not as a language designer or language researcher. He was very articulate, but his personal opinions on this subject are of no more value than mine. Or less. Since he didn't think it was real computer science, he felt free to ignore evidence he disagreed with.

3
0
Raz
Happy

Re: Ughh... Still shudder when I recall those days

Ha ha, exactly. I started coding a submarine simulator in assembler on Z80 on a Spectrum copy because Basic was too slow and too big. LD A, 64... I ran out of that 42 KB of memory anyway, but I remember that I had removed some code from the BIOS (first 16K) and overwritten it with my code. I could have given an arm for an extension to 128 KB, but by the time I could afford it, a 286 became affordable as well, so I went to 16 bit :)

0
0
Thumb Down

Re: Edsger Dijkstra

Dijkstra participated in design and implementation of some of the most influential languages, including Algol-60, Algol-68 and Ada. He and Hoare made fundamental work in language semantics, typing, formal correctness and concurrency. To think that EWD reduced computer science to algorithms is... unbelievable. (Yes, I subscribe to his view about Basic and yes, I programmed in it. It was difficult to unlearn, but worth it, all happy memories notwithstanding.)

0
0
Thumb Up

Re: Ughh... Still shudder when I recall those days

Branches are jumps; they add an offset to the program counter. That they react on the status flags is just a technicality, they're still GOTOs.

The typical micro BASIC dialect promoted the following idiom for control flow:

IF (X = 1) THEN GOTO 300

That's assembled as (depending on your CPU dialect):

@@if:

MVII #1, R0

CMP X, R0

BEQ @@300

; false

B @@end

@@300:

; true

@@end:

; end

That was e point of the poster you responded to.

3
0
Bronze badge

Re: Ughh... Still shudder when I recall those days

> Nothing wrong in a language which only has 'goto' for flow control.

Sure. Why ask for anything better than the bare minimum?

> How do you think assembler implements those fancy 'Do..While' and 'For...Next' structures?

That depends on the target machine, of course; but typically with conditional branches, not unconditional ones. And for some machines, that includes things like decrement-and-branch-if-not-zero instructions, which are pretty close to "For...Next structures".

True, that sort of thing is typically only available on obscure architectures like x86.

> If you understand how it works at a low-level, it's easier to appreciate it at high-level.

BASIC: all the limitations of assembler, with none of the insight!

JFTR, BASIC wasn't an improvement over FORTRAN or COBOL, either, much less over ALGOL or LISP, for most purposes. In its interpreted forms, it did have a couple of advantages over its forebears as a teaching language - notably being interpreted but less resource-intensive than LISP. But those were quickly overshadowed and by the '80s ubiquity was pretty much its only redeeming quality.

0
0
Unhappy

Hmmm.

Until I see the actual Dartmouth BASIC manual, or a copy of it, and not merely multiple assertions all over the web, I'll stick by my memory. We knew that Algol was Algorithm Language, and Fortran was Formula Translation - but Beginner's All-Purpose Symbolic Instruction Code? Please allow me to be very dubious.

0
0
Facepalm

Well, damn - look what I found....

Replying to myself before anyone else does...

http://www.bitsavers.org/pdf/dartmouth/BASIC_Oct64.pdf

And there it is on page 2. "The language that you will use is BASIC (Beginner's All Purpose Symbolic Instruction Code) which is at the same time precise, simple and easy to understand."

You live and learn.

2
0
Bronze badge
Happy

Re: FORTRAN IF !

The C question mark operator comes close, as in

iVar1 = iTest ? iCase1 : iCase2;

iirc :)

0
0

My single mother was very poor so there wasn't much chance of me getting hold of a computer in those days, fortunately many of my friends had parents who could afford them. So I learnt to program on my friend's devices. Often I actually used them more than they did. Many times friends would simply donate their zx81's & then spectrums to me for months on end!

Eventually a few years later my Mum & relatives clubbed together and got me an Amstrad CPC 64 (green screen) and that's when I found the most useful programming book I have ever encountered.

It was a collection of about 30 basic programs for the CPC64, by this time due to the 64k ram typing many pages of basic into the thing was quite a task. The brilliant thing about this book though was that not a single one of the contained programs actually worked as printed! I would spend days going over the code checking for syntax errors on my part.

Once it was clear I had made no mistakes it was time to start trying to fix the code myself. The buzz I used to get when all that gibberish started to make sense was fantastic. Most of the games were nothing to get too excited about, but becuase I had managed to get them working myself they were a lot more satisfying than they would have been.

I'm sure the author(s) of that book didn't set out to produce 30 broken programs, but because they did, I became hooked on the things. Unfortunately I was never in aposition to be able to touch a computer at school or have any formal training until I put myself through college many years later, then university (Bsc. Soft Eng).

The odd thing is after working with the things for so long, I have long since lost any love of computers, gadgets or programming. I detest the way commercial pressures lead to hacking crappy solutions together. I hate to see C++ that is actually C encased in a few ridiculously huge classes and most of all I hate the mainstream uses of the things these days (ie Marketing, repression, rampant capitalism).

The golden age of computers has passed & now we're into the 'functional magic ' era where technology bloggers can learn a bit of markup and think they understand what programming is like.

tl;dr I liked the old days, things were different when I were a kid.

17
0
Anonymous Coward

Did you spend

29 hours a day down t'mill, pay t'mill owner for permission to come to work, eat a cup of cold gravel, etc?

0
0

Hey, I had one of those too! One day my dad (truck driver) came home with a CPC464 which had "fallen off the back of his lorry" (Actually, he worked for a mail order company and the computer went back and forth from supplier to depot about a half-dozen times cos both ends had lost the paperwork for it, until my Dad decided that if no-one wanted it then I might as well make use of it!) Very similar to the speccy, just slightly better colour options and sound (and of course a proper keyboard) - wrote so many games and software for that thing! Loved it

0
0
Thumb Up

Nothing wrong with BASIC

It's fine for doing what it needs to do - help people get "into" computing and learn. Modern BASICS don't even need line numbers or GOTOs either. the biggest issue is/will be the teachers now, I reckon. I think I was lucky in that I had some good and keen teachers who really encouraged me.

So having been brough up with the micros of the late 70's and 80's, in a fit of nostalgia, I wrote my own BASIC interpreter a few months ago and have been having great fun with it since! I put in all the graphics I liked (turtle as well as cartesian) and it's fun! runs under Linux and so on myRaspberry Pi too!

8
0
Bronze badge

Re: Nothing wrong with BASIC

BASIC only ever 'needed' line numbers because the language designers thought it made a better language. I agree.

FORTRAN used numbers as GOTO labels. BASIC put a line number on every line so that there would be a line number on every line.

Now when I have compile errors or run time execptions, I am given a line number. Which changes with every source change, and which is never displayed as part of the source. Back then, a line number uniquely and consistantly identified a particular line of code. I've supported systems like that, and an error at line 170410 is a lot easier to trace if 170410 has been the same line for the last three years.

I realised that my collegues hated anything which increased the number of keystrokes required to enter a program, but that never seem sufficient justification for loss of such a valuable language feature. Of course, I could touch type before I encountered my first computer, so that made a difference.

Years later I learnded about Database Design, and I realised again the value of having a unique primary key.

4
0
IT Angle

Re: Raspberry Pi?

You have a Raspberry Pi?

0
0

Page:

This topic is closed for new posts.