News:

The AARoads Wiki is live! Come check it out!

Main Menu

Atari BASIC

Started by bandit957, December 13, 2018, 12:31:14 PM

Previous topic - Next topic

bandit957

If you've ever been in computer programming, you're surely familiar with Atari BASIC. You've surely noticed that Atari BASIC has a POP command.

Despite my Atari BASIC expertise, I could never figure out what the POP command does. At first, I thought it was something to do with bubble gum. But people always tell me it "pops" commands off the "stack." I'm still not sure what that means.

Have any of you Atari BASIC programmers ever actually used the POP command?
Might as well face it, pooing is cool


hotdogPi

No, but I have used "pop" in Python, which pops an item off a list.

Quote from: bandit957 on December 13, 2018, 12:31:14 PM
If you've ever been in computer programming, you're surely familiar with Atari BASIC.
You're outdated by 3 decades.
Clinched

Traveled, plus
US 13, 44, 50
MA 22, 40, 107, 109, 117, 119, 126, 141, 159
NH 27, 111A(E); CA 133; NY 366; GA 42, 140; FL A1A, 7; CT 32; VT 2A, 5A; PA 3, 51, 60, QC 162, 165, 263; 🇬🇧A100, A3211, A3213, A3215, A4222; 🇫🇷95 D316

MNHighwayMan

Quote from: bandit957 on December 13, 2018, 12:31:14 PM
If you've ever been in computer programming, you're surely familiar with Atari BASIC.

Umm, no. Due to being born in 1992, I've only studied programming in this millennium.

cjk374

Quote from: MNHighwayMan on December 13, 2018, 12:41:14 PM
Quote from: bandit957 on December 13, 2018, 12:31:14 PM
If you've ever been in computer programming, you're surely familiar with Atari BASIC.

Umm, no. Due to being born in 1992, I've only studied programming in this millennium.

You missed out on all the fun of telling an old green-screen computer to repeat something infinitely many times.  :bigass:
Runnin' roads and polishin' rails.

bandit957

I contend that Atari BASIC was the best version of BASIC you could find in the 1980s. It might not be as good as FreeBASIC, which is intended for newer computers, but it was the best in its day.

You could do neato graphics with Atari BASIC, and write programs that were very advanced for the time. But it was obsessed with the number 255. It also suffered from the dreaded "2-line lockup" bug that spoiled entire programs at the drop of a hat.

Atari BASIC was cool, and it's a shame software companies stopped using it before its time was up.
Might as well face it, pooing is cool

bandit957

Anyone else remember this? The Atari BASIC Reference Manual would always fall apart because it was in a cheap binder style and the pages always slipped out of the rings.

One time I threw it across the room and the pages flew everywhere. I think I gathered all the pages but never got them put back in the right order ever again.
Might as well face it, pooing is cool

OracleUsr

I cut my teeth on Commodore BASIC (had a Vic-20 as my first personal computer)
Anti-center-tabbing, anti-sequential-numbering, anti-Clearview BGS FAN

kurumi

"POP" is not what I thought it was. It seems like a way to fix yourself ("un**ck" is a better word, but we have all ages here) if your code slips out of a "subroutine" without returning. In languages without out-of-block GOTOs, I don't think there's a reason for POP.

I think if you don't POP, you just fill up the stack; the next gosub/return should still work if you have space left.

Quote from: https://archive.org/stream/atari-basic-reference-manual/ataribasicreferencemanual_djvu.txt
The POP command must be used according to the following rules:

1. It must be in the execution path of the program.
2. It must follow the execution of any GOSUB statement that is not brought  back to the main program by a RETURN statement.

The following example demonstrates the use of the POP command with a GOSUB when the RETURN is not executed:

10 GOSUB 1800
15 REM LINE 20 WILL NOT BE EXECUTED
20 PRINT "NORMAL RETURN PRINTS THIS MESSAGE."
30 PRINT "ABNORMAL RETURN PRINTS THIS MESSAGE."
40 POP
999 END

1800 PRINT "NOW EXECUTING SUBROUTINE."
1815 REM derp
1810 GOTO 30
1820 RETURN

P. S. If you do still have a VIC-20 lying around, go get the following PDF (from 1984), go to page 214, and type in the Chord Organ program I published when I was a wee lad: https://computerarchive.org/files/comp/books/Compute/Compute%27s_Third_Book_of_Vic.pdf
My first SF/horror short story collection is available: "Young Man, Open Your Winter Eye"

Jim

I mostly got started with BASIC on the Commodore 64.  However, I did have the "Basic Programming" cartridge for my Atari 2600 before that.
Photos I post are my own unless otherwise noted.
Signs: https://www.teresco.org/pics/signs/
Travel Mapping: https://travelmapping.net/user/?u=terescoj
Counties: http://www.mob-rule.com/user/terescoj
Twitter @JimTeresco (roads, travel, skiing, weather, sports)

roadman

Quote from: cjk374 on December 13, 2018, 04:26:48 PM
Quote from: MNHighwayMan on December 13, 2018, 12:41:14 PM
Quote from: bandit957 on December 13, 2018, 12:31:14 PM
If you've ever been in computer programming, you're surely familiar with Atari BASIC.

Umm, no. Due to being born in 1992, I've only studied programming in this millennium.

You missed out on all the fun of telling an old green-screen computer to repeat something infinitely many times.  :bigass:
Freshman year of college (1980-1981), I took Basic programming (even though I was in the Transportation Management program, it was a required course).  We did all our work on terminals at a central computer center.  One day, when I went to get a printout of an assignment, there was a notice that the printer was down.  In the output bin, I noticed a printout that was many, many pages long, and a note from the computer center administrator for the person who sent the printout to see them.  Looking a the first page, I could see it was the same assignment I'd just completed, and it was obvious they had forgotten to close the infinite loop in their code.
"And ninety-five is the route you were on.  It was not the speed limit sign."  - Jim Croce (from Speedball Tucker)

"My life has been a tapestry
Of years of roads and highway signs" (with apologies to Carole King and Tom Rush)

bandit957

Quote from: roadman on December 14, 2018, 09:08:46 AM
Freshman year of college (1980-1981), I took Basic programming (even though I was in the Transportation Management program, it was a required course).  We did all our work on terminals at a central computer center.  One day, when I went to get a printout of an assignment, there was a notice that the printer was down.  In the output bin, I noticed a printout that was many, many pages long, and a note from the computer center administrator for the person who sent the printout to see them.  Looking a the first page, I could see it was the same assignment I'd just completed, and it was obvious they had forgotten to close the infinite loop in their code.

I took a computer class at community college in 2006, and somebody wasted all the paper and ink in the printer by printing out the entire Hulk Hogan and Def Leppard fan websites.
Might as well face it, pooing is cool

inkyatari

I learned a little Applesoft basic, then SmartBASIC on the *ahem* Coleco ADAM.  I current own an Atari 8-bit, and have been interested in learning its basic.
I'm never wrong, just wildly inaccurate.

roadman

Quote from: bandit957 on December 14, 2018, 09:45:45 AM
Quote from: roadman on December 14, 2018, 09:08:46 AM
Freshman year of college (1980-1981), I took Basic programming (even though I was in the Transportation Management program, it was a required course).  We did all our work on terminals at a central computer center.  One day, when I went to get a printout of an assignment, there was a notice that the printer was down.  In the output bin, I noticed a printout that was many, many pages long, and a note from the computer center administrator for the person who sent the printout to see them.  Looking a the first page, I could see it was the same assignment I'd just completed, and it was obvious they had forgotten to close the infinite loop in their code.

I took a computer class at community college in 2006, and somebody wasted all the paper and ink in the printer by printing out the entire Hulk Hogan and Def Leppard fan websites.
I agree that's annoying, but it's far different than a basic (pardon the pun) programming error.
"And ninety-five is the route you were on.  It was not the speed limit sign."  - Jim Croce (from Speedball Tucker)

"My life has been a tapestry
Of years of roads and highway signs" (with apologies to Carole King and Tom Rush)

nexus73

FORTRAN and its simpler cousin BASIC were learned by me in 1971-72 at our high school.  How long ago was that in tech terms?  We had no monitors, just a printout terminal for the BASIC that connected via modem (what a miracle back then!) to a mainframe close to the PDX area.  Doing FORTRAN meant using an IBM punchcard machine to create the program, which was then sent off to the local community college where their mainframe did the job of seeing if what we students did was correct.  Alas, that mainframe would not handle subroutines.  No explanation ever came back as to the cause.

Being able to play around with a C-64 a decade and a half later seemed such an improvement!  Cassette drive, using a TV for a monitor, heck, there were even cartridges...LOL! 

My young years could be called the oxcart era of computing.  Seeing what it became was absolutely amazing although the side effects of addiction to devices are sad to see.  Back when the Atari 2600 was THE machine for videogaming, it was bad enough to see time get absorbed so completely by merely playing games.  That was light fare compared to the addictive qualities of smartphones and tablets, which are 100% pharmaceutical grade heroin in comparison. 

Where do we go from here and what will the unintended consequences look like? 

Rick
US 101 is THE backbone of the Pacific coast from Bandon OR to Willits CA.  Industry, tourism and local traffic would be gone or severely crippled without it being in functioning condition in BOTH states.

bandit957

Quote from: nexus73 on December 14, 2018, 12:05:18 PM
FORTRAN and its simpler cousin BASIC were learned by me in 1971-72 at our high school.

Our high schools here wouldn't even teach it yet in 1992!
Might as well face it, pooing is cool

Scott5114

Quote from: kurumi on December 14, 2018, 01:31:05 AM
"POP" is not what I thought it was. It seems like a way to fix yourself ("un**ck" is a better word, but we have all ages here) if your code slips out of a "subroutine" without returning. In languages without out-of-block GOTOs, I don't think there's a reason for POP.

I seem to remember, but am not confident because I've never used it, that push/pop in Perl performs the commands on an array rather than the stack.

Quote from: bandit957 on December 14, 2018, 12:08:41 PM
Quote from: nexus73 on December 14, 2018, 12:05:18 PM
FORTRAN and its simpler cousin BASIC were learned by me in 1971-72 at our high school.

Our high schools here wouldn't even teach it yet in 1992!

My high school was not teaching any kind of programming as late as 2007. I took the most advanced computer science class offered and the teacher admitted she didn't know any of the material because I was the only one who had taken that class, so she just kind of let me do whatever.

BASIC (especially Visual Basic) kind of sucks as a first language because it teaches you all kinds of bad habits. Nowadays I think they teach Java or Python, both of which are practical languages in their own right.
uncontrollable freak sardine salad chef

ErmineNotyours

In 1991, when I left college, I surreptitiously used the Apple II terminals of my previous community college to write a version of Tetris in Applesoft BASIC.  The Apple II was supposedly built around Breakout as a demonstration program, so I figured someone should write the even simpler Tetris for it in lo-res graphics.  It worked, and soon I got my own Macintosh, but got too distracted by its features to continue practicing programming.  Fast forward to a couple of years ago and I was planning to go to a coding academy.   To ramp myself up for programming again, I decided to initiate my own project.  I wanted to make a Columns program in Game Maker.  It wouldn't be the environment I would use in the school, but fundamental concepts would be the same.  I couldn't get it to work, which was frustrating.  I thought, "Things were so much easier when I was programming Tetris in BASIC."  I checked, and I found an Applesoft BASIC emulator.  I dug out my faded Tetris printout and started typing it in.  It was so hard to read that most of the debugging was finding the typos I made, but it worked.  Then I tackled Columns.  It had the same problems it had in Game Maker, in moving down multiple cleared cells.  I studied the Tetris program I made more than 25 years before, and focused down on the way that program cleared lines.  I got Columns to work, using my own logic, but I have no idea how I came up with it then and I can't explain it now.  I then made the change in the Game Maker version, and it still doesn't work.

