Breaking News
Comments
Newest First | Oldest First | Threaded View
<<   <   Page 3 / 8   >   >>
David Ashton
User Rank
Blogger
Re: Working!
David Ashton   1/14/2014 2:47:39 PM
NO RATINGS
@FlyByPC...I have heard about FreeBASIC and might give it a try sometime.   I used GWBasic here as it was from about the right era for the program.  FreeBASIC says on its website that it is very compatible with QuickBASIC which I worked with a bit.   I'll put FreeBASIC on my ever-growing list of things to do.  I need to win the lotto and retire so I can get time for all the interesting stuff... :-)

FlyByPC
User Rank
Rookie
Re: Working!
FlyByPC   1/14/2014 2:30:50 PM
NO RATINGS
It's nice that GWBASIC is still available, but you ought to check out FreeBASIC. It can be set to accept old-school GWBASIC syntax, but has a lot more modern capabilities, as well -- arrays of up to 2GB or so, high-resolution graphics in true color, user-defined types, and structured programming (functions, subroutines, etc.) 

I use FreeBASIC with FBIDE: http://fbide.freebasic.net/ 

 

Stargzer
User Rank
Manager
Re: PROGRAM
Stargzer   1/13/2014 2:57:32 PM
NO RATINGS

@betajet:  "Thank you for contributing this week's dose of nostalgia."

You're welcome!  When I'm not reading SciFi I'm reading history.

@betajet:  "A Pascal semicolon is a statement separator.  You put it between statements.  Thou shalt never place a semicolon in front of "else".  In contrast, a C semicolon is a statement terminator."

Coming from a PL/I background I probably thought of it as a terminator, thinking of "else" as a separate statement (line).   My brief encounter with Pascal was 30-some-odd years ago. 

I try to write code so I can follow it a later time (somewhat self-documenting), using indenting.  I would write: if (x >= 0) y = x; else y = -x; in two lines as:

if (x >= 0) y = x;
else y = -x;" 

I can see how if you read the Pascal statement from left-to-right it's almost a complete sentence, not broken down into separate steps like above:

if x >= 0 then y:= x else y:= -x

but, "OTOH, in C you can write "y = x >= 0? x: -x;" is great for compact syntax and saving space back when disk space was dear.  But hey, it was written by system programmers looking for something between assembler and a high level language.  I hope to learn it and play with it some day (I like the bit where you can stuff in some assembler or machine code in-line; a hacker's dream (from the original def of hacker). 

 

Max The Magnificent
User Rank
Blogger
Re: Carriage-return Linefeed
Max The Magnificent   1/13/2014 2:49:59 PM
NO RATINGS
@Stargzer: If it's not returning, I'm not sure what the problem is.

If you type characters you can see them on the paper (very faint because the ribbon is 30 years old -- I iave to pick up a new one when I get round to it) -- but when you hit the return key, the carriage returrns but there's no line feed, which there shoudl be when you are manually typing on the keyboard. 

betajet
User Rank
CEO
a? b: c
betajet   1/13/2014 1:59:09 PM
NO RATINGS
The Betajet wrote: in C you can write "y = x >= 0? x: -x;" which much nicer than Pascal.

Flurmy wrote: Yuk! That's exactly what I try to avoid like hell.  As you said, chacun a son goût, but I think I'm in good company.  MISRA and alike strictly forbid mumbo jumbo like this.

Well, I learned LISP before I learned C.  LISP's fundamental conditional operator is COND, which is an extended version of "a? b: c".  LISP is a great language for reasoning about programs, and proving that they work.  (For best results, use equivalent mathematical notations rather than lots of parentheses.)  "a? b: c" is also a great notation for writing multiplexers in Verilog.

I'm puzzled that some people don't like "a? b: c", but I accept that some people would rather write Basic or Fortran :-)

Flurmy
User Rank
Rookie
Scrap paper
Flurmy   1/13/2014 2:50:51 AM
NO RATINGS
betajet: in C you can write "y = x >= 0? x: -x;" which much nicer than Pascal.

