Reverse engineering Microsoft BASIC

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

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

  • @a1k0n
    @a1k0n 5 часов назад +135

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

  • @sirnukesalot24
    @sirnukesalot24 6 часов назад +112

    Yes, floating point video please

    • @akaHarvesteR
      @akaHarvesteR 5 часов назад +2

      YES YES YES pretty please

  • @moshly64
    @moshly64 6 часов назад +63

    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 5 часов назад +3

      That sounds like the best approach to do this

  • @Aresydatch
    @Aresydatch 6 часов назад +127

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

    • @frankowalker4662
      @frankowalker4662 3 часа назад +9

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

    • @evilotis01
      @evilotis01 3 часа назад +3

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

    • @RynCarmichael
      @RynCarmichael Час назад +5

      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 20 минут назад +1

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

    • @RynCarmichael
      @RynCarmichael 16 минут назад

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

  • @Lemonator321
    @Lemonator321 7 часов назад +96

    Intel has been real quiet since this dropped

  • @bcarlisle2575
    @bcarlisle2575 7 часов назад +26

    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.

  • @hamzawali2893
    @hamzawali2893 7 часов назад +50

    HES BACK 🎉🎉🎉

  • @euromicelli5970
    @euromicelli5970 5 часов назад +4

    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.

  • @zirize
    @zirize 4 часа назад +10

    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.

  • @naso_g
    @naso_g 6 часов назад +9

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

    • @klafbang
      @klafbang 4 часа назад +3

      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.

  • @chriswalker2753
    @chriswalker2753 5 часов назад +2

    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.

  • @akaHarvesteR
    @akaHarvesteR 6 часов назад +16

    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!

  • @15743_Hertz
    @15743_Hertz Час назад +2

    Floating point, YES! There's so little written or explained about it.

  • @mikefochtman7164
    @mikefochtman7164 6 часов назад +19

    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 5 часов назад +2

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

    • @dkosmari
      @dkosmari 4 часа назад +7

      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.

  • @RegisMichelLeclerc
    @RegisMichelLeclerc 6 часов назад +6

    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 6 часов назад +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.

  • @RoSi4You
    @RoSi4You 2 часа назад +1

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

  • @blazernitrox6329
    @blazernitrox6329 3 часа назад +1

    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.

  • @clonkex
    @clonkex 2 часа назад +1

    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.

  • @certifiedskillissues
    @certifiedskillissues 7 часов назад +9

    it's a beautiful morning when you post Ben!

  • @zockex6424
    @zockex6424 7 часов назад +5

    heck yea this is what makes my brain tingle

  • @der.Schtefan
    @der.Schtefan Час назад +1

    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.

  • @lefteriseleftheriades7381
    @lefteriseleftheriades7381 7 часов назад +6

    Mad respect, you are one of the best on youtube

  • @krzysztofhennig
    @krzysztofhennig 24 минуты назад

    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!

  • @tekk3213
    @tekk3213 7 часов назад +3

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

  • @yazidkeraichia2858
    @yazidkeraichia2858 2 часа назад +1

    Great thanks ❤❤❤

  • @mrbrianparker
    @mrbrianparker 4 часа назад

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

  • @billyhart3299
    @billyhart3299 4 часа назад

    Yes please do a video on floating point numbers

  • @ExpressoMechanicTV
    @ExpressoMechanicTV 5 часов назад

    Fascinating stuff - many thanks for doing this!

  • @MissNorington
    @MissNorington 5 часов назад +2

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

  • @DavidLatham-productiondave
    @DavidLatham-productiondave 3 часа назад

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

  • @staswisniewski4101
    @staswisniewski4101 6 часов назад +3

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

  • @tsuom
    @tsuom 7 часов назад +2

    this is so cool

  • @CraftMine1000
    @CraftMine1000 2 часа назад

    Always a good day when Ben posts

  • @northcoast7184
    @northcoast7184 5 часов назад

    Thank you Ben.

  • @artefox0
    @artefox0 2 часа назад

    I would love a video on floating point numbers

  • @ed_halley
    @ed_halley 12 минут назад

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

  • @dacomputernerd4096
    @dacomputernerd4096 3 часа назад

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

  • @willembeltman
    @willembeltman 3 часа назад

    I just love your videos

  • @luckyizzac
    @luckyizzac 7 часов назад +2

    Benny is back❤

  • @mikesz-_-
    @mikesz-_- 6 часов назад +1

    Bro u made my life danke schön

  • @Chems7308
    @Chems7308 7 часов назад +1

    Very awesome

  • @TheStickCollector
    @TheStickCollector 7 часов назад +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 часа назад +1

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

  • @GameBacardi
    @GameBacardi 5 часов назад

    Good video, thank you again

  • @Sfaxx
    @Sfaxx 5 часов назад

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

  • @ET_gamer13yt
    @ET_gamer13yt 7 часов назад +2

    the king is alive

  • @SpaceMyName
    @SpaceMyName 6 часов назад

    BASIC mentioned! 🥳

  • @cheeseparis1
    @cheeseparis1 4 часа назад

    Oh yes, the space in front of positive numbers, I remember this... and the mid$ instruction to get rid of it in programs where it was not needed, aka most of the times.

  • @YaroKasear
    @YaroKasear 4 часа назад

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

  • @OscarSommerbo
    @OscarSommerbo 5 часов назад

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

  • @hotrodhunk7389
    @hotrodhunk7389 6 часов назад

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

  • @DigitLineEletronica
    @DigitLineEletronica 7 часов назад +1

    WOW... fantastic

  • @DW-indeed
    @DW-indeed Час назад

    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 🙄

  • @KaziNazmulYT
    @KaziNazmulYT 5 часов назад

    Dear sir, take love from Bangladesh

  • @minirop
    @minirop 7 часов назад +1

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

  • @TheIvalen
    @TheIvalen 3 часа назад

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

  • @Desincarnage
    @Desincarnage 5 часов назад

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

  • @TrapShooter68
    @TrapShooter68 54 минуты назад

    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?"

  • @MattyEngland
    @MattyEngland 7 часов назад +4

    Eater Alert 👍

  • @LightslicerGP
    @LightslicerGP 2 часа назад

    HES BAAAAAACK

  • @a_pi_guy
    @a_pi_guy 5 часов назад

    BEN EATER UPLOADDDDDD

  • @FrancisFjordCupola
    @FrancisFjordCupola 5 часов назад

    Should have a look at Acorn's BBC Basic, though.

  • @jatinkrumkar7689
    @jatinkrumkar7689 6 часов назад

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

  • @morlanius
    @morlanius Час назад

    I would be interested to see how it is reserving and freeing memory works there.

  • @dj10schannel
    @dj10schannel Час назад

    Cool 👍

  • @failgun
    @failgun Час назад

    I'm curious to kearn more about the circuitry needed to do computations with floats. What does a FP adder look like?

  • @SMahanta2001
    @SMahanta2001 7 часов назад +2

    Hey ben☺️

  • @markwesterlund971
    @markwesterlund971 Час назад

    You could fold the conditional includes instead of temporarily deleting them. 😊

  • @DmitryKandiner
    @DmitryKandiner 6 часов назад +1

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

  • @rahulkushwaha9500
    @rahulkushwaha9500 6 часов назад

    yes floating point please

  • @bgreenacre42
    @bgreenacre42 6 часов назад

    Post your vimrc! Put it on gist or something. I'm just curious what you have set for what looks like a basic vim setup.

  • @rwired
    @rwired 6 часов назад

    Does it also evaluate string concatenation, and interpret "," and TAB for tabulation?

  • @catlover281
    @catlover281 3 часа назад

    oh cool

  • @unclerojelio6320
    @unclerojelio6320 6 часов назад

    Woot!

  • @frankowalker4662
    @frankowalker4662 3 часа назад

    That's great work. One question though, why do you call $ Dollar when it really means Strings in computer terms ? (As in A Strings, not A Dollar).
    (Sorry if this seems rude, it's just that I've noticed a lot of people do it, and I don't know why.)

  • @boretrk
    @boretrk 6 часов назад +1

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

  • @IanHickson
    @IanHickson 3 часа назад

    does there need to be any error handling or is that handled elsewhere? (e.g. if you try to add a string to a number in the lcdprint arguments)

  • @parthenocarpySA
    @parthenocarpySA 7 часов назад +2

    Engagement driving comment right here

  • @Avinash_578
    @Avinash_578 5 часов назад +1

    I am jee aspirant, and I love to do what you do but , i haven't resources

  • @Wayde-VA3NCA
    @Wayde-VA3NCA Час назад

    FRMEVL is , of course, FRoMEViL... It is used everytime input arguments are passed from MSBasic into assembly /s

  • @tschak909
    @tschak909 5 часов назад

    Yup, you've run into Microsoft BASIC's string garbage collection. :)

  • @MangoJones139
    @MangoJones139 Час назад

    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.

  • @stefankrause5138
    @stefankrause5138 7 часов назад +1

    Instant Like! (And I'm not easy....)

    • @akaHarvesteR
      @akaHarvesteR 6 часов назад

      Ben is in the exceedingly rare category of channels where I hit like even before I hit play

  • @Elia90570
    @Elia90570 3 часа назад

    hey ben, please, somehow get this this to run doom, i know that everyone will love it if you can somehow do that

    • @samuelhulme8347
      @samuelhulme8347 Час назад

      A character based LCD (or serial console) won’t be enough) some kind of graphics drive is needed.
      Ben has made his own graphics card at some point which means he can connect that with the 6502.
      Then Doom’s source code would need to be modified a lot, as it uses a lot utilities from an operating system, or an existing operating system could be ported.
      Then some kind of input device is required, which luckily Ben has worked with Keyboards already.
      This means we have all the required hardware made, all we need to do is make all the software work together with the hardware.

  • @pvc988
    @pvc988 4 часа назад

    Did that BASIC only have 3 data types? Like floating point number, string literal and pointer?

  • @deltakid0
    @deltakid0 6 часов назад

    Build a hardware multiplier with 74 IC series and a mini-GPU after that!!! Please!!!

    • @johnm2012
      @johnm2012 6 часов назад

      You can build a Wallace tree multiplier from AND gates and adders. You need four registers to hold the multiplier, multiplicand and 16-bit product and a bit of logic to decode their addresses and latch them.

    • @samuelhulme8347
      @samuelhulme8347 Час назад

      He has already made a GPU, check out his “world’s worst graphics card”

  • @DMadHacks
    @DMadHacks 6 часов назад +3

    idk, seems kinda basic to me

    • @saulmighty
      @saulmighty 5 часов назад +1

      not basic, BASIC

    • @DMadHacks
      @DMadHacks 5 часов назад

      @saulmighty same difference lol
      it's only kinda basic, but is fully BASIC

  • @m1geo
    @m1geo 7 часов назад +1

    First! 😍

  • @dmitry.shpakov
    @dmitry.shpakov 7 часов назад +4

    We are witnessing something interesting here. Have you noticed that Ben is building:
    * Ben's ALU
    * Ben's Breadboard COMPUTER
    * Ben's ASM
    * Ben's BASIC
    * ...
    What Next:
    * Ben's OS
    * Ben's WEB
    * Ben's AI
    Where is my popcorn 🍿😎👍

  • @michaelpoulsen9925
    @michaelpoulsen9925 3 часа назад

    Frmevl From Evil 😂

  • @alisaosteam
    @alisaosteam 7 часов назад +1

    19-20th comment

  • @lysy-zn2gg
    @lysy-zn2gg 6 часов назад

    Dad comeback with the milk

  • @avijitdas4030
    @avijitdas4030 4 часа назад

    Please create the video on floating point representation, your analogies and method of explaining makes things too clear... !

  • @v1ctor174
    @v1ctor174 7 часов назад +1

    first

    • @konm08
      @konm08 7 часов назад +1

      nobody cares

    • @steveslevin
      @steveslevin 7 часов назад +2

      RUclipsPRINT “first”

  • @StevenHokins
    @StevenHokins 3 часа назад

    Awesome series, thank you ❤