Later in the school, I took Java Script, and made a version of Columns for that.  That version doesn't work either, and when I get around to it, I hope to debug it and start working on collaborative projects with others.  I'm also trying to polish my Columns program and submit it and Tetris to the emulator author to see if he will post them.  He used to have a "Fork me in GitHub" banner on the homepage, but it has disappeared, so I don't know if he is taking new submissions.

KeithE4Phx

Quote from: Scott5114 on December 14, 2018, 01:15:33 PM
BASIC (especially Visual Basic) kind of sucks as a first language because it teaches you all kinds of bad habits. Nowadays I think they teach Java or Python, both of which are practical languages in their own right.

Is anybody using Basic of any kind anymore, other than for maintaining old software?  The last time I used Visual Basic was about 20 years ago, and QuickBasic about 5 years before that.  Today, anyone who needs an interpreted language uses Python, Perl, Java, or Ruby.  They're modern and they're free, even on Windows.  BASIC in all its forms has gone the way of Forth and Pascal -- to the Museum of Antique Programming.  In other words:  It's dead, Jim.

Atari Basic was well done, and had some things that sped up execution, and had hooks into Atari's OS, but it was non-standard and only worked on the 8-bit machines (400, 800, 1200XL), not the ST series.  Everybody else used a version of Microsoft Basic (Applesoft, BasicA, GWBasic, Extended Color Basic, etc).  Even Atari offered a version of Microsoft Basic on disk, beginning in 1983 or so.  I used my Atari 800 regularly from the time I bought it in 1983 until I could afford a real PC in '88 -- I still have the thing, sitting in storage.  Atari Basic served me well, but Microsoft Basic was more important for my job.  I could write programs with it on my Atari and be able to use it on an XT at work with minimal porting.
"Oh, so you hate your job? Well, why didn't you say so? There's a support group for that. It's called "EVERYBODY!" They meet at the bar." -- Drew Carey

bandit957

Quote from: KeithE4Phx on December 15, 2018, 12:03:06 AM
Is anybody using Basic of any kind anymore, other than for maintaining old software?

I use FreeBASIC all the time. Other languages are so bloated and hard to learn, and FreeBASIC can do most of the things other languages can do.
Might as well face it, pooing is cool

OracleUsr

I use VBA from time to time but my language of preference is C#
Anti-center-tabbing, anti-sequential-numbering, anti-Clearview BGS FAN

Scott5114

#20
Quote from: KeithE4Phx on December 15, 2018, 12:03:06 AM
Is anybody using Basic of any kind anymore, other than for maintaining old software?  The last time I used Visual Basic was about 20 years ago, and QuickBasic about 5 years before that.

At work we have an enterprise database application (!!!) that is done in Visual Basic. I know because it throws very obvious VB runtime errors.

Quote from: bandit957 on December 15, 2018, 12:08:05 AM
Quote from: KeithE4Phx on December 15, 2018, 12:03:06 AM
Is anybody using Basic of any kind anymore, other than for maintaining old software?

I use FreeBASIC all the time. Other languages are so bloated and hard to learn, and FreeBASIC can do most of the things other languages can do.

Python is pretty simple, and only gets complex when you start importing extra modules into it.
uncontrollable freak sardine salad chef

english si

At uni, my lab group got bonus points for style on a big group project for using BASIC to write a program to make an output readable on a computer - the person marking got all nostalgic (it was 2006) and said he'd have used BASIC for that task as it was easy to do and he didn't much like the newer languages that we were taught (C and C++, the latter badly) as they weren't as elegant.

