Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Need some help with BASIC

Need some help with BASIC

Scheduled Pinned Locked Moved The Lounge
dotnethelpannouncement
24 Posts 13 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Tiny BASIC[^], to be exact. I am adapting a version of it for my old computer. The interesting part is that it internally used an interpreted language (IL) to implement the BASIC interpreter and only the IL interpreter was adapted for every system. Very interesting approach, considering this was used on 1970s homemade computers.

    "Dark the dark side is. Very dark..." - Yoda ---
    "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

    J G G L 4 Replies Last reply
    0
    • L Lost User

      Tiny BASIC[^], to be exact. I am adapting a version of it for my old computer. The interesting part is that it internally used an interpreted language (IL) to implement the BASIC interpreter and only the IL interpreter was adapted for every system. Very interesting approach, considering this was used on 1970s homemade computers.

      "Dark the dark side is. Very dark..." - Yoda ---
      "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

      J Offline
      J Offline
      Joan M
      wrote on last edited by
      #2

      Ok, so you should ask the proper question in the Q&A section...

      [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

      L 1 Reply Last reply
      0
      • J Joan M

        Ok, so you should ask the proper question in the Q&A section...

        [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Now, the replies I would like to see :) A question about taking apart and modifying an more than 30 years old interpreter on a machine and CPU most people here will never have heard of. I guess, I will have to do that all by myself :) I just matched the title of the topic further down, but found the fact of an intermediate language at work in such an old thing very interesting.

        "Dark the dark side is. Very dark..." - Yoda ---
        "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

        G 1 Reply Last reply
        0
        • L Lost User

          Now, the replies I would like to see :) A question about taking apart and modifying an more than 30 years old interpreter on a machine and CPU most people here will never have heard of. I guess, I will have to do that all by myself :) I just matched the title of the topic further down, but found the fact of an intermediate language at work in such an old thing very interesting.

          "Dark the dark side is. Very dark..." - Yoda ---
          "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

          G Offline
          G Offline
          GuyThiebaut
          wrote on last edited by
          #4

          Yes - I wonder if we should have a retrocomputing forum. I don't know how frequently this area comes up on CP as there are probably lots of retrocomputing sites out there.

          Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
          L 1 Reply Last reply
          0
          • G GuyThiebaut

            Yes - I wonder if we should have a retrocomputing forum. I don't know how frequently this area comes up on CP as there are probably lots of retrocomputing sites out there.

            Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            It would be fun. Just how many people are there who still hack around on some ancient hardware and use such a forum?

            "Dark the dark side is. Very dark..." - Yoda ---
            "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

            Mike HankeyM A P K 4 Replies Last reply
            0
            • L Lost User

              Tiny BASIC[^], to be exact. I am adapting a version of it for my old computer. The interesting part is that it internally used an interpreted language (IL) to implement the BASIC interpreter and only the IL interpreter was adapted for every system. Very interesting approach, considering this was used on 1970s homemade computers.

              "Dark the dark side is. Very dark..." - Yoda ---
              "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

              G Offline
              G Offline
              Gregory Gadow
              wrote on last edited by
              #6

              Crimeny, didn't you learn anything in school? :rolleyes: The only difference between interpreted and compiled languages is when the source is compiled. An interpreted language like BASIC or FORTRAN is stored as source code, which is loaded into memory, compiled into an intermediate language at run-time, then run by the computer's version of a CLR. A compiled language such as COBOL or C is compiled separately from run-time and the intermediate form is stored as a run-time image, which can be quickly loaded into memory and executed. Compiled languages have an added flexibility in that they can be linked to other compiled modules, allowing for custom libraries. In either case, the IL is run by the same interpreter regardless of how the language was translated: the old VAX-VMS that I used in college *cough* years ago cared only that the IL was in the proper syntax, not the language of the originating source. Remember, computer memory used to be extraordinarily tight. Source code had to be size optimized as much as possible in order to get the largest programs possible, and the software that ran the programs had to be agnostic as to the program's source. This design concept was implemented with the first computers because they, too, had tight memory: early computers were only 8 bit and were limited to a maximum of 64k to hold the operating system, drivers, graphics code plus your program. (Remember, many of these computers did not have hard drives so everything -- everything -- had to fit into memory at the same time.) Given the technology limitations, it would have been very surprising to find a language that did not use an IL.

              L G 2 Replies Last reply
              0
              • G Gregory Gadow

                Crimeny, didn't you learn anything in school? :rolleyes: The only difference between interpreted and compiled languages is when the source is compiled. An interpreted language like BASIC or FORTRAN is stored as source code, which is loaded into memory, compiled into an intermediate language at run-time, then run by the computer's version of a CLR. A compiled language such as COBOL or C is compiled separately from run-time and the intermediate form is stored as a run-time image, which can be quickly loaded into memory and executed. Compiled languages have an added flexibility in that they can be linked to other compiled modules, allowing for custom libraries. In either case, the IL is run by the same interpreter regardless of how the language was translated: the old VAX-VMS that I used in college *cough* years ago cared only that the IL was in the proper syntax, not the language of the originating source. Remember, computer memory used to be extraordinarily tight. Source code had to be size optimized as much as possible in order to get the largest programs possible, and the software that ran the programs had to be agnostic as to the program's source. This design concept was implemented with the first computers because they, too, had tight memory: early computers were only 8 bit and were limited to a maximum of 64k to hold the operating system, drivers, graphics code plus your program. (Remember, many of these computers did not have hard drives so everything -- everything -- had to fit into memory at the same time.) Given the technology limitations, it would have been very surprising to find a language that did not use an IL.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Oh, I know how tight memory and mass storage used to be. And expensive. Far more expensive than I could afford, because I was 12 years old when I soldered together that old computer and this Tiny BASIC was the first programming language I got hold of (except, of course, doing everything in machine code). But also other resources were not as unlimited as we would have liked to have had them. If you look carefully, you will discover that not the BASIC programs were translated to IL, but that the BASIC interpreter itself was implemented on a simpler interpreter. This was done to make it easier to port between different machines and CPUs, just the underlying simple interpreter had to be rewritten. But with the slow CPUs this also made running the BASIC programs a very sluggish affair. In all the years I never had to modify the interpreter and I was surprised to discover such an approach. Practically everything else on this old computer was hand written machine code in order to make most of the little memory and the weak CPU. Implementing an interpreter on top of another interpreter appears somewhat wasteful.

                "Dark the dark side is. Very dark..." - Yoda ---
                "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                1 Reply Last reply
                0
                • L Lost User

                  It would be fun. Just how many people are there who still hack around on some ancient hardware and use such a forum?

                  "Dark the dark side is. Very dark..." - Yoda ---
                  "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                  Mike HankeyM Offline
                  Mike HankeyM Offline
                  Mike Hankey
                  wrote on last edited by
                  #8

                  I'd like to see a VAX/VMS, Z80, 8080, 6502...

                  0x2B || ~0x2B

                  L O 2 Replies Last reply
                  0
                  • L Lost User

                    Tiny BASIC[^], to be exact. I am adapting a version of it for my old computer. The interesting part is that it internally used an interpreted language (IL) to implement the BASIC interpreter and only the IL interpreter was adapted for every system. Very interesting approach, considering this was used on 1970s homemade computers.

                    "Dark the dark side is. Very dark..." - Yoda ---
                    "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                    G Offline
                    G Offline
                    Gordon Brandly
                    wrote on last edited by
                    #9

                    Whew, you had me puzzled there for a bit. :) I wrote the 68000 version of Tiny BASIC (it's one of the links on that Wikipedia page), and I didn't remember anything about an IL interpreter. So, I just had to hop over to my web site and downloaded my source code (I'm not at my home computer) and do a quickie review. Luckily, my memory's not as bad as I feared. :-D I based my version on Li-Chen Wang's Palo Alto Tiny BASIC, which is a direct interpreter; no IL is involved. That Wikipedia page is a bit misleading in that respect -- I think I have some Wiki-editing to do. I do still occasionally get questions about my interpreter, though of course that's dropped off over the years. I haven't received any at all this year so far. On the other hand, I did get questions from a whole three people (I think) last year. I found Li-Chen Wang's source code reasonably easy to read, and the translation I did to 68000 assembler was fairly straightforward, as I remember. So, if you run into trouble with your conversion efforts and you're not using Palo Alto TB, I would definitely recommend using that as a base to start from. I might even remember enough about my interpreter to answer a few questions. Maybe. :) By the way, the closest I ever got to an 1802 was seeing a couple of COSMAC ELFs in operation at my local computer club. I sure did like their low power drain -- just never had a chance to design 'em into anything.

                    “The definition of embedded system has broadened over the geezerhood.”

                    L 1 Reply Last reply
                    0
                    • G Gordon Brandly

                      Whew, you had me puzzled there for a bit. :) I wrote the 68000 version of Tiny BASIC (it's one of the links on that Wikipedia page), and I didn't remember anything about an IL interpreter. So, I just had to hop over to my web site and downloaded my source code (I'm not at my home computer) and do a quickie review. Luckily, my memory's not as bad as I feared. :-D I based my version on Li-Chen Wang's Palo Alto Tiny BASIC, which is a direct interpreter; no IL is involved. That Wikipedia page is a bit misleading in that respect -- I think I have some Wiki-editing to do. I do still occasionally get questions about my interpreter, though of course that's dropped off over the years. I haven't received any at all this year so far. On the other hand, I did get questions from a whole three people (I think) last year. I found Li-Chen Wang's source code reasonably easy to read, and the translation I did to 68000 assembler was fairly straightforward, as I remember. So, if you run into trouble with your conversion efforts and you're not using Palo Alto TB, I would definitely recommend using that as a base to start from. I might even remember enough about my interpreter to answer a few questions. Maybe. :) By the way, the closest I ever got to an 1802 was seeing a couple of COSMAC ELFs in operation at my local computer club. I sure did like their low power drain -- just never had a chance to design 'em into anything.

                      “The definition of embedded system has broadened over the geezerhood.”

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      My old computer is a Netronics Elf II and I keep it in its original state, so that there used to be little reason to modify any of the old software. But I also wanted to build a more modern Elf, just for the fun of it. I heard of an idea to synchronize up to eight CDP1802s (or CDP1804s) and have been trying to make something out of it ever since. This 'Parallelf' will certainly not be able to comply to even those few conventions the old Elf used to have, so we must adapt it. I now have found a complete annotated listing of Tiny BASIC for the CDP1802 and it turned out to be like described in the Wikipedia article. The author already anticipated the need to relocate the interpreter to other memory areas and the part in IL code is documented well enough to expand the language as you like. Who would have thought that someone would ever try to port it to a machine with up to eight CPUs and up to eight mb memory :)

                      "Dark the dark side is. Very dark..." - Yoda ---
                      "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                      1 Reply Last reply
                      0
                      • Mike HankeyM Mike Hankey

                        I'd like to see a VAX/VMS, Z80, 8080, 6502...

                        0x2B || ~0x2B

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        Oh no! The enemies! Back then the religious wars were about CPUs :)

                        "Dark the dark side is. Very dark..." - Yoda ---
                        "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                        Mike HankeyM 1 Reply Last reply
                        0
                        • L Lost User

                          Oh no! The enemies! Back then the religious wars were about CPUs :)

                          "Dark the dark side is. Very dark..." - Yoda ---
                          "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                          Mike HankeyM Offline
                          Mike HankeyM Offline
                          Mike Hankey
                          wrote on last edited by
                          #12

                          :laugh: :laugh: Yeah they each had there merits. I spent a lot of years on VAX/VMS and see that there are a lot of people that still have old MicroVaxes. I'd love to have one but have no idea what I would do with it?

                          0x2B || ~0x2B

                          1 Reply Last reply
                          0
                          • Mike HankeyM Mike Hankey

                            I'd like to see a VAX/VMS, Z80, 8080, 6502...

                            0x2B || ~0x2B

                            O Offline
                            O Offline
                            Oakman
                            wrote on last edited by
                            #13

                            Mike Hankey wrote:

                            I'd like to see a VAX/VMS, Z80, 8080, 6502...

                            Don't forget Abacus 2769

                            The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.

                            Mike HankeyM 1 Reply Last reply
                            0
                            • O Oakman

                              Mike Hankey wrote:

                              I'd like to see a VAX/VMS, Z80, 8080, 6502...

                              Don't forget Abacus 2769

                              The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.

                              Mike HankeyM Offline
                              Mike HankeyM Offline
                              Mike Hankey
                              wrote on last edited by
                              #14

                              :laugh: :laugh: Couldn't list em all, that was more for the Asian market anyway wasn't it? :)

                              0x2B || ~0x2B

                              1 Reply Last reply
                              0
                              • G Gregory Gadow

                                Crimeny, didn't you learn anything in school? :rolleyes: The only difference between interpreted and compiled languages is when the source is compiled. An interpreted language like BASIC or FORTRAN is stored as source code, which is loaded into memory, compiled into an intermediate language at run-time, then run by the computer's version of a CLR. A compiled language such as COBOL or C is compiled separately from run-time and the intermediate form is stored as a run-time image, which can be quickly loaded into memory and executed. Compiled languages have an added flexibility in that they can be linked to other compiled modules, allowing for custom libraries. In either case, the IL is run by the same interpreter regardless of how the language was translated: the old VAX-VMS that I used in college *cough* years ago cared only that the IL was in the proper syntax, not the language of the originating source. Remember, computer memory used to be extraordinarily tight. Source code had to be size optimized as much as possible in order to get the largest programs possible, and the software that ran the programs had to be agnostic as to the program's source. This design concept was implemented with the first computers because they, too, had tight memory: early computers were only 8 bit and were limited to a maximum of 64k to hold the operating system, drivers, graphics code plus your program. (Remember, many of these computers did not have hard drives so everything -- everything -- had to fit into memory at the same time.) Given the technology limitations, it would have been very surprising to find a language that did not use an IL.

                                G Offline
                                G Offline
                                greldak
                                wrote on last edited by
                                #15

                                Hmm what version of Fortran was supplied with an interprer? - every version I've come across has been compiled. Compiling to intermediate code which is then interpreted was a lot more commonplace in the 70s and 80s. Acornsoft used this on their BCPL compiler for the BBC Micro.

                                A 1 Reply Last reply
                                0
                                • L Lost User

                                  It would be fun. Just how many people are there who still hack around on some ancient hardware and use such a forum?

                                  "Dark the dark side is. Very dark..." - Yoda ---
                                  "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                                  A Offline
                                  A Offline
                                  Alan Burkhart
                                  wrote on last edited by
                                  #16

                                  CDP1802 wrote:

                                  It would be fun. Just how many people are there who still hack around on some ancient hardware and use such a forum?

                                  Check this site. I still have my old Model 100 tucked away as a keepsake. Click[^]

                                  XAlan Burkhart

                                  L 1 Reply Last reply
                                  0
                                  • G greldak

                                    Hmm what version of Fortran was supplied with an interprer? - every version I've come across has been compiled. Compiling to intermediate code which is then interpreted was a lot more commonplace in the 70s and 80s. Acornsoft used this on their BCPL compiler for the BBC Micro.

                                    A Offline
                                    A Offline
                                    Andrew Leeder
                                    wrote on last edited by
                                    #17

                                    I've still got a pair of 8 channel punched paper tapes for a 2 pass BCPL compiler . BCPL -> ICode and a code generator for ICode -> OCode. Ocode was a published interpretable language and all you needed to do was write an interpreter for it. Then write a new code generator for ICode -> target machine code (in BCPL), run the compiler through it self, and BCPL is then ported to the new environment. Sadly I no longer have a paper tape reader. ~A

                                    1 Reply Last reply
                                    0
                                    • L Lost User

                                      It would be fun. Just how many people are there who still hack around on some ancient hardware and use such a forum?

                                      "Dark the dark side is. Very dark..." - Yoda ---
                                      "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                                      P Offline
                                      P Offline
                                      patbob
                                      wrote on last edited by
                                      #18

                                      CDP1802 wrote:

                                      Just how many people are there who still hack around on some ancient hardware and use such a forum

                                      I can still code on such ancient hardware, but I prefer not to :) I could probably even still do some hardware hacking on those older systems, having grown up with them.. but these days I just fire up the Amiga 1000 every few years for fun and call it good :) Those older systems are just too much trouble to bother with. I've always wanted to add a USB interface to one of the 4K core (as in ferrite core) modules I have from the CDC-6500, but aside from creating the world's lowest capacity, largest volume, heaviest and most cumbersome non-volatile USB drive, there isn't much point :) Besides, I don't even know if they work.. they were removed because they failed after the computing center had a power failure, after all. Yeah, there's some of us old timers still around here. The sorts that still have the family Texas Instruments SR-10 lying around in a drawer someplace.. and know it still works too.

                                      patbob

                                      L 1 Reply Last reply
                                      0
                                      • L Lost User

                                        Tiny BASIC[^], to be exact. I am adapting a version of it for my old computer. The interesting part is that it internally used an interpreted language (IL) to implement the BASIC interpreter and only the IL interpreter was adapted for every system. Very interesting approach, considering this was used on 1970s homemade computers.

                                        "Dark the dark side is. Very dark..." - Yoda ---
                                        "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                                        L Offline
                                        L Offline
                                        Lazarus666
                                        wrote on last edited by
                                        #19

                                        When I took my first C programming class, a few of the homework problems were of things that would probably be useful, if I ever got around to writing a BASIC from scratch. Stuff like - take an algebraic expression and convert it to a Polish expression. Evaulate a Polish expression on a stack. I don't remember "manage a symbol table" being explicitly covered, but the general idea holds from the problem of "search a list" such as an array of records for a given key string, usually for some simple application like a mailing list problem. In simpler terms you might search a symbol table for the variable "A" in order to find the value 1.23456 which you then feed into your algebraic converter, which goes to the Polish stack evaluator, and there you have a big part of your BASIC interpreter or compiler even. Well, that's where I would start. Write the BASIC interpreter in C, and then find a way to cross compile it to your target platrom. Should be pretty easy. On the other hand, it might be a bit of work to get a decent floating point package up and running for one of those old machines, that is to say, if you decide to code all of that from scratch. But then again, if you already have an old BASIC that you are tearing apart, you can probably adapt some of those routines. A few people have done some interesting things like building (in the present day), VGA cards and IDE controllers and such for such ancient machines as the Apple II. Now that would get really interesting, that is to say, if someone were to put an accelerated graphics card together, that supports OpenGL (lets say), that you could pop into an old II+ or even an S-100 system. Those old II+'s and IIe's etc. were after all great platforms for kids to learn on, given that anyone could pretty much sit down with the manual or a crib sheet and begin programming in an afternoon. As for myself, back in the day, I had a pretty easy time learning Pascal and Fortran even (punch cards on an IBM System 3 Mainframe), but when I got to C, I found the learning curve with header files, make files, linker options, dll hell, compiler options, etc, very steep - and the fact was that I didn't even bother until 32 bit came along and I wasn't being coerced into thinking about segment registers, near and far pointers, etc. Have fun. P.S. I have an old Altair 8800B that I'll probably fix up and get running some day.

                                        1 Reply Last reply
                                        0
                                        • L Lost User

                                          It would be fun. Just how many people are there who still hack around on some ancient hardware and use such a forum?

                                          "Dark the dark side is. Very dark..." - Yoda ---
                                          "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi

                                          K Offline
                                          K Offline
                                          kmoorevs
                                          wrote on last edited by
                                          #20

                                          I just might have to dust off the TI-994a and find my old TI Extended Basic cartridge! I used to write programs to solve math and physics problems in high school on it.

                                          "Go forth into the source" - Neal Morse

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups