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.
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..
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.
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.
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.
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.
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.
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!
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.
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.
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.
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.
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.
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.
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!
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.
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 🙄
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?"
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.)
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.
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.
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.
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 🍿😎👍
Minor bug in your print routine: you test the length after decrementing it, so a zero-length string wil print 256 bytes of garbage.
Sounds fun
Heartbleed 6502 edition
Yes, floating point video please
YES YES YES pretty please
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.
That sounds like the best approach to do this
In memory of Thomas Kurtz, inventor of BASIC
1928-2024
Oh. I didn't know Kurtz died.
10 PRINT ":( ";
20 GOTO 10
10 FOR I=1 TO 2
20 PRINT "The horror!"
30 NEXT I
...but seriously, RIP :(
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..
@@RynCarmichael I still program in BASIC on my ZX81 now and then.
@@frankowalker4662 Nice I started on a Sinclair ZX80, with 1K of ram, was fun..
Intel has been real quiet since this dropped
Bill Gates hates this one trick!
😂
MOS Technologies has been raking it in
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.
HES BACK 🎉🎉🎉
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.
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.
That was interesting thank you! It's pretty crazy how you can read HEX like another language, pretty cool.
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.
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.
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!
Floating point, YES! There's so little written or explained about it.
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.
Yeah, that confused me there. It is still the same basic (pun very much intended) idea, just done slightly differently.
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.
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.
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.
I will never follow or understand any of this, but I am fascinated, how clever you are. Hats off.
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.
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.
it's a beautiful morning when you post Ben!
heck yea this is what makes my brain tingle
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.
Mad respect, you are one of the best on youtube
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!
What a nice day this is getting new Ben Eater video!
Great thanks ❤❤❤
Fascinating as always. I would also be interested if you do a floating point video.
Yes please do a video on floating point numbers
Fascinating stuff - many thanks for doing this!
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
Oh man. A video on floating point in 6502 would be awesome!
Babe, wake up, new Ben Eater's video just dropped
this is so cool
Always a good day when Ben posts
Thank you Ben.
I would love a video on floating point numbers
A whole video on IEEE 754 would be cool. I think the FAC would be the F from FRMEVL, or Formula.
Ooo new video
If you're still doing videos on communication protocols, I'd love to see one on I2C
I just love your videos
Benny is back❤
Bro u made my life danke schön
Very awesome
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.
BASIC is a programming language that can run BASIC commands. I guess I'm missing your point.
Good video, thank you again
Oh how I would love to see float (or maybe fixed?) point number video😊
the king is alive
BASIC mentioned! 🥳
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.
I'd like both a floating point video, and maybe a transition into using the C functionality of cc65.
Your guess is correct FAC is indeed the floatingpoint accumulator. Or at least it is on the C64
What a great Saturday! Great morning with my family. Now a Ben eater video?
WOW... fantastic
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 🙄
Dear sir, take love from Bangladesh
first time I see one of Ben's video with fewer than 1,000 views :O
“Hopefully you found that interesting”. You kidding, found it fascinating.
A new Ben Eater video! What a wonderful day :D
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?"
Eater Alert 👍
HES BAAAAAACK
BEN EATER UPLOADDDDDD
Should have a look at Acorn's BBC Basic, though.
when bad times hit this guy posts a video and then the time is no longer bad you just amazing!!
I would be interested to see how it is reserving and freeing memory works there.
Cool 👍
I'm curious to kearn more about the circuitry needed to do computations with floats. What does a FP adder look like?
Hey ben☺️
You could fold the conditional includes instead of temporarily deleting them. 😊
15:45 Looks much more like a fixed point number for me.
yes floating point please
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.
Does it also evaluate string concatenation, and interpret "," and TAB for tabulation?
oh cool
Woot!
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.)
OK, but you don't check for 0-length strings so what happens if you do LCDPRINT "" ?
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)
Engagement driving comment right here
I am jee aspirant, and I love to do what you do but , i haven't resources
FRMEVL is , of course, FRoMEViL... It is used everytime input arguments are passed from MSBasic into assembly /s
Yup, you've run into Microsoft BASIC's string garbage collection. :)
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.
Instant Like! (And I'm not easy....)
Ben is in the exceedingly rare category of channels where I hit like even before I hit play
hey ben, please, somehow get this this to run doom, i know that everyone will love it if you can somehow do that
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.
Did that BASIC only have 3 data types? Like floating point number, string literal and pointer?
Build a hardware multiplier with 74 IC series and a mini-GPU after that!!! Please!!!
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.
He has already made a GPU, check out his “world’s worst graphics card”
idk, seems kinda basic to me
not basic, BASIC
@saulmighty same difference lol
it's only kinda basic, but is fully BASIC
First! 😍
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 🍿😎👍
Frmevl From Evil 😂
19-20th comment
Dad comeback with the milk
Please create the video on floating point representation, your analogies and method of explaining makes things too clear... !
first
nobody cares
RUclipsPRINT “first”
Awesome series, thank you ❤