This was an electronics lab. If it was a lab for the programming module, with a Computer Scientist in charge, we'd have lost marks for being too clever and not showing what we were meant to have learnt.

Scott5114

I don't think C++ has ever been accused of being elegant (Bjarne Stroustrup, its creator, has admitted that the language has gotten so large and unwieldy that even he can't hold it all in his head anymore), but seeing BASIC called 'elegant' is rather alarming. Then again, it was 2006, so maybe the guy hadn't yet heard about things like Python or Lua.
uncontrollable freak sardine salad chef

english si

Quote from: Scott5114 on December 15, 2018, 05:15:35 AMseeing BASIC called 'elegant' is rather alarming.
Where was it called elegant? Just that it was considered more elegant than specific other languages for the task.

The person in our team given the task of writing the program bodged it together in the final 20-30 minutes (of a week-long lab project) and it worked. The other teams' equivalent was panic coding for an hour and most didn't finish, because none of us had been taught how do this - the very thing we would need to do as Electronic Engineers - in an elegant way.

Our C module in first year was about teaching us basic programming skills using the lowest-level language the CompSci professors would go (so that the lower-level languages we'd use in our actual electronics courses would be application of these skills), and our C++ module was openly (by the curriculum director of our electronic engineering course, who was teaching it) said to be irrelevant for anything other than teaching us an object-orientated language so we'd have a back-up job option as programmers (given we had specifically chosen electronic engineering, and specifically chosen that uni as it was the best for it and most likely to give us jobs, we were not happy with that, and it was a factor in his demotion a year later when the class graduated and the uni fell through the rankings for the course).
QuoteThen again, it was 2006, so maybe the guy hadn't yet heard about things like Python or Lua.
He was in his 50s, and an electronic engineering professor. He'd have heard of these languages, but rarely needed to do programming beyond bespoke tools/machine code, so - with his age - wouldn't have bothered to learn them. If he needed a program in one of these languages, he could get an underling to write it.

vdeane

Quote from: KeithE4Phx on December 15, 2018, 12:03:06 AM
Quote from: Scott5114 on December 14, 2018, 01:15:33 PM
BASIC (especially Visual Basic) kind of sucks as a first language because it teaches you all kinds of bad habits. Nowadays I think they teach Java or Python, both of which are practical languages in their own right.

Is anybody using Basic of any kind anymore, other than for maintaining old software?  The last time I used Visual Basic was about 20 years ago, and QuickBasic about 5 years before that.  Today, anyone who needs an interpreted language uses Python, Perl, Java, or Ruby.  They're modern and they're free, even on Windows.  BASIC in all its forms has gone the way of Forth and Pascal -- to the Museum of Antique Programming.  In other words:  It's dead, Jim.

Atari Basic was well done, and had some things that sped up execution, and had hooks into Atari's OS, but it was non-standard and only worked on the 8-bit machines (400, 800, 1200XL), not the ST series.  Everybody else used a version of Microsoft Basic (Applesoft, BasicA, GWBasic, Extended Color Basic, etc).  Even Atari offered a version of Microsoft Basic on disk, beginning in 1983 or so.  I used my Atari 800 regularly from the time I bought it in 1983 until I could afford a real PC in '88 -- I still have the thing, sitting in storage.  Atari Basic served me well, but Microsoft Basic was more important for my job.  I could write programs with it on my Atari and be able to use it on an XT at work with minimal porting.
Excel still uses VBA for macros.  A while back, we were designing "trackers" for many tasks, and a manager wanted the date/time added to the header so he would know which one of his printouts was the most recent.  Me, being lazy, wrote a macro to add a timestamp every time the file is saved.
Please note: All comments here represent my own personal opinion and do not reflect the official position of NYSDOT or its affiliates.



Opinions expressed here on belong solely to the poster and do not represent or reflect the opinions or beliefs of AARoads, its creators and/or associates.