Reverse engineering Microsoft BASIC

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ม.ค. 2025

ความคิดเห็น • 279

  • @a1k0n
    @a1k0n หลายเดือนก่อน +528

    Minor bug in your print routine: you test the length after decrementing it, so a zero-length string wil print 256 bytes of garbage.

    • @rhysbaker2595
      @rhysbaker2595 หลายเดือนก่อน +46

      Sounds fun

    • @PrebleStreetRecords
      @PrebleStreetRecords หลายเดือนก่อน +111

      Heartbleed 6502 edition

    • @TrollingAround
      @TrollingAround หลายเดือนก่อน +10

      yes, tax, beq lcd_print_exit

    • @EVPaddy
      @EVPaddy หลายเดือนก่อน +10

      but probably 0 byte strings will produce an error before ever getting there

    • @boretrk
      @boretrk หลายเดือนก่อน +4

      @@EVPaddy How? That would require FRMEVL to abort the function that is calling it.

  • @MizuFelix
    @MizuFelix 23 วันที่ผ่านมา +10

    I love this series/course! I live in Germany and bought the 6502 Kit + the Clock Kit, and I did pay the 50 bucks shipping extra to buy from your website, instead of just ordering each individual part elsewhere, because I wanted to support you. Keep up the great work, Ben, I'm looking forward to finally be able to build this computer myself!

    • @manlyhallresearch9785
      @manlyhallresearch9785 19 วันที่ผ่านมา

      I need to buy it, too. It looks like a great way to learn.

  • @bcarlisle2575
    @bcarlisle2575 หลายเดือนก่อน +62

    Yeah…just bought the full 6502 kit and have been watching for a couple years…can’t wait to watch all of these again and follow along this time with my own kit.

  • @moshly64
    @moshly64 หลายเดือนก่อน +160

    In Commodore MS Basic, the output of the print command was controlled by a variable, the screen was device 3 but this could be changed to any device (0 Keyboard, 1 Tape, 2 Serial, 3 Screen, 4-7 Printer, 8-15 Disk). If you implement the LCD as a device then the system print/input/get commands can be redirected to any device.

    • @drobotk
      @drobotk หลายเดือนก่อน +11

      That sounds like the best approach to do this

    • @SIDCIAVIC
      @SIDCIAVIC หลายเดือนก่อน +1

      There are basic vectors to redirect for adding new i/o devices.

    • @melkiorwiseman5234
      @melkiorwiseman5234 หลายเดือนก่อน

      That was something which came to my mind, too. Maybe Ben could set up the LCD as device #7. I'd think that it would also be possible to make the LCDPRINT command automatically set up the device to print to as #7 and then call the "PRINT" routine to handle the rest, which would save on RAM space since commands such as LCDPRINT condense to a single byte whereas "PRINT#7," would require at least 4 bytes.
      Ben would still need to set up some kind of subroutine to handle the nonprinting characters (perhaps making CHR$(26) which is the Form Feed character act like a LCDCMD 1 to clear the screen, for example), but I'm sure that MBASIC has the appropriate "hooks" already provided to allow that kind of control.

    • @amartini51
      @amartini51 หลายเดือนก่อน

      So that’s where the 8 in LOAD ‘*’,8 comes from! Used to play games on a C64 at my grandparents’ when I was growing up, and we just copied the loading instructions from a scrap of paper by the computer.

  • @jeromethiel4323
    @jeromethiel4323 หลายเดือนก่อน +24

    Zero page memory is absolutely critical for 6502. Not only is memory access faster in zero page, it's the only way to do indirect addressing. So if you want pointers, which you definitely do, you need 2 bytes in zero page to hold the address. When i was coding in machine code on the Apple ][, i never put simple variables in zero page, that was always just reserved for pointers.
    Mainly, because i was using basic for the majority of most programs, and only using machine code for the fast bits. So i could not use zero page that was used by basic.
    When i was writing my one and only 6502 "game," i could use the entire space, and that was amazing!

  • @sirnukesalot24
    @sirnukesalot24 หลายเดือนก่อน +281

    Yes, floating point video please

    • @akaHarvesteR
      @akaHarvesteR หลายเดือนก่อน +5

      YES YES YES pretty please

    • @PaulaBean
      @PaulaBean หลายเดือนก่อน +5

      +1. Not only the floating point as it was imlplemented in MS Basic, but also the standard IEEE format ;-)

    • @kilianhekhuis
      @kilianhekhuis หลายเดือนก่อน

      ​@@PaulaBeanit's not that different, al FP numbers work largely the same.

  • @Aresydatch
    @Aresydatch หลายเดือนก่อน +335

    In memory of Thomas Kurtz, inventor of BASIC
    1928-2024

    • @frankowalker4662
      @frankowalker4662 หลายเดือนก่อน +33

      Oh. I didn't know Kurtz died.
      10 PRINT ":( ";
      20 GOTO 10

    • @evilotis01
      @evilotis01 หลายเดือนก่อน +8

      10 FOR I=1 TO 2
      20 PRINT "The horror!"
      30 NEXT I
      ...but seriously, RIP :(

    • @RetroRyn
      @RetroRyn หลายเดือนก่อน +14

      Co-Inventor with John G Kemeny who also passed away some year ago. But yes very sad, was one of my heroes who made computing accessible to so many more..

    • @frankowalker4662
      @frankowalker4662 หลายเดือนก่อน +4

      @@RetroRyn I still program in BASIC on my ZX81 now and then.

    • @RetroRyn
      @RetroRyn หลายเดือนก่อน

      @@frankowalker4662 Nice I started on a Sinclair ZX80, with 1K of ram, was fun..

  • @euromicelli5970
    @euromicelli5970 หลายเดือนก่อน +29

    2:27 yes, PRINT in MS Basic supports a SPC(n) and TAB(n) pseudo-functions. SPC(n) outputs ‘n’ spaces (you can get the same result by outputting SPACE$(n) of course but that’s more verbose and allocates an additional string). TAB(n) outputs enough spaces to reach column ‘n’; if you’re past the ‘n-th’ column in the output already, it outputs a new line and then enough spaces to get to ‘n’ on the next line. These are not real functions but output-control/formatting operators; they only exist within PRINT.

    • @IrtyGo560
      @IrtyGo560 8 วันที่ผ่านมา

      peek is one of them

  • @Lemonator321
    @Lemonator321 หลายเดือนก่อน +211

    Intel has been real quiet since this dropped

    • @En-Pea-Sea
      @En-Pea-Sea หลายเดือนก่อน +13

      Bill Gates hates this one trick!

    • @MichaelWillems
      @MichaelWillems หลายเดือนก่อน +1

      😂

    • @rhysbaker2595
      @rhysbaker2595 หลายเดือนก่อน +3

      MOS Technologies has been raking it in

  • @clonkex
    @clonkex หลายเดือนก่อน +16

    0:33 I bought one of your breadboard CPU kits! It makes for a fantastic conversation starter. Maybe one day I'll even assemble it.

  • @zirize
    @zirize หลายเดือนก่อน +50

    I was shocked to find that there was a buffer in the zero page. I've always considered the zero page to be a kind of register. It's such a precious memory that I've always believed it should be used sparingly.

    • @safiire
      @safiire หลายเดือนก่อน +2

      this

    • @paulabraham2550
      @paulabraham2550 หลายเดือนก่อน +14

      MS Basic even has a subroutine in zero page to pick up the next character from the prog - wild. And I've just realised I've picked that out of a more than 40 year old memory from when I was doing my own reverse engineering on it!

    • @gcewing
      @gcewing หลายเดือนก่อน +1

      Putting the buffer in zero page is probably so that the zero-page indexed addressing modes can be used to access it.

    • @gcewing
      @gcewing หลายเดือนก่อน

      @@paulabraham2550 Not sure why you would put a subroutine in zero page on a 6502, there is no zero page JSR instruction. Are you thinking of the Z80? The Z80 doesn't have zero-page addressing modes, but it does have 8 special one-byte instructions that perform subroutine calls to locations in page zero. I think the Z80 version of MS Basic used them to save code space and speed up calls to very frequently used operations.

    • @paulabraham2550
      @paulabraham2550 หลายเดือนก่อน

      @@gcewing Ha! I guess you weren't about in the day if you think people would have got confused between the two ;-).
      No - definitely 6502, and definitely the "character get" routine was in zero page. I don't think I ever worked out why they did that myself - I was certainly confused about that myself when I found it. Perhaps the annotated source code explains it - I only had disassembled code, of course.

  • @dbingamon
    @dbingamon หลายเดือนก่อน +1

    It brings back a lot of memories from working on Commodore BASIC mods.
    Your strings are stored in a string heap, it's similar to a stack only software generated and every time you manipulate a string it takes up space on the heap. Eventually heap grows to much and a garbage collection takes place to clean up the no longer needed strings or temporary strings. This would cause BASIC to periodically freeze up while this garbage collection is happening. Programmers would perform a command that checks available memory FRE(0) in Commodore BASIC and mem in some others, they would strategically put these commands in certain places to put the delay where it would have less noticeable impact on operation.
    BTW - We used add extra commands to Commodore basic without changing the ROM by intercepting the CHRGET subroutine, which is a piece of code in zero page.

  • @blazernitrox6329
    @blazernitrox6329 หลายเดือนก่อน +11

    Seconding (thirding? fourthing?) the floating point video. I think I've got a pretty good grasp of how floating point numbers are represented at a high level, but actually getting into the weeds on how the representation is generated would be really cool, especially in a pure-software environment like on the 6502.

  • @mohammedanwarsayeed
    @mohammedanwarsayeed หลายเดือนก่อน +7

    I don’t know why, but everything Ben does is always amazing, and I really like it.

  • @naso_g
    @naso_g หลายเดือนก่อน +24

    That was interesting thank you! It's pretty crazy how you can read HEX like another language, pretty cool.

    • @klafbang
      @klafbang หลายเดือนก่อน +15

      It becomes quite easy after a bit as it has been structured for being semi-readable. 0 is 0x30, A is 0x41, a is 0x61. You just read digits as "whats after 0x3" and letters as "what's after 0x4, 0x5 or equivalently 0x6, 0x7". Space and the most common punctuation you easily pick up as "before the numbers or between numbers and letters" with space = 0x20.

  • @gregorymccoy6797
    @gregorymccoy6797 หลายเดือนก่อน +1

    This is the content I need from TH-cam. Thanks so much for bringing us along.

  • @certifiedskillissues
    @certifiedskillissues หลายเดือนก่อน +11

    it's a beautiful morning when you post Ben!

  • @SsekiddeEdrine
    @SsekiddeEdrine 26 วันที่ผ่านมา +2

    Ben u are my cyber motivator

  • @akaHarvesteR
    @akaHarvesteR หลายเดือนก่อน +29

    This was jaw droppingly amazing 🤯
    Mind that if you followed along since the beginning of the b breadboard computer series, We've watched Ben basically reinvent modern computing, from bits of wire and transistors, to evaluating formatted strings in software.
    We need an international holiday to celebrate this man!

    • @smallduck1001001
      @smallduck1001001 หลายเดือนก่อน

      Ben starts at a big step up though, with a 6502 processor. There are few people making videos chronicling creation of custom CPUs on breadboards out of simple logic chips. My current favorite is @fabianschuiki www.youtube.com/@fabianschuiki/videos he's now replacing components he's done on breadboards with custom circuit boards (with some tiny surface mounted components he solders himself), cleaning it up in preparation for some more fancy instruction decoding to come which I personally can't wait to see.

    • @akaHarvesteR
      @akaHarvesteR หลายเดือนก่อน +2

      @smallduck1001001 that's why I mentioned the breadboard computer series. The 6502 CPU only makes sense after you watch that.

  • @tekk3213
    @tekk3213 หลายเดือนก่อน +5

    What a nice day this is getting new Ben Eater video!

  • @jatinkrumkar7689
    @jatinkrumkar7689 หลายเดือนก่อน +3

    when bad times hit this guy posts a video and then the time is no longer bad you just amazing!!

  • @Desincarnage
    @Desincarnage หลายเดือนก่อน +5

    A new Ben Eater video! What a wonderful day :D

  • @chrissachs7713
    @chrissachs7713 หลายเดือนก่อน +2

    Please do a video on floating point numbers! Your videos and kits (I've built the 6502) have satisfied so many lifelong curiosities of mine. I have a working programmer's knowledge of floating point, NaNs, ULPs, etc. But I feel like I'm missing the intuitive/historical/fundamental picture-why they are the way they are, how they got that way, and why it makes sense-that your videos always satisfyingly provide. Please keep it up!

  • @krzysztofhennig
    @krzysztofhennig หลายเดือนก่อน +4

    Hi, if you are looking for a really cheap soundcard, you can use a 555 timer with few resistors connected via their respective mosfets to pin 7 to control the PWM cycle time. Each resistor/mosfet pair gives us 2 new frequency combinations. With 4 resistors/mosfets pairs you will get 16 frequencies. That would sound like a buzzers from 80s :) If you wish, you can even use PCF8574 to control the cycle time via I2C. Good luck!

  • @solcloud
    @solcloud หลายเดือนก่อน +1

    Thank you for video Ben

  • @gcewing
    @gcewing หลายเดือนก่อน +1

    I think you're right about FRM standing for "formula". If I remember rightly, in Applesoft, if you wrote a deeply-nested expression that overflowed the evaluation stack, the error message you got was "FORMULA TOO COMPLEX".

  • @lefteriseleftheriades7381
    @lefteriseleftheriades7381 หลายเดือนก่อน +9

    Mad respect, you are one of the best on youtube

  • @RegisMichelLeclerc
    @RegisMichelLeclerc หลายเดือนก่อน +12

    I confirm the space before a positive number is for the sign, I think you passed on that code in the string construction. There was also a test for the comma that simulates a tab. However, later versions of basic also had a "print using" command (Amstrad) similar to C's "printf()" or "print@" (Oric) that included cursor positioning in the same command.

    • @mikefochtman7164
      @mikefochtman7164 หลายเดือนก่อน +2

      Agree. space vs minus sign was common in FORTRAN as well (another old language lol). FORTRAN had options where you could force a "+" sign instead of space.

    • @MadScientist267
      @MadScientist267 หลายเดือนก่อน

      That used to drive me nuts formatting the screen.. less so of course as the workarounds became habit. It always made for gaps next to numbers unless you went back over the screen with whatever got overwritten. Not really a thing in "productivity" but say in games or anything with graphics, you had to account for it being there haha

  • @manlyhallresearch9785
    @manlyhallresearch9785 19 วันที่ผ่านมา +1

    Yes, do a separate video about floating point numbers.

  • @zac9176
    @zac9176 หลายเดือนก่อน

    Hey Ben! I've been loving your content since your first releases of the 8-bit CPU you made. I'd love to see a dive into more RISC architectures, whenever you start to finish up the 6502 series. I've developed a few RISC CPUs myself, with some great help of your explanations, and would love to see my favorite Comp-Sci creator touch a few topics a bit closer to my knowledge!

  • @adriansnow5087
    @adriansnow5087 หลายเดือนก่อน +2

    Superb - really enjoyed watching that.

  • @HipsterBaby747
    @HipsterBaby747 หลายเดือนก่อน +2

    Ben eater’s original videos nerd sniped me so hard I got a masters in computer engineering.
    I still love these videos and learn something every upload

  • @mikefochtman7164
    @mikefochtman7164 หลายเดือนก่อน +44

    Hmmm "82C00000" is NOT modern IEEE-754 flt point for 3.0. That would be 0x40400000 I remember using another system that also represented floating point in an odd way called "Excess-64". I suppose before floating point machine instructions were standardized, vendors were free to come up with each unique format.

    • @nikkiofthevalley
      @nikkiofthevalley หลายเดือนก่อน +4

      Yeah, that confused me there. It is still the same basic (pun very much intended) idea, just done slightly differently.

    • @dkosmari
      @dkosmari หลายเดือนก่อน +22

      That's exactly how the history of floating-point formats played out. Each vendor had their own format and conventions, some even had design bugs. Some engineers even went as far as saying "you don't need floating-point, any mathematician worth their salt will know where the point is supposed to be." Some threatened to boycott the standard unless it matched the hardware they themselves were already selling to clients (such as government, military, banks, etc.) It was one of the biggest dramas in the computer industry up to that point. Needless to say, IEEE-754 left a lot of vendors unhappy, we almost didn't get a floating-point standard at all.

    • @phirenz
      @phirenz หลายเดือนก่อน +6

      Microsoft's floating point is actually really close to IEEE-754, especially for single-precision.
      Bias is 128 instead of 127, and the sign bit is moved from bit 31 to bit 23. Moving the sign bit means the 8-bit exponent is now aligned with the first byte. The IEEE-754 format would require some awkward bitshifting.

    • @foo0815
      @foo0815 หลายเดือนก่อน +1

      Note that MS Basic floating point numbers actually are 5 bytes long, first byte is biased exponent, next 4 bytes is mantissa in BIG endian format, leading 1 bit explicit. Also IEEE special formats like inf, nan and subnormals are not supported.

    • @MonochromeWench
      @MonochromeWench หลายเดือนก่อน +6

      MS Basic uses the MBF floating point system created by Monte Davidoff in 1975. It predates IEEE754 by 10 years

  • @chrisdixon5241
    @chrisdixon5241 หลายเดือนก่อน

    FAC is definitely standing for Floating point ACcumulator.
    If I remember correctly, the C64 has both FAC and FAC2, but I had no idea they were "repurposed" for printing strings!
    Excellent video!

  • @RoSi4You
    @RoSi4You หลายเดือนก่อน +3

    I will never follow or understand any of this, but I am fascinated, how clever you are. Hats off.

    • @MadScientist267
      @MadScientist267 หลายเดือนก่อน +1

      I grew up on the 8088 which is different but close enough to this to call it... I remember thinking everything happening inside that box was just pure magic... and before it was over had basic and qbasic doing handstands lol... seeing the infrastructure under the hood and what made all of it tick is a wild blast from the past. I still have trouble following along with some of the assembly but still wild to watch as each block of this thing lays the foundation for the ones to follow. I'm strongly considering getting one of the kits just to play around with. Certainly *waaay* cheaper than the box I'd have otherwise needed to modify to really get my head around the hardware.

  • @chriswalker2753
    @chriswalker2753 หลายเดือนก่อน +3

    Brilliant! Takes me back to my early days on a 6502 machine. IIRC the comma and semicolon are used to modify formatting. Comma allows printing a separated list of things. Semicolon at the end prevents a newline. I think you can also use semicolon to suppress the space prepended to positive numbers.

    • @melkiorwiseman5234
      @melkiorwiseman5234 หลายเดือนก่อน +1

      Comma is used to say "advance to the next tab stop before printing the next thing" while semicolon is used to say "print the next thing immediately after the previous thing". Without either, it advances to the start of the next line before printing the next thing.

    • @MadScientist267
      @MadScientist267 หลายเดือนก่อน

      Semicolon did a few things in basic... I learned it as "(prepare to) append", preventing CRLF from running at the end of a print statement... similar to concatenate strings.. and in GW/Quick (at least) it would also dump the question mark at an input prompt, allowing you to change it to whatever you wanted within the prompt instead.
      Long time ago haha might be more uses but that's all that comes to mind at the moment.
      Edit: I've never heard of it dumping the leading space for a number, or I've forgotten lol, but that would have been nice to know many many years ago 🤣

  • @der.Schtefan
    @der.Schtefan หลายเดือนก่อน +3

    8-bit show and tell has a lot of explanations how the C64, which uses a modified version of Microsoft Basic, works internally, especially with stuff like this. It is fascinating to see. It also applies very well if you want to modify Microsoft Basic on this project.

  • @ExpressoMechanicTV
    @ExpressoMechanicTV หลายเดือนก่อน +1

    Fascinating stuff - many thanks for doing this!

  • @StevenHokins
    @StevenHokins 25 วันที่ผ่านมา

  • @chromosundrift
    @chromosundrift หลายเดือนก่อน +2

    Yes Ben I found that interesting. As usual!

  • @Keys_9914
    @Keys_9914 หลายเดือนก่อน

    I am glade to see another video ! Sometimes I get worried that it may be the last time you upload .... 😅😂

  • @DavidLatham-productiondave
    @DavidLatham-productiondave หลายเดือนก่อน +2

    Oh man. A video on floating point in 6502 would be awesome!

  • @DavidLindes
    @DavidLindes หลายเดือนก่อน

    Wild. Fun stuff; thank you for sharing your explorations!

  • @alaksiej5913
    @alaksiej5913 หลายเดือนก่อน +3

    This is Microsoft Binary Format (MBF). Ask Mr. Google for more info. HEX 82 C0 00 00 00 = BIN 1000 0010 (exponent) 0 (sign) 110 0000 0000 0000 (mantissa) => BIN +0.11 * (10 pow (1000 0010 - 1000 0000)) = DEC 0.75 * (2 pow 2) = DEC 3

  • @hamzawali2893
    @hamzawali2893 หลายเดือนก่อน +53

    HES BACK 🎉🎉🎉

  • @jeffreyholtmyer5012
    @jeffreyholtmyer5012 หลายเดือนก่อน +1

    An I2C interface to a serial flash rom for storage would be an awesome next video.

  • @DW-indeed
    @DW-indeed หลายเดือนก่อน +1

    Any day with a Ben Eater video is a good day... Though it reminds me again that I haven't done anything on my Acorn Electron build for a lot of months now... life, man 🙄

  • @adrianocamargo3193
    @adrianocamargo3193 หลายเดือนก่อน

    A big yes to floating point numbers video!

  • @mrbrianparker
    @mrbrianparker หลายเดือนก่อน

    Fascinating as always. I would also be interested if you do a floating point video.

  • @jeffreyholtmyer5012
    @jeffreyholtmyer5012 หลายเดือนก่อน

    Very interesting, I very much like seeing how to work with assembly code. Your videos are Bothe entertaining and educational. Thank you very much.

  • @BrainSlugs83
    @BrainSlugs83 หลายเดือนก่อน

    Those edge cases of semicolon and comma are important for printing multiple variables and literals together, and whether or not to put a carriage return, nothing, or a tab at the end of the string.

  • @msmith2961
    @msmith2961 หลายเดือนก่อน +1

    Ben Eater videos are why i bought a clicky keyboard 😂

  • @staswisniewski4101
    @staswisniewski4101 หลายเดือนก่อน +3

    Babe, wake up, new Ben Eater's video just dropped

  • @DocM221
    @DocM221 หลายเดือนก่อน +1

    I think you should natively support keyboards and text to LCD to make the whole computer self contained!!

  • @hotrodhunk7389
    @hotrodhunk7389 หลายเดือนก่อน +1

    What a great Saturday! Great morning with my family. Now a Ben eater video?

  • @yazidkeraichia2858
    @yazidkeraichia2858 หลายเดือนก่อน +1

    Great thanks ❤❤❤

  • @Lord-Sméagol
    @Lord-Sméagol หลายเดือนก่อน

    It's easy 'reverse engineering' BASIC when you have the source code :)
    I had to first make my own source code for Nascom ROM BASIC by disassembling it in 1981!
    I can't remember finding any serious Microsoft bugs, except that they assembled it for 8080 and not Z80.
    There were some bugs in the routines that Nascom added, but nothing that broke it when using the T4 or NAS-SYS monitor ROMs.
    There was a bug in LIST where it would expand characters 80-FF to reserved words when they were string literals.
    This was funny when I let Computer & Video Games magazine include my Nimbot game as a type-in listing.
    I was using DATA and PRINT statements with block graphic characters in quotes.
    They didn't even contact me to fix it before publishing, they just printed the listing, which would have been a real pain for people to get working properly!

    • @Lord-Sméagol
      @Lord-Sméagol หลายเดือนก่อน

      Another problem I found with Nascom BASIC was with strings.
      When a large number of strings was active, such as a string array with many elements, and many changes have been made to those strings, this would trigger a 'garbage collection' which shifted all the active string data down to leave a single region of free memory.
      The algorithm was very inefficient; It searched all string variables to find the string in the lowest address in memory that needed to be moved down to release the unused memory.
      For each of N strings, it would have to search through those N strings to find the lowest one to move.
      This would need N*N checks, which could stall your program for a very long time ... I managed to get > 1 hour!!!

  • @globalfarkndalk4540
    @globalfarkndalk4540 หลายเดือนก่อน +1

    wunderbar

  • @mxlje
    @mxlje หลายเดือนก่อน +2

    „Hopefully you found that interesting“ - oh yes, most definitely.

  • @simonepernice8059
    @simonepernice8059 หลายเดือนก่อน +1

    Great content, thank you very much!!! Could you make a video on floating point, please?

  • @CraftMine1000
    @CraftMine1000 หลายเดือนก่อน

    Always a good day when Ben posts

  • @ovalteen4404
    @ovalteen4404 หลายเดือนก่อน

    The string format in MS BASIC is also continued in BASIC for the IBM PC. If you call varptr(s$), the returned pointer is that 3-byte structure with the length and the pointer to the string data. So apparently you can still learn a lot about older MS BASIC by looking at the appendix of the IBM BASIC manual from the PC/XT days.

    • @MonochromeWench
      @MonochromeWench หลายเดือนก่อน

      Microsoft used a shared codebase for all versions of Microsoft BASIC. So the basic data structures are the same for all of them regardless of platform. The open sourced GW Basic source has extensive comments explaining how things work but other than the more detailed comments the x86 assembly of GW Basic wont really be any easier to understand than the 6502 code here.

    • @ovalteen4404
      @ovalteen4404 หลายเดือนก่อน

      @@MonochromeWench I was speaking of the IBM BASIC users manual though. The appendix has a lot of info about internals, such as memory organization and variable formats.

  • @dacomputernerd4096
    @dacomputernerd4096 หลายเดือนก่อน

    Ooo new video
    If you're still doing videos on communication protocols, I'd love to see one on I2C

  • @MissNorington
    @MissNorington หลายเดือนก่อน +3

    Please, do floating point numbers video: I think you would be able to explain it in a different (better) way compared to others on TH-cam

  • @luckyizzac
    @luckyizzac หลายเดือนก่อน +2

    Benny is back❤

  • @KryllyxOfficial
    @KryllyxOfficial หลายเดือนก่อน

    15:42 I can't speak for other people, but that'd be an awesome video!

  • @DanHowardMtl
    @DanHowardMtl หลายเดือนก่อน

    I would LOVE a video on floating point. I never understood how they could get even basic floating point math to work in 8 bits.

  • @somethinggeeky
    @somethinggeeky หลายเดือนก่อน +1

    Hot swapping ROMs, wild man 👍😎

  • @mikesz-_-
    @mikesz-_- หลายเดือนก่อน +1

    Bro u made my life danke schön

  • @northcoast7184
    @northcoast7184 หลายเดือนก่อน

    Thank you Ben.

  • @GameBacardi
    @GameBacardi หลายเดือนก่อน

    Good video, thank you again

  • @SpaceMyName
    @SpaceMyName หลายเดือนก่อน

    BASIC mentioned! 🥳

  • @MrMassaraksh
    @MrMassaraksh หลายเดือนก่อน

    Thank you!

  • @billyhart3299
    @billyhart3299 หลายเดือนก่อน

    Yes please do a video on floating point numbers

  • @tsuom
    @tsuom หลายเดือนก่อน +2

    this is so cool

  • @TheStickCollector
    @TheStickCollector หลายเดือนก่อน +2

    It would be cool to make a programming language that can run basic commands (or is built around basic) would be a good way to get into programming.

    • @badstate
      @badstate หลายเดือนก่อน +2

      BASIC is a programming language that can run BASIC commands. I guess I'm missing your point.

  • @MangoJones139
    @MangoJones139 หลายเดือนก่อน +2

    20:55 Isn't the range from $0100 to $01FF the stack area? This feels like a bug in the BASIC interpreter that could cause corruption if the stack is almost full, but probably rare to actually cause problems.

    • @smallduck1001001
      @smallduck1001001 หลายเดือนก่อน +2

      Maybe those bytes got there by being pushed onto the stack?

    • @gsittly
      @gsittly 15 วันที่ผ่านมา +1

      I looked into eval.s and there you can see that the intermediate steps of each numerical operation are stored onto the stack. It leaves the result there to get fetched for display or storing.

  • @boretrk
    @boretrk หลายเดือนก่อน +4

    OK, but you don't check for 0-length strings so what happens if you do LCDPRINT "" ?

  • @bobvines00
    @bobvines00 หลายเดือนก่อน

    Here's another vote for a video on floating point programming(?). Thumbs up!

  • @ed_halley
    @ed_halley หลายเดือนก่อน

    A whole video on IEEE 754 would be cool. I think the FAC would be the F from FRMEVL, or Formula.

  • @hisarharyana840
    @hisarharyana840 หลายเดือนก่อน

    Love you sir ❤

  • @Sfaxx
    @Sfaxx หลายเดือนก่อน

    Oh how I would love to see float (or maybe fixed?) point number video😊

  • @willembeltman
    @willembeltman หลายเดือนก่อน

    I just love your videos

  • @DmitryKandiner
    @DmitryKandiner หลายเดือนก่อน +2

    15:45 Looks much more like a fixed point number for me.

  • @minirop
    @minirop หลายเดือนก่อน +1

    first time I see one of Ben's video with fewer than 1,000 views :O

  • @KaziNazmulYT
    @KaziNazmulYT หลายเดือนก่อน

    Dear sir, take love from Bangladesh

  • @YaroKasear
    @YaroKasear หลายเดือนก่อน

    I'd like both a floating point video, and maybe a transition into using the C functionality of cc65.

  • @rabbit10001
    @rabbit10001 5 วันที่ผ่านมา +1

    Lets vote for a Discord Server of Ben Eater 😂

  • @rick_.
    @rick_. หลายเดือนก่อน +2

    Q: FOUT calls a different string print routine that includes FREEFAC. You are always calling FREEFAC. FAC isn't loaded for strings, so won't calling FREEFAC unnecessarily result in bad things happening?

  • @OscarSommerbo
    @OscarSommerbo หลายเดือนก่อน +1

    Your guess is correct FAC is indeed the floatingpoint accumulator. Or at least it is on the C64

    • @gabrielsroka
      @gabrielsroka หลายเดือนก่อน

      yes, C64 also uses Microsoft BASIC.

  • @Chems7308
    @Chems7308 หลายเดือนก่อน +1

    Very awesome

  • @TrapShooter68
    @TrapShooter68 หลายเดือนก่อน

    Thanks, Ben
    The 1st tome thru one of your assembly videos, my brain hurts.
    The 2nd time, a faint light begins to glimmer.
    Subsequent videos make that light just a little brighter each time.
    I think it's getting close to time to order a kit.
    Is Santa's address still "North Pole?"

  • @SebastianSchmidt42
    @SebastianSchmidt42 หลายเดือนก่อน

    There is a commented disassembly of the Applesoft BASIC available from the page at the third credit link in the Microsoft BASIC Github repo. (TH-cam keeps deleting my comment if I put a link here 😕). It confirms that FAC is the "MAIN FLT PT ACCUMULATOR" (S.DEFINITIONS) and it has commented PRINT (S.DACF) and FRMEVL (S.DD7B) routines. There is a comment at E102 (E103 jumps to FRMNUM, which calls FRMEVL and checks that the result is numeric) saying "EVALUATE NUMERIC FORMULA AT TXTPTR", so Formula Evaluate sounds right, too.

  • @artefox0
    @artefox0 หลายเดือนก่อน

    I would love a video on floating point numbers

  • @bluegrass542
    @bluegrass542 16 วันที่ผ่านมา

    I would low to see a sound card built!!! Please do a video on that.

  • @talmeron6593
    @talmeron6593 หลายเดือนก่อน

    i would love to see a floating point video!

  • @DigitLineEletronica
    @DigitLineEletronica หลายเดือนก่อน +1

    WOW... fantastic

  • @AthyDragoness
    @AthyDragoness หลายเดือนก่อน +2

    dumping a bunch of print statements into a function in the hopes of finding something helpful. good to know I'm not alone.

  • @TheIvalen
    @TheIvalen หลายเดือนก่อน

    “Hopefully you found that interesting”. You kidding, found it fascinating.

  • @stevetodd7383
    @stevetodd7383 หลายเดือนก่อน +1

    From memory, FAC is the floating point accumulator.

    • @gabrielsroka
      @gabrielsroka หลายเดือนก่อน

      correct. a quick Google would've confirmed it for Ben. eg, the C64 Wiki has a short entry about it.