Yuk! That's exactly what I try to avoid like hell.
As you said, chacun a son goût, but I think I'm in good company.
MISRA and alike strictly forbid mumbo jumbo like this.

If their program got into a loop (but not a hard Sys) and printed one character and a page feed continuously, well, there would be a pile of scrap paper.

I worked on a CDC6600 via punched cards and batch processing.
When, hours later, I went to pick up the result of my program I met a friend who told me: "Ha, ha, ha! Someone printed a pile of paper so high full of numbers! Ha, ha, ha!"
Surprise: someone was... me!
I mistakenly swapped the job control cards, putting the "load and run" before the "link" one. obviously the "program" crashed violating the memory fence and I got the dump of the whole memory in octal (each location was 60 bits, i.e. 20 octal digits)...

herbissimus
User Rank
Rookie
Re: scanner?
herbissimus   1/10/2014 8:56:30 PM
NO RATINGS
one only needs a single led and the array of photodetectors, just spread the light into a plane. the rows of holes passing by do the rest.

sorry, this was already suggested earlier. p.s. i have manuals and tty which has been resting unmaintained since 1977.

betajet
User Rank
CEO
Re: PROGRAM
betajet   1/10/2014 7:55:20 PM
NO RATINGS
Thank you for contributing this week's dose of nostalgia.

Dr. Wirth intended Pascal as a language for teaching good programming practices.  I still think it's a terrific first programming language.  OTOH, Modula-2 was intended as a serious programming language.

Teaching a programming language isn't easy, particularly if you haven't mastered it.  Not understanding semicolons in Pascal is pretty lame.  A Pascal semicolon is a statement separator.  You put it between statements.  Thou shalt never place a semicolon in front of "else".  In contrast, a C semicolon is a statement terminator.  It also converts an expression like "x = 3" into a statement like "x = 3;"  Go ahead an put a semicolon in front of "else".  Go ahead and write "if (x >= 0) y = x; else y = -x;"  So what it it's ever so much uglier than "if x >= 0 then y:= x else y:= -x".  OTOH, in C you can write "y = x >= 0? x: -x;" which much nicer than Pascal.

While FORTH is something of a write-only language, it does make a nice intermediate language and is dirt simple.  But APL is the epitome of the write-only language.

Stargzer
User Rank
Manager
Carriage-return Linefeed
Stargzer   1/10/2014 7:38:50 PM
NO RATINGS

@MAX:  "Although the paper tape reader appears to work fine, the carriage-return / line-feed needs some attention."

If it's a problem when the print head returns to the left, there is an adjustment.

Under the lid, on the left side, where the print head returns, is a cylinder call the dash-pot.  The print head has a sort of a piston with a rubber ring (or something) that is supposed to go into the cylnder.  A lever on the outside head of the cylinder can be moved over a hole in the end of the cylinder to set the amount of air allowed to escape and fine-tune the cushioning effect.  As I recall there are a couple of screws on top to loosen and adjust the cylinder.  You'll get a nice little "pop" sound when it's adjusted correctly.  I had to do that on an ASR-33 when I had a part-time job teaching programming to 4th, 5th, and 6th graders back in 1973-1974.

If it's not returning, I'm not sure what the problem is.  Some have an autoreturn set so the print head automatically returns after 72 or 80 characters.  Sometimes the autoreturn is not set and it just keeps piling up characters in the last positon.

But, if it's doing a line feed an printing a character in the middle of the line, you need to send two chariage returns and a line feed to the print.  This was the standard -- it's a matter of timing.  I've also seen specs for other printers that call for varying numbers of carriage returns or nulls, depending on the bit rate and how far over to the right the print head is (it takes longer to return from 132 characters than from 80, and no printer in the old days could print 960 chars/sec (9600 bps - 10 bits/char).

There once was a Star Trek program that would print out S T A R   T R   K in the middle of the line, space out to 80 characters, and then print a carriage return with no line feed followed by the E, which would print out between the R and the K. 

The listing is somewhere in the basement ...

Stargzer
User Rank
Manager
Re: PROGRAM
Stargzer   1/10/2014 7:16:18 PM
NO RATINGS

betajet:"Pascal ..."

I was in a Pascal class for a day or two before I was pulled out to troubleshoot a hardware problem with the new equipment.  I do remember having trouble remembering when a semicolon was required and when it was not.  The instructor said there was sometimes a certain feel to when it was needed.  Not my kind of language ....  Another time he pointed out that you could stomp on the first byte of a string to change it's length, which was quicker than using the built-it function.  When I ask why bother to use the function, he said anyone on his staff would be fired for doing that (I guess because it was not as obvious as using the function).  Finally, when I asked why the printer diagnostic was so slow printing a sliding alpha test, he said the programmer was recreating the line each time, incrementing the initial character.  When I asked why he didn't just create the full set of characters twice and step across it with a substring function, he replied it was written by a trainee.  It thought to myself, "Why is Uncle Sucker paying to train your people?"

Pascal was "Wirth" so much he had to write Modula-2.  ;- ) 

betajet:  "I blame the Model 026 keypunch, which influenced Fortran.  The creators of Fortran were mathematicians, so I'm sure they would have loved to use the proper mathematical symbols instead of .GE. and .LT. for ">=" and "<".  I'm sure glad we've left those silly notations behind!  [What?  You say they're still around in HTML?  'Strewth!]"

There were only so many keys on the keyboard of a teletype or keypunch, and only so many characters in the character set (7 bits plus pairity).  Even IBM mainframe printers didn't always have a full character set.  Our college used Assembler, RPG, Fortran and PL/1.  PL/1 used a semi-colon to end a statement, but our print train didn' t have the character.  The IBM PL/1 compiler had an option which we set as default so we could terminate lines with a comma and a period (",."), as if the semicolon fell over on its side. 

Knowing how old FORTRAN is, it may be that they didn't have the ">" and "<" symbols available on printers.  The IBM 029 Keypunch did have the > and < characters on the keyboard.

By contrast, IBM's EBCDIC code had a cent sign ("¢") which their mainframe terminals had but that teletypes and ASCII-based equipment didn't have (we Americans are so Jingoistic!).

:-Þ

On the PC one can use CHARMAP.EXE to find it or type Alt-0162 (using the numbers on the Numeric Keypad) to enter it (Like this:  ¢).

 

And if you're really a gutton for mathematical notation, there's always APL

I think glutton is too mild of a term.  Masochist comes to mind ... but if you want arcane notation, try FORTH (which I did play with on my TI-99).

<<   <   Page 3 / 8   >   >>


Flash Poll
EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
The Engineering Life - Around the Web
Dwight Bues, Systems Engineer

The Case of the Nonexistent Component
Dwight Bues, Systems Engineer
Post a comment
Every engineer has likely had the unfortunate experience of verifying a part's availability with a vendor, only to have the part ultimately wind up either not getting produced or ...

Engineer's Bookshelf
Caleb Kraft

The Martian: A Delightful Exploration of Math, Mars & Feces
Caleb Kraft
6 comments
To say that Andy Weir's The Martian is an exploration of math, Mars, and feces is a slight simplification. I doubt that the author would have any complaints, though.

Design Contests & Competitions
Caleb Kraft

Join The Balancing Act With April's Caption Contest
Caleb Kraft
58 comments
Sometimes it can feel like you're really performing in the big tent when presenting your hardware. This month's caption contest exemplifies this wonderfully.

Engineering Investigations
Caleb Kraft

Frankenstein's Fix: The Winners Announced!
Caleb Kraft
8 comments
The Frankenstein's Fix contest for the Tektronix Scope has finally officially come to an end. We had an incredibly amusing live chat earlier today to announce the winners. However, we ...

Top Comments of the Week
Like Us on Facebook
EE Times on Twitter
EE Times Twitter Feed

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)