6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 12:44 pm

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Thu Jul 30, 2020 11:45 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
BigEd wrote:
It's an odd choice, to use an EhBasic forum to declare that Basic is a poor language in one or another respect. It's off topic in a very strong way.

Well, if discussing infelicities of "standard" BASIC is off-topic, complain about the post to which I was replying. I was merely indicating why people might walk out when someone suggested BASIC could be made better by not needing line numbers, which is also clearly off topic for this entire forum, according to your definition.

As for the other arguments, they range from just as off-topic for this thread to irrelevant. (Yes, disorganized programmers can produce bad code in any language. That doesn't mean that having a language designed to make good programming easy is unimportant. It mystifies me how someone would use that argument to justify bad language features.) So I agree that this thread is not the place to pursue them. The only thing I'll suggest here is that if you can't produce a list of serious problems for any language you know reasonably well, you're not a good programmer. If you really don't know where BASIC stands as a language, one good place to start your understanding would be to go and write something like a unit test framework for BASIC and compare that to the ones you could write even for other microcomputer languages of the day, such as Pascal, Logo or LISP.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 30, 2020 5:26 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8503
Location: Midwestern USA
cjs wrote:
BigEd wrote:
It's an odd choice, to use an EhBasic forum to declare that Basic is a poor language in one or another respect. It's off topic in a very strong way.

Well, if discussing infelicities of "standard" BASIC is off-topic, complain about the post to which I was replying. I was merely indicating why people might walk out when someone suggested BASIC could be made better by not needing line numbers, which is also clearly off topic for this entire forum, according to your definition.

What Ed was apparently saying is the EhBASIC forum is about a specific implementation of BASIC, not the language itself. Whether or not BASIC is a "poor language" is really a somewhat-unrelated topic, as well as a matter of opinion.

Quote:
As for the other arguments, they range from just as off-topic for this thread to irrelevant. (Yes, disorganized programmers can produce bad code in any language. That doesn't mean that having a language designed to make good programming easy is unimportant. It mystifies me how someone would use that argument to justify bad language features.)

I think you are manufacturing a controversy where one doesn't exist. No one was justifying bad language features—indeed, every known computer programming language has them, some worse than others. What was being said is incompetent programmers are the problem in many cases, not the language itself.

Quote:
The only thing I'll suggest here is that if you can't produce a list of serious problems for any language you know reasonably well, you're not a good programmer.

A programmer's valuable time is better spent writing good code than grousing about language deficiencies. If you don't like, say, BASIC, don't use it. There are many other languages available about which one can complain. I personally find C++ to be a cumbersome hack—a design-by-committee language, but don't sit around beefing about it.

Quote:
If you really don't know where BASIC stands as a language, one good place to start your understanding would be to go and write something like a unit test framework for BASIC and compare that to the ones you could write even for other microcomputer languages of the day, such as Pascal, Logo or LISP.

You are pinning your argument on a microcomputer implementation of BASIC. I agree that such an implementation is lacking compared to some other languages. However, BASIC was originally designed for use on timesharing systems, an application that was very widespread during the heyday of proprietary minicomputers, such as MAI Basic 4, Point Four, NCR, etc. (plus, timesharing BASIC was ported to UNIX and Linux). Despite perceived limitations of BASIC (e.g., no structure, which is mostly a limitation of microcomputer implementations), hundreds of thousands of business applications have been written using Business BASIC (as it is called, to contrast it with the less capable microcomputer implementations). Contrary to what you may be thinking, Business BASIC remains in widespread use, especially in the financial sector. I, in fact, still do some development in it.

Any interpreted language will run into limitations when implemented on any 6502-based machine. Incorporating the full scope of a modern timesharing BASIC would overwhelm the machine's resources, so the programmer has to be realistic about what can or can't be provided. The late Lee Davison, the author of EhBASIC, was confronted with that reality and, I think, did an admirable job of dealing with it. It could be a more powerful BASIC could be implemented on a 65C816 system with extended memory, but no one to date that I know of has undertaken such an endeavor.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Wed Sep 02, 2020 1:32 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 30, 2020 6:58 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
I looked into EhBASIC years ago (although admittedly not very seriously) and it did appear that Lee did a really good job considering the small amount of memory the code had to fit into.  The BASIC I used the most was on my HP-71B hand-held computer which way, way better, in ways most BASIC users could never imagine; but with the LEX (Language EXtension) files, it amounts to over 170KB.  Is EhBASIC simple enough for the serious user to add capability to it (like the HP-71's LEX files), or would that require re-writing most of it?  And a question that's relevant to the topic title is this:  If the expansion can be done without a re-write, what are the licensing implications?

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 30, 2020 7:21 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
(I've started a thread on the subject of language extensions. It would be truly excellent, IMHO, if new ideas could be introduced as new threads - it makes for a much better experience reading and searching the forum.)


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 30, 2020 10:05 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8503
Location: Midwestern USA
GARTHWILSON wrote:
If the expansion can be done without a re-write, what are the licensing implications?

Ultimately, it is Dartmouth College who owns the intellectual property rights to BASIC. Microsoft's rights are limited to their implementation, of which EhBASIC appears to be a derivative. So there is a bit of a problem in that regard if the desire is to extend EhBASIC.

I think the only way to produce a truly unencumbered BASIC interpreter would be with "clean room" code.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 01, 2023 5:41 am 
Offline

Joined: Wed Mar 02, 2016 12:00 pm
Posts: 343
EhBasic is said to be derived from MS Basic, Dartmouth Basic and so on... but does anyone have a reference to what original source codes were used and were they can be found?

I can see that GW Basic has been open sourced in its 8088 form, but I haven't seen any 6502 source published by them.


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 01, 2023 9:29 am 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 336
kakemoms wrote:
EhBasic is said to be derived from MS Basic, Dartmouth Basic and so on... but does anyone have a reference to what original source codes were used and were they can be found?


Looking at the EhBASIC source, it seems pretty clear that it was derived from a disassembly, and the code looks similar enough to what I know of Commodore 64's BASIC that I'd call it Microsoft.

Most of the labels are of the form LAB_<address>. The addresses increase according to the amount of code between them most of the time, with exceptions in the places that have been modified. You don't write source code like that unless you've already got the binary.

Here's EhBASIC's error-printing code, with "out of memory" immediately before the general routine:
Code:
LAB_OMER
      LDX   #$0C              ; error code $0C ("Out of memory" error)

; do error #X, then warm start

LAB_XERR
      JSR   LAB_CRLF          ; print CR/LF

      LDA   LAB_BAER,X        ; get error message pointer low byte
      LDY   LAB_BAER+1,X      ; get error message pointer high byte
      JSR   LAB_18C3          ; print null terminated string from memory

      JSR   LAB_1491          ; flush stack and clear continue flag
      LDA   #<LAB_EMSG        ; point to " Error" low addr
      LDY   #>LAB_EMSG        ; point to " Error" high addr
LAB_1269
      JSR   LAB_18C3          ; print null terminated string from memory
      LDY   Clineh            ; get current line high byte
      INY                     ; increment it
      BEQ   LAB_1274          ; go do warm start (was immediate mode)

                              ; else print line number
      JSR   LAB_2953          ; print " in line [LINE #]"


and here's Microsoft's original
Code:
OMERR:   LDXI   ERROM
ERROR:
IFN   REALIO,<
   LSR   CNTWFL>      ;FORCE OUTPUT.
IFN   EXTIO,<
   LDA   CHANNL      ;CLOSE NON-TERMINAL CHANNEL.
   BEQ   ERRCRD
   JSR   CQCCHN      ;CLOSE IT.
   LDAI   0
   STA   CHANNL>
ERRCRD: JSR   CRDO      ;OUTPUT CRLF.
   JSR   OUTQST      ;PRINT A QUESTION MARK
IFE LNGERR,<
   LDA   ERRTAB,X,   ;GET FIRST CHR OF ERR MSG.
   JSR   OUTDO      ;OUTPUT IT.
   LDA   ERRTAB+1,X,   ;GET SECOND CHR.
   JSR   OUTDO>      ;OUTPUT IT.
IFN LNGERR,<
GETERR: LDA   ERRTAB,X
   PHA
   ANDI   127      ;GET RID OF HIGH BIT.
   JSR   OUTDO      ;OUTPUT IT.
   INX
   PLA         ;LAST CHAR OF MESSAGE?
   BPL   GETERR>      ;NO. GO GET NEXT AND OUTPUT IT.
TYPERR: JSR   STKINI      ;RESET THE STACK AND FLAGS.
   LDWDI   ERR      ;GET PNTR TO " ERROR".
ERRFIN: JSR   STROUT      ;OUTPUT IT.
   LDY   CURLIN+1
   INY         ;WAS NUMBER 64000?
   BEQ   READY      ;YES, DON'T TYPE LINE NUMBER.
   JSR   INPRT


In both cases, they continue on into the code that prints READY and waits for input. They're doing the same things, in the same order, with the same instructions in many cases. But there are differences: EhBASIC uses a string-printing routine to print the error message, while Microsoft loops over the characters. The test for whether or not to print "in <line number>" is identical.

Identifying which version of Microsoft BASIC was used as the base might be possible - the addresses in the labels give very strong clues (the difference between two tells you how many bytes of code were originally between them) - but would require considerably more work than I'm willing to put in. My guess (based purely on the addresses being so low in memory) would be one of the Apple II versions. https://www.pagetable.com/?p=46 is a good place to start exploring.


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 01, 2023 6:41 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 983
Location: Potsdam, DE
Of which: has anyone a link to a manual for those early Microsoft basics? I keep ending up with mbasic or basic-80 or even (horror!) visual basic.

Neil


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 02, 2023 5:53 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
The first MS BASIC I used was TRS-80 Model I Level II. A not-so-great scan of the same reference guide I remember is here.

The second MS BASIC I used was Applesoft BASIC on my ][+. There's a pretty good PDF of the manual I remember here.

While poking around, I stumbled upon an in-browser emulation of "MS BASIC 2.00.00" running on what appears to be a first-generation Macintosh. The mouse doesn't track exactly right on my PC, but the functionality seems to be there, at first glance anyway, and the user interface is clumsy by today's standards but still intuitive.

Attachment:
msbasic2.00.00.PNG
msbasic2.00.00.PNG [ 8.62 KiB | Viewed 8265 times ]


(... looks like it offers 64-bit MS floats ... nice!)

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Last edited by barrym95838 on Thu Feb 02, 2023 9:29 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 02, 2023 6:27 am 
Offline

Joined: Wed Mar 02, 2016 12:00 pm
Posts: 343
John West wrote:
Identifying which version of Microsoft BASIC was used as the base might be possible - the addresses in the labels give very strong clues (the difference between two tells you how many bytes of code were originally between them) - but would require considerably more work than I'm willing to put in. My guess (based purely on the addresses being so low in memory) would be one of the Apple II versions. https://www.pagetable.com/?p=46 is a good place to start exploring.


Well, it may not be possible to identify which basic, at which point it would be uncertain wether its Commodore Basic or some other version from MS. Commodore Basic is currently owned by Cloanto which CAN issue a license (look at the Commander X16 project). Unfortunately, the only OS version of MS Basic is GW Basic for 8088, and they still only allow it for hobbyist and non-commercial...

Its amazing how well-protected datacode is. I've had several patents over the years... max 20 year protection at a huge cost.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 02, 2023 8:40 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 983
Location: Potsdam, DE
Thanks Mike... it had simply not occurred to me to search for equipment manuals rather than just 'basic'. A search for 'microtan 65 basic manual' dropped me straight here: https://www.geoff.org.uk/microtan/basic_manual.htm which is exactly the system I used to use back in the day.

And conveniently, one which I believe can be generated from the source at Pagetable: https://www.pagetable.com/?p=774

Neil

(hurriedly edited upon being advised of Mr Barry's first name... Sorry!)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: