Optimizing Line Count in TI BASIC: Type-in Fun with the TI-99/4A

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024

Комментарии • 230

  • @AndyHewco
    @AndyHewco 2 года назад +66

    The error on the GOTO line was because you'd typed GOT0 with a zero instead of an O. It's so subtle but the number 0 has rounded corners and the letter O is square. I can appreciate a zero with a cross through it on other computers all the more, but I do remember thinking the font on the TI-99 looking pretty cool.
    Another great video, I love old computer books and especially ones with type-in's. Much of my early days on a Vic 20 was typing in from books and magazines to try to learn as much as I could and hoping to find something special. It is a shame that a book like this would have BASIC code that is so confusing. As a beginner you would look at that and wonder or think it is the right way to do it. The reality is the author was probably just learning too and making these kind of mistakes. Just pinoneering days I guess.

    • @8_Bit
      @8_Bit  2 года назад +24

      Aha, you're right about the zero!! It's really obvious now that I rewatch. Bizarre that I'd do that.
      Yes about the author probably still learning, and the other thing is having 101 programs in a single book, many of them repeatedly ported between systems, with probably tight deadlines and/or low pay, is just moving on to the next program as soon as one works with little regard for whether it's actually good code.

    • @AndyHewco
      @AndyHewco 2 года назад +6

      I can imagine they'd be pressured to publish as soon as possible. That one Christmas I had my computer, my best mate had a TI-99/4a. I remember it had some great games but I don't remember its BASIC that well and certainly not the one statement per line nor the IF THEN limiations. I think that would do my nut in!

    • @joshhiner729
      @joshhiner729 2 года назад +3

      I think the author could also be attempting the balance between readability and simplicity. As you simplify many times you start using advanced features or math that are scary for new users to see and definitely hard to understand. The program IS huge difficult spaghetti code though which is hard to read. Its very… literal/spelled out though which may also be why the author wrote it as such. Just an idea.

    • @eugenetswong
      @eugenetswong 2 года назад

      @@joshhiner729 Good thinking!

    • @ronb6182
      @ronb6182 Год назад

      I'm glad some computers will take a zero and make it an O we have come a long way in word processing even misspelled words get corrected automatically and my phone went overboard with that feature I have to go back a put the original text because it changes the word and it can be a pain to un- correct to the word I wanted to write even 8 bit in another sentence was 8 but when the correction took place. Sometimes we have to take the bad with the good. 73

  • @merykjenkins3274
    @merykjenkins3274 2 года назад +19

    Oh the joys of cross referencing a book of basic programs not designed for your computer against the user manual to find the correct syntax. I think I learned as much from that as from writing my own programs. That was some amazing optimisation Robin!

    • @superscatboy
      @superscatboy 2 года назад +1

      Although unintended, it *was* a great way to learn. I had a ZX Spectrum at home, and the two programming books my school library had were for BBC BASIC. It was an experience converting all those listings! Thankfully, the ZX BASIC manual was so excellent that even a clueless 11 year old could get there in the end :)

    • @IndianapolisGerry
      @IndianapolisGerry 2 года назад +2

      I learned more in the 1980's by typing in code that I have in classes I have spent thousands of dollars for.

    • @haroldlane4647
      @haroldlane4647 2 года назад +1

      Same here! I was buying Commodore mags but only had a Timex Sinclair 1000 that I had cobbled together from 2 surplus units (2/$18). Great times…

    • @jessefinnegan1719
      @jessefinnegan1719 2 года назад +1

      Sadly this was why I never learned anything as a kid. I didn't have a book telling me the syntax for the code I was typing in (Our computers where always given to us second hand). So when it would invariably contain an error, I had no idea what I did wrong.

  • @oleimann
    @oleimann 2 года назад +13

    You can add a couple of lines to turning the standing (current) location into a hollow square (char 129, "FF818181818181FF"), putting the plotting of the hollow square before the key-get, and filled when key pressed (before the changes), then returning to the hollow plot after the location updates.
    Lines used: clear,char128,char129,r=1,c=1,plot129,getkey, if(nokey):back-to-getkey, plot128,r-adjust,c-adjust, back-to-plot129: 12 lines with proper r,c init.
    Drawing lines when you know where your "cursor" is works much easier as a tool :)

  • @visitandolosclasicos
    @visitandolosclasicos 2 года назад +6

    "The Texas Instruments TI 99 / 2 (in-house named "Ground Squirrel") was intended to compete in a lower price range than the TI 99/4A (i.e. in the same range that the Sinclair Spectrum). But when the price war with Commodore forced TI to slash the price of a 99/4A to that level, there was no market for the 99/2 anymore.
    Therefore, this prototype never made it to the shelves of the computer shops." - old-computer museum

  • @robertsmith9807
    @robertsmith9807 2 года назад +8

    This was my first computer. Love it!

    • @sourcecode6467
      @sourcecode6467 2 года назад

      I'd be lying if I said I wasn't slightly jealous

    • @michaelkramer5199
      @michaelkramer5199 2 года назад

      Also my first computer. I had it and used it from probably 1979 to 1993, even after I had a 286. He's brought back a lot of memories in shortening up the code. I remember using boolean logic statements like that for keyboard control and replacing sections of spaghetti code like that in programs from BASIC programs books of games for navigating mazes or flying your sprite around the screen. Great memories!

  • @Reginoid
    @Reginoid 2 года назад +3

    omg, I used to do that boolean formula trick too when I was a kid. you need abs() when it matters, and combining with on X goto or on x gosub can further shrink the line count. I love it, show off :P. I had an old Advanced BASIC instructor who refused to believe that my code would run until I showed her that it did, lol, good times.

  • @lidarman2
    @lidarman2 2 года назад +6

    Love the optimization tricks. Nice work. I remember when I was learning to program the ZX81, I saw some boolean math tricks on programs I typed in. I was so puzzled, I figure them out and starting using them to make my Dungeon program fit in 16k. That's the early 80s for you, hobby computers and dungeons and dragons.

    • @blatherskite3009
      @blatherskite3009 2 года назад +1

      True. Learning BASIC and playing D&D really seemed to go together in that early-80s era.
      I recall a section in the Dungeon Master's Guide explaining to DMs how they should interpret player's commands given to undead creatures under their control absolutely literally, e.g. a command to "attack anyone who enters this room" would also apply to the player themselves unless they explicitly stated "except me."
      That communicated something profound to me about the nature of programming computers, i.e. that coding is all about spelling out to the computer exactly what you want it to do in 100% watertight language with nothing assumed or taken for granted - because it has no "intelligence" with which to interpret the intent of your commands; it just dumbly follows the strict letter of the instructions you gave it. If it fails to do what you want it to do then that's on you, because it means there's some error or omission in the way you worded the task.
      BASICally (haha) the realisation that computers were a lot like D&D skeleton guards was what made coding "click" with me :)

  • @config2000
    @config2000 2 года назад +3

    I do enjoy learning little tricks in how to reduce code. I use code reduction tricks in modern-day languages where they support such evaluations. For instance moving a player left/right via cursors. My shortcut code trick is:
    dx=-keydown.left+keydown.right
    which in some languages equates to -1 for left, 0 = no movement, and 1 for right.

  • @AngusArthur
    @AngusArthur 2 года назад +1

    Figuring out bits of logic like you show is such a pleasure. Not that I code much or have often been clever enough see the chance to use it. When it works I find the sums fun to look at. So much work in so little space.

  • @anjinmiura6708
    @anjinmiura6708 2 года назад +2

    OMFG! The complex R=R-()/C=C-() is awesome. I was totally able to follow along but I'll have to admit I wouldn't have thought of doing it that way.

  • @eugenetswong
    @eugenetswong 2 года назад

    Your new version of R is a good way of checking for the joystick usage in the left-right and the up-down directions. I got this tip from a magazine article for the joystick check, which sped up the action.
    The amazing thing is the new code looks so intimidating to beginner and intermediate programmers, but once they know its intent, it is much easier to understand, because it can be understood at a glance.
    Your untangling might speed up the code in many instances for Atari, because each goto forces Atari to start at the beginning of the code and search for the destination line number; but you probably knew this.

  • @galier2
    @galier2 2 года назад +9

    Time to get TI Extended BASIC. Then you can avoid the goto spaghetti as then/else can be followed by statement. Also multiple statements per line (separator is 2 colons :: not 1 : but don't be afraid, it is encoded just as one token in memory). Sprites, named subroutines, call peek and call poke (if you have memory extension) are then bonus.

  • @MyChannel-vm6dw
    @MyChannel-vm6dw 2 года назад +1

    LOVE the TI 994a stuff....keep it coming. Very interesting computer and very little youtube content and I simply LOVE they way you approach these computers in interesting and different ways.

  • @NeilRoy
    @NeilRoy 2 года назад +3

    That has to be the most GOTO's I have ever seen in a program, wow.

  • @davidgari3240
    @davidgari3240 2 года назад

    I'm impressed by the astonishing number and quality of the Old Guys' comments, and as an OG myself involved with all manner of software on microcomputers from the PDP-8, Altair, IMSAI, et al. - also impressed with your Vulcan logic. Awsome to the max!

  • @Jburton561
    @Jburton561 Год назад

    I used to be a TI user. A little tip when writing a program, start with NUM 10 enter. And then it’ll start with the number 10 and every time you hit enter it will start with the next number by tens so 20 then 30 etc.

  • @PeBoVision
    @PeBoVision 2 года назад

    I cut my teeth on TI-Basic...specifically typing in magazine listings. As soon as I caught on to how things worked, I started optimizing those listing. (Essential when you only have 16k or 48k to work with.)
    This videos brought back so many of those memories.

  • @The-Great-Gonzo
    @The-Great-Gonzo 2 года назад

    All these early computers had their advantages and disadvantages. I enjoy tinkering with all these computers. I am one that did grow up with the TI 99/4a so it has a special place in my heart. Plus it was a major upgrade for me from my 2600.

  • @echandler
    @echandler 2 года назад

    Nice trip down memory lane. These tricks were common on the Apple 2 in Applesoft Basic. Using a boolean in an arithmetic expression can eliminate the need for some IFs and GOTOs, as well simplifying some defined functions. Be aware that sometimes TRUE is represented as -1 instead of the expected 1 in some environments.

  • @arcadeshopper
    @arcadeshopper 2 года назад +6

    There was zero chance of getting an electrical shock from the aluminum case first off because it is lacquered and therefore you're not really touching aluminum and then secondly because it is not attached to the computer in any way except for through the plastic part of the case. The only part where you could theoretically get an electrical shock was one of the ground points or the expansion slot. However, you had to have a bad electrical issue in your house to even get a fault. The issue was something that they only could reproduce in a lab and all that pigtail does is add a fuse. So if you start drawing too much electricity it blows the fuse

  • @TrebleWing
    @TrebleWing 2 года назад +1

    Never knew basic had those nifty (comparisons) like you showed. That is a very clever little trick!

  • @jcrouzzo
    @jcrouzzo 2 года назад

    I am amazed nobody else commented on what beautiful handwriting Greg Pettigrew has. I wish mine looked like that!

  • @mal2ksc
    @mal2ksc 2 года назад +3

    I still do plenty of Boolean logic that looks just like this, except it's in a spreadsheet, where TRUE is equal to 1 rather than -1. For example, figuring out a D&D character's spellcasting equivalent level (for multiclassing) using just one formula and one cell to do it. It's less convoluted and less prone to breakage than nested *if()* statements.

  • @PoignantPirate
    @PoignantPirate 2 года назад +1

    I can see where the excess GOTO lines at 370, 380, 390 could be useful for mentally separating the code into sections similar to functions or variables while you're writing it.
    Especially 370 and 390, they're *currently* jumping back to the same code, but if the logic for the sections jumping to 370 or 390 had diverged, it would be easier to edit that one line VS needing to go through and replace every other or every third instance of GOTO 50 throughout the proceeding sections to point at a new line.

  • @00Skyfox
    @00Skyfox 2 года назад +1

    I remember taking "computer class" in the 3rd grade back in '83. They had a large broom closet set up with 5 or 6 of these TI-99 computers. All I remember of it was that I was sitting next to a girl I thought was really pretty, so clearly I didn't pay much attention to the class. That was around the time we got our VIC-20, followed by a C64, so I learned a great deal more about Commodore BASIC than TI-99 BASIC.

  • @AtariForeva
    @AtariForeva 9 месяцев назад

    This is a really nice TI, I just got mine for CAN $20 with joysticks and all, picking it up tomorrow.

  • @SammYLightfooD
    @SammYLightfooD 2 года назад

    I grew up with a C64. And before owning a floppy, which came later (as it did cost as much as the computer itself) it all was about tapes or typing programs in. Loading from tape was an adventure as you hoped there'd be no read error. And typing in games was an adventure as you hoped you'd find all of your §$%& typing errors =P I'm not keen about typing in basic listings again, but I love how you show these books! I still have Michael Crichtons "electronic life" which is a nice read too.

  • @gklinger
    @gklinger 2 года назад

    "In short, this is here to help you keep from getting zapped while you're computing." There's an electrical short joke in there somewhere but I'll be darned if I can find it.

  • @NotMarkKnopfler
    @NotMarkKnopfler 2 года назад

    That TI looks like it rolled off the production line just yesterday. Always was a beautiful looking machine and still is.

  • @JustWasted3HoursHere
    @JustWasted3HoursHere 2 года назад +1

    Yes, very strange that the TI did not come with a backspace key. But I guess one could get used to it after a while.

  • @LeftoverBeefcake
    @LeftoverBeefcake 2 года назад +1

    Been working on my little graphics transmitting and display project and getting reacquainted with the C64's BASIC, and after seeing this video, I'm quite glad to continue using the C64's BASIC. Although I do have a GOSUB that RETURNs to a GOTO... :)

  • @sammy61187
    @sammy61187 2 года назад

    Awesome video coding has alwaya seemed so complex but watching your videos im starting to understand

  • @MakersEase
    @MakersEase 2 года назад +1

    My first computer was the TI 99/4a... I did so much basic programming on it. I so wanted the extended basic cartridge......

  • @RonHelton
    @RonHelton 2 года назад +1

    Dictionary entry:
    Computer guru: see Robin
    ; )

  • @arcadeshopper
    @arcadeshopper 2 года назад +1

    If you type a line number then hit up you go into line editing mode up and down arrow moves between lines up and down in the program

  • @domramsey
    @domramsey 2 года назад +1

    The TI-CC40 was a portable computer with a built-in single line display. I think it was such an abject failure that you can still find them New Old Stock in unopened boxes.

    • @MrWaalkman
      @MrWaalkman 2 года назад

      Exactly how I got mine. :)

  • @Dedicatedtolivinginthepast
    @Dedicatedtolivinginthepast 2 года назад

    You are really good at this modern art stuff!

  • @BoxOfFeet
    @BoxOfFeet 2 года назад

    This is awesome. I don't do much programming on my 99/4A. But I do use my TI-74 Basicalc quite a bit. That uses TI BASIC. Well, mostly. It only has one line of text, so no graphical functions. But I just checked, and it can use the boolean comparisons you were showing. Reducing program size is always welcome there. It has 8K onboard, and I have an 8K cart for it, but I have several programs I use for work and have filled those both up.

  • @kojsbarv
    @kojsbarv 2 года назад

    Great vid, and liked the music in the end

  • @CrystalTikal
    @CrystalTikal 2 года назад +1

    Two things:
    1. When I first saw the title, I thought this was about the graphing calculators.
    2. I have a Choose Your Own Adventure book with all the CYOA segments in code called MicroAdventures: Space Attack! that includes code for the TI 99/4A. I got it from a book trade at my middle school in 2009.

    • @8_Bit
      @8_Bit  2 года назад +1

      Apparently the calculator language is called TI-BASIC and the computer language is TI BASIC. Not much difference!
      I've now got the complete MicroAdventure series, they're great. They really had to adapt the code for the TI-99/4a the most, and ended up dropping it from the last few books in the series.

  • @rog2224
    @rog2224 2 года назад

    One of the great gotchas on the TI was hitting Func - + rather than P Rshift -0 or Rshift-+. Usually down to fatigue in the small hours (while doped on benadryl, since it was the summer 0f 83) could make your typing sloppy. Huge program, lots of CHAR lines, and suddenly you're back at the beep and the splash screen.

  • @endymallorn
    @endymallorn 6 месяцев назад

    The funny thing is, I use that same kind of Boolean logic in my spreadsheet formulas today, and any time I do, people get astounded at how quickly I can pull huge amounts of data into a single formula and output a coherent answer.

  • @StevenIngram
    @StevenIngram 2 года назад

    Thanks for pointing to your 10 line adventure. I'm going to check that out. :)

  • @CanadianRetroThings
    @CanadianRetroThings 2 года назад +1

    The TRS-80 Model 12/16 were business machines that were the replacement for the model 2.

  • @15bits
    @15bits 2 года назад

    This was satisfying to watch.

  • @StephenCameron
    @StephenCameron 2 года назад +1

    One trick I remember for TI BASIC when typing in programs for other computers: TI BASIC didn't have AND or OR operators in IF statements which made typing in programs for other BASICs that did have these operators a giant pain, but, you could use multiplication (*) and addition (+) in place of them, respectively, because TRUE is 1 and False is 0. TI extended basic did have AND and OR, iirc. I see the video covers this around 38:00

  • @pikadroo
    @pikadroo 2 года назад +1

    It's almost as if the person writing the book was just figuring it out as they went along and as long as the final code worked, that is what they printed in the book.

  • @JustWasted3HoursHere
    @JustWasted3HoursHere 2 года назад +5

    That boolean replacement code is clever, though it does run noticeably slower. The TI runs 3 times faster than the Commodore 64 at 3 mhz and has a 16 bit processor, but it almost always seems to run slower such as in this BASIC example due to the inefficiency of the TMS9900 processor in comparison to the C64's 6510 (or even just a run-of-the-mill 6502).

    • @arcadeshopper
      @arcadeshopper 2 года назад +2

      It has nothing to do with the processor it has to do with the fact that TI basic is double interpreted from basic to GPL to assembly language. This slows down the computer immensely. Versions of extended basic and cortex basic show the speed of the computer and assembly language of course run circles around all of that.

    • @JustWasted3HoursHere
      @JustWasted3HoursHere 2 года назад +3

      @@arcadeshopper The TMS9900 processor is not as efficient as the 65xx series. Whereas the 65xx line can do most operations in a few cycles, the TMS9900 takes 8-12 cycles on average, negating any clockspeed advantage it might have had. Even their non-BASIC games run very slowly,* so that BASIC->GPL->machine code does not fully explain the slowness.
      * Apparently, although the processor is 16 bits, only the system ROM and 256 bytes of scratchpad RAM can use the 16 bit bus, massively hampering the performance of the overall system. Also, TI kept the 99/4a as a mostly closed system for a very long time. If they had opened it up from the beginning perhaps third party developers could have discovered new ways to speed it up.

    • @arcadeshopper
      @arcadeshopper 2 года назад

      @@JustWasted3HoursHere on the 4/a it gets 3 times as many instructions per second, and can do math and other functions in those instructions that the 65xx can't. So the 65xx has to use more instructions to do the same work as the 9900 can do with less. also part of the slow down on the 4/a is the 16 bit cpu is multiplexed into an 8 bit buss.. so fun

    • @catgirlQueer
      @catgirlQueer 2 года назад

      @@arcadeshopper the 6502 can punch *well* above its speed class, it's incredibly efficient with its bus access, almost every cycle is a memory cycle, sure, it doesn't have hardware multiply, but software multiply on the 6502 is sometimes only marginally slower clock-for-clock when compared to hardware multiply

    • @arcadeshopper
      @arcadeshopper 2 года назад

      ​@@catgirlQueer Cool, however this diverges from the topic of why TI basic is slow

  • @TomaszWiszkowski
    @TomaszWiszkowski 2 года назад

    Ahhh the beauty of optimization..
    You are absolutely right Robin. I am just not sure all these kids (myself back then included) would be able to reason about this code just the same way.. heck, even today some of the optimizations i come across require a lot of brain gymnastics and it's so hard to make changes..
    Your middle solution was pretty well balanced though! That was a lot of fun to watch!

  • @tabachanker8716
    @tabachanker8716 2 года назад +2

    I have a possible explanation for the weird condition inversions. That may be because the programmer was used to program in 6502 assembler.
    On that cpu, you can't branch on a condition more than 128 bytes ahead (or backward). The way to bypass this is to do this weird condition inversion so that the conditional branch just jumps over the next instruction (the real branch but without a condition, those can go almost everywhere in the code).
    I think the original programmer may have learnt to always do this kind of branching inversion, just to not have to bother with that particularity.
    Then, there are the multiple gotos in a row which scream to me: programmer that only do local jumps. The only jump allowed to go out of a section of code, is at the end of the section. All the jumps inside that section that want to exit the section have to use that last jump.

    • @stevethepocket
      @stevethepocket 2 года назад +1

      Whoa. I never noticed that. What a weird limitation; you can only jump to an absolute address and you can only branch to a relative one.

    • @johndododoe1411
      @johndododoe1411 2 года назад

      Same limitation on the x86 family we still use for everything.

    • @stevethepocket
      @stevethepocket 2 года назад

      @@johndododoe1411 Truly we live in a cuckoo clock.

    • @0LoneTech
      @0LoneTech 2 года назад

      I find myself once again appreciating the AVR's Skip instructions, eliminating so many branches. It's a conditional single instruction inhibit, with no need to flush the pipeline.

  • @Gooberslot
    @Gooberslot 2 года назад +2

    Your super optimized for length version does seem slower though.

  • @MichaelDoornbos
    @MichaelDoornbos 2 года назад +2

    Interesting how many of these programs made it into a lot of books for the various machines of the day. I recognize many of those from other books.
    I'm not generally a fan of mail call videos, but Robin going though books hooks me every time.
    "Pedantic nerds..."

    • @8_Bit
      @8_Bit  2 года назад +7

      There's quite a few mail call videos in the pipeline, for better or worse, but they're all things I'm interested in and I won't focus too much on the mail part beyond making sure the sender is properly acknowledged.
      I think I'm a pedantic nerd towards pedantic nerds. I'm not sure if that's a higher calling or not. Actually...

  • @MatroxMillennium
    @MatroxMillennium 2 года назад

    The models 12 and 16 are the successors to the TRS-80 Model II, since it was really a much different setup from the rest of the TRS-80 line.

  • @prozacgodretro
    @prozacgodretro 2 года назад

    Okay well I'm glad that you pointed out the safety recall. I just recently got a ti-99, it was really confused about the super glued electrical cord. I almost cut it off thinking it was just stupid, like someone hacked it on there for some reason.

  • @lennartbenschop656
    @lennartbenschop656 2 года назад

    The ZX81 let you sketch with 64x48 'pixels', the PLOT command took care to draw the appropriate block graphics characters for you. Doing any kind high-res line drawing gets really, really, really tough on the TI 99/4A in BASIC (and slow). You can dynamically change the bit patterns of the 8x8 character cells and you have 128 distinct characters to use (32-159). You could do pixel-level function plots if you really wanted.

    • @SuperVorticon
      @SuperVorticon 2 года назад

      That actually has been done. The main limitation is the number of available characters to use for redefinition (96 were available in TI Basic) , so full screen bitmaps are out of the question, but . And as you said, it is painfully slow...

  • @hugovangalen
    @hugovangalen 2 года назад

    Don't know if anyone mentioned it, but the "fixed" version also properly plots the block at 1,1.

  • @yjk_ch
    @yjk_ch 2 года назад +2

    I believe these kinds of tricks are still used today when programming GPU shaders, because GPUs are really bad at branching, so branches are replaced with arithmetic operations whenever possible.

    • @0LoneTech
      @0LoneTech 2 года назад +1

      That is correct, although to be precise GPUs are often terrible at divergence, not branching itself. CPUs are often even worse at branching, and make immense efforts to compensate with mechanisms like speculative execution and branch prediction.

  • @charleskozak4102
    @charleskozak4102 2 года назад +1

    Yeah, I remember the frustration typing in programs. My thing was trying to get programs for other machines to run on my TI. So many memories...learning Algebra and Trig functions before I even knew what kind of math I was even looking at...40 years ago, that was. C64 felt like an upgrade. The games were better, at least.

  • @szr8
    @szr8 2 года назад

    Hard to believe that BASIC on my TI-86 is more advanced than BASIC on the TI-99.

  • @LanceHall
    @LanceHall 6 месяцев назад +1

    The lack of a backspace key is baffling. I wonder if there is a hardware and/or grom hack that could create a backspace function. Is there an unused key code that could be used? On the keyboard there is that little empty spot in the upper right they could accept an additonal key or button.

  • @cmdlp4178
    @cmdlp4178 2 года назад +1

    I can see where a sequence of gotos could make sence: When it is used as a jump table in combination with a computed goto. But not all basic dialects support that.

    • @8_Bit
      @8_Bit  2 года назад

      Yes, Commodore BASIC does have the ON X GOTO 100,200,300 that can be very useful. I don't think TI BASIC has it.

    • @0LoneTech
      @0LoneTech 2 года назад +1

      Fun fact, GCC (the GNU compiler collection) supports computed gotos in C. The switch statement was also designed for that use.

  • @pleasedontwatchthese9593
    @pleasedontwatchthese9593 2 года назад

    Its impressive that these computers still work

  • @PregnantSausage
    @PregnantSausage 2 года назад +1

    26:39 - My guess is the programmer did that odd thing of grouping GOTO is so he has a central place so he can update the new goto locations as the program changes/gets bigger without having to locate the original goto mixed in actual code (above the area).

  • @Nostrum84
    @Nostrum84 2 года назад +1

    The shorter code version is shorter for sure, but it definitely runs slower now :) compare 27:52 and 39:49

  • @-Steven-
    @-Steven- 2 года назад

    Ahhh boolean logic was what the zx spectrum lived for, you could use it on everything, strings, calculated goto and gosub, plot, draw, circle statements in fact anywhere you could use a variable, and because the character line limit on the speccy was 65535 you could technically write a whole program in just 1 line as long as you were an expert in boolean logic.
    the one problem there though is the spectrum would get slower and slower as the single line got bigger, sometimes almost coming to a crawling stop, plus when you pressed enter to add the line to memory it could take a while to accept it as the speccy does syntax checking on the line before accepting it which cut down massively on typing errors as it wouldn't accept the line until you fixed the errors first.
    one thing though thanks to the weird basic in the zx spectrum all variables have to be defined before you use them or you get a 'Variable not found error' unlike most other basics it doesn't automatically define them if not found.

  • @spartonberry
    @spartonberry Год назад

    8:02 I have to wonder how many critical business decisions were solved by a TI 99/4A. :D

  • @joshhiner729
    @joshhiner729 2 года назад +2

    Great episode. Your final simplification example was awesome. As a child I remember using my friends ti99/4a. I remember the program listing being incredibly slow as your video shows. I also felt the machine as a whole seemed slow in games and other operations. I understand there were technical shortcuts taken by TI but never really understood just why a basic program listing etc was so slow. Well I guess we can assume its due to the unfortunate technical shortcuts in hardware but does anyone know if it is otherwise due to a poorly converted basic environment? Maybe a poorly optimized kernel? The specs of the unit otherwise dont appear to be that slow on paper.

    • @eugenetswong
      @eugenetswong 2 года назад

      It's been 8 months, and nobord answered yet.
      1 reason is that looping for some/all computers was done by starting at the beginning of the code and going from line to line until the destination was found.
      Therefore speed ups are done by going to the end of the code, and back to the beginning.
      10 goto 32010
      20 print x
      30 print y
      40 goto 20
      32010 x=1; y=2
      32020 goto 20

    • @CRCO1975
      @CRCO1975 2 года назад +1

      In most home computers, BASIC was implemented as a machine language program. Slower than machine language, but generally acceptable.
      In the TI 99/4A, TI BASIC is implemented in a language called GPL (Graphics Programming Language). GPL is an interpreted language written in TMS 9900 machine language. Thus TI BASIC tokens are first interpreted into GPL, and then the GPL interpreter performs the machine language.
      TI Extended BASIC converts some of the GPL routines to machine language and runs noticeably faster. There are newer versions of Extended BASIC that are even faster.

    • @eugenetswong
      @eugenetswong 2 года назад

      @@CRCO1975 thank you sharing that info with everybody.

  • @TheStuffMade
    @TheStuffMade 2 года назад +2

    Interesting. The original version of the BASIC program looks like someone took an assembly program and translated it into BASIC.

    • @superscatboy
      @superscatboy 2 года назад

      Even in assembly all those grouped goto/jumps are stylistically horrendous lol

    • @TheStuffMade
      @TheStuffMade 2 года назад +1

      @@superscatboy I think it's not unusual to have assembly code looking like that when doing a number of comparisons. Think of the if-comparison-jumps as branches and the goto statements as jumps (some might have been return statements in the original assembly code), then it makes sense since branches are limited to 128 bytes forwards and 127 bytes backwards in the TMS9900 CPU.

  • @paulwratt
    @paulwratt 2 года назад

    The CALL word() is a "built-in" BASIC language extension, as found in MSX-BASIC. If you write a memory dump program you will come across the BASIC keywords, which may have +/-128 in either the 1st, 3rd, or last character, with a 2 byte JMP value where the actual routine starts. The CALL routine doues a table look on _word_ , which will be "outside" the BASIC-ROM (but still within the ROM boundary because thats the default for a TI99/4A), and again it will have an associated 2 byte JMP value. The CALL routine may setup some registers or locations to map to the (0,X,Y) values before it JMP's to the extension _or_ that setup may happen in the extension - I am going off memory of a paper dump listing I did of a SVI-728 at the beginning of the 1st Iraq invasion - the JMP values may be before _or_ after the keywords, I cant remember verbaitum.

  • @wlorenz65
    @wlorenz65 2 года назад

    You could get rid of the -(R=0) term if you use HCHAR(R+1) instead and make some changes to the border checks, but it may confuse other programmers who are reading your code.

  • @sourcecode6467
    @sourcecode6467 2 года назад

    Love this ❤️

  • @UltimateSeduction
    @UltimateSeduction 2 года назад

    Cool, does me remember programming gw-basic a long time ago.

  • @kespeth2
    @kespeth2 2 года назад +2

    Ah, the version of BASIC where the command to load wasn't LOAD, but OLD.

    • @lennartbenschop656
      @lennartbenschop656 2 года назад +2

      The OLD command was on the original mainframe versions of BASIC too. It's quite logical. NEW let you start a new program, OLD loaded up an old program.

    • @kespeth2
      @kespeth2 2 года назад

      @@lennartbenschop656 So Commodore was the one who changed it to LOAD and it caught on with all future computers except the TI-44A?

    • @lennartbenschop656
      @lennartbenschop656 2 года назад

      @@kespeth2 I would say: it was Microsoft and most others followed them/

  • @themadatheist1976
    @themadatheist1976 2 года назад +1

    Family had the 4a, including the the voice box and massive expansion box with disk drive and a variety of expansion cards inside.
    Had that book at 2:42 and tried to type that game on the front cover into the system but never finished.

  • @huntabadday2663
    @huntabadday2663 2 года назад

    The transformer failure were the computers attacking back for people mashing the keys too hard

  • @JustWasted3HoursHere
    @JustWasted3HoursHere 2 года назад

    With all those Goto statements jumping the code around, that "Drawing Sketches" program is the epitome of "spaghetti code"! I'm guessing that TI-BASIC doesn't have Gosub (and Gosub routines)?

  • @AlexEvans1
    @AlexEvans1 2 года назад

    I don't know about a long time. My copy of the TI Editor Assembler manual claims copyright 1981.

  • @DAVIDGREGORYKERR
    @DAVIDGREGORYKERR 2 года назад +1

    if that PC had came with 512KB of RAM it might have been the best computer out, come to think of it if it had used the TI-990 it would have had floating point built in and would have made for the fastest computer for the domestic market.

  • @RonJohn63
    @RonJohn63 2 года назад

    TI BASIC's minimalist flow control reminds me of assembly.

    • @johndododoe1411
      @johndododoe1411 2 года назад

      And I've seen that silly goto pattern in compiler generated assembly.

    • @RonJohn63
      @RonJohn63 2 года назад

      @@johndododoe1411 because "branch unconditional" and "branch conditional" are the *only looping structures* that CPUs have. HLL loop constructs are built from this.

    • @johndododoe1411
      @johndododoe1411 2 года назад

      @@RonJohn63 I mean goto a goto instruction, as a professional, I am fully aware of the machine code limitations and techniques, including optimal implementation of HLL concepts and working with limited range jump instructions.

  • @RockyBMusic
    @RockyBMusic 2 года назад

    Nice, was the Author of the Listing payed by Lines?
    btw.
    this is how i mostly use boolean algebra in Excel Sheets;-)
    You are not able to use "TRUE" or "FALSE" within a calculation, but if you use for Example in C1..
    =(A1="TEST")*(B1="TEST2")*1
    so it is possible to use this in a Formula

  • @tomlake2732
    @tomlake2732 2 года назад

    TI BASIC allows AND and OR but you use * for AND and + for OR. 100 IF A>100 + B=3 THEN 500 is the same as IF A>100 OR B=3 THEN 500 in some dialects.

  • @TomStorey96
    @TomStorey96 2 года назад

    That's a fine example of branchless programming!

  • @mikelunsford7462
    @mikelunsford7462 2 года назад

    I find myself playing with assembly these days, but I'll be graduating to FORTH by summer.

    • @bjbell52
      @bjbell52 Год назад

      I still have my "Thinking Forth" by Leo Brodie. Back around 1982 some people in the computer industry thought Forth was going to be the language to replace BASIC. I had an Atari 400 and I rewrote the plot/drawto commands in Forth and it was many times faster than the one written in 6502 code in Basic (the built-in Basic had to work in multiple graphic modes with different sizes and colors. It used BCD math and had to multiply the Y coordinate by the number of bytes in a horizontal row. I used a table lookup to eliminate that multiplication and I only wrote it for 1 graphic mode) . Still, it was faster than compiled (into P-Code) Pascal I had.

  • @naysmith5272
    @naysmith5272 2 года назад

    the Maze Generator programs looks interesting,

  • @seannewton8386
    @seannewton8386 2 года назад

    The TRS-80 Model 16 was the Z-80/68000 dual processor computer that could run TRS-XENIX

  • @marcoggarb7357
    @marcoggarb7357 Год назад

    Super

  • @jerryspann8713
    @jerryspann8713 2 года назад

    TI Games! I had that book growing up. Excellent book. Would like to find a copy. Who is the author and publisher?

  • @RalfOfBalcony
    @RalfOfBalcony 2 года назад

    I know somebody who got shocked by this powerbrick: it was the management of TI because they had to spend money to fix it 🙃

  • @evansdm2008
    @evansdm2008 2 года назад

    I suspect you don’t need 2 variables. 1 variable indicating total number of chars from top left. You can div / mod to get row / column. That boundary check expression would also be a single line if TI basic if can handle it

    • @eugenetswong
      @eugenetswong 2 года назад

      Can you give me an example of this?

  • @stevethepocket
    @stevethepocket 2 года назад

    8:30 Looks like somebody tore out a page there. Or was that one of those magazine subscription offer cards? I don't think I've ever seen one of those in a book with a lot of pages and real glue binding; it's usually small booklets bound with staples, where you can pull both halves out and there's nothing left inside.

  • @skonkfactory
    @skonkfactory 2 года назад

    I only have one slight objection Robin, and that's that your channel is called 8-Bit Show And Tell, and the TI-99 is a sixteen bit machine!

    • @8_Bit
      @8_Bit  2 года назад +2

      The CPU and 256 bytes of RAM are undoubtedly 16-bit, but everything else about the machine is 8-bit, and it performs worse than most 8-bits, so I feel comfortable talking about it anyway :)

    • @ronb6182
      @ronb6182 Год назад

      It's an 8 bit machine only the processor is 16 bit and the rest is 8 bit. It's a shame the processor isn't up to it's potential. The 99/4a could have been the best computer in it's day. T I made the best speech synthesizer in it's day. The teaching game speak and spell had a good voice. Also TI was mainly about teaching and not so much about playing games. Many children learned basic and went on in the computer field which was a success. Commodore and Atari were game machines and the programs they produced tells all. The main objective in TI was education with tons of educational cartridges. TI should have just made the best computer and not compete with game machines that's all Commodore and Atari are game machines. The processor could have been powerful if shortcuts we're not taken. No one speaks of Triton which sold TI accessories including the expansion box with disk drive and 32k of memory expansion. I bought mine in 84. I also bought the Milton Bradley game console which came with 4 games. My main objective was basic programming not so much about games I only had a handful of games. The best cartridge I had was extended basic. I used the music or sound features of the TI. I'm sure apple had a better sound card but I didn't spend thousands of dollars for that feature. 73

    • @bjbell52
      @bjbell52 Год назад

      @@ronb6182 There were non-game programs on the Atari. It's too bad it got that game title because it could do something other 8-bit computer couldn't do (at least I don't know of any). Let's use Apple for an example. Its word processor was ~40K in size leaving only 8K for the document. Atari could put a 40K program into a 16K cartridge so it only took up 16K of memory leaving 32K for the document. It used a 6502B processor similar to the microprocessor in the Apple but it ran 79% faster.
      One thing is true - originally Atari's 8-bit computer was suppose to be a replacement for their Atari VCS video game system but then management decided it was good enough to rival Apple computer so they made it into a computer instead.

    • @ronb6182
      @ronb6182 Год назад

      @@bjbell52 if I did a Talley of all the cartridges that Atari made I could bet 90 percent would be game cartridges. TI made more educational cartridges than game cartridges. I used to play a few games but my common interest was to write my own programs. I wanted to learn basic programming beyond my one class I took in college. Music was my major and I enjoyed writing music programs. Atari and commodore were for game sales that's why TI closed the computer shop. They still made chips and the best calculators one would want. The TI 30 was a winner and got me through college mathematics. 73

  • @RixtronixLAB
    @RixtronixLAB 2 года назад

    Nice video, keep it up, thanks :)

  • @lovasip
    @lovasip 2 года назад

    Texas Instruments putting the TI into spegetti code.

  • @slucas601
    @slucas601 2 года назад

    Does the TI games book from Compute! say 29 games on the front cover and then say 14 + 16 games on the back cover? Oversight or "off by one" error?

  • @fumthings
    @fumthings 2 года назад

    short answer, you can do no more than send to a line number with an "if" statement, but you can nest just about any logic in a math statement.

  • @IndianapolisGerry
    @IndianapolisGerry 2 года назад

    Just watching the typing in of the finial code (25:22) -- I'm realizing that TI Basic is actually a good primer for Assembler...code arranged into blocks....
    I can't remember, even though this was my second computer (after a Spectrum) - was there a gosub routine? I think that came with extended....

  • @magnustveten492
    @magnustveten492 2 года назад

    Was yelling at my iPad but did not help, at 21:09 you wrote got0 not goto, can see on the keyboard you typed 0 not o :)

  • @BonesFPV
    @BonesFPV Год назад

    I’ve never been able to get my head around controlling the TI using Boolean methods. Something about this logic badly confuses me.

  • @ColinJonesPonder
    @ColinJonesPonder 2 года назад

    As soon as you started typing "70 R=R-((" I knew where you were going. I've done this so many times in the past and even more recent in spreadsheet cells!
    Commodore BASIC is terrible as a BASIC but it's really excellent at getting you to learn the system and forms a really good basis for learning how to use machine code on the systems due to all the PEEKs and POKEs you needed to use to get the best out of them.

  • @kneesnap1041
    @kneesnap1041 2 года назад

    I certainly don't miss TI-BASIC. I'll take modern languages any day thank you.
    l love how far we've come, TI-BASIC almost feels esoteric nowadays. But I'd be lying if I said I wasn't nostalgic for it.