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..
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.
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.
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!
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.
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.
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!
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.
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!
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!
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.
Binary representation of floating point numbers breaks my head. I kinda get it, but it is hard. Read the IEEE standard for floating point numbers, everything makes sense, until you start trying to convert numbers in your head. That's where my brain goes
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.
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.
The aseembler is some software you can grab off the website, but to write to the eeprom youll need a programmer, which is sold separately. If im completely honest the price Ben charges for one is a little high, but seems good quality
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.)
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, tax, beq lcd_print_exit
Yes, floating point video please
YES YES YES pretty please
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..
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
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.
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.
this
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!
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.
Floating point, YES! There's so little written or explained about it.
HES BACK 🎉🎉🎉
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.
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!
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.
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!
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.
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!
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.
Mad respect, you are one of the best on youtube
I will never follow or understand any of this, but I am fascinated, how clever you are. Hats off.
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.
What a nice day this is getting new Ben Eater video!
Wild. Fun stuff; thank you for sharing your explorations!
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
Fascinating stuff - many thanks for doing this!
Binary representation of floating point numbers breaks my head. I kinda get it, but it is hard. Read the IEEE standard for floating point numbers, everything makes sense, until you start trying to convert numbers in your head. That's where my brain goes
Fascinating as always. I would also be interested if you do a floating point video.
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.
HES BAAAAAACK
Great thanks ❤❤❤
Your guess is correct FAC is indeed the floatingpoint accumulator. Or at least it is on the C64
OK, but you don't check for 0-length strings so what happens if you do LCDPRINT "" ?
Bro u made my life danke schön
Yes please do a video on floating point numbers
Good video, thank you again
this is so cool
Thank you Ben.
BASIC mentioned! 🥳
Babe, wake up, new Ben Eater's video just dropped
Benny is back❤
Oh man. A video on floating point in 6502 would be awesome!
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.
Does it also evaluate string concatenation, and interpret "," and TAB for tabulation?
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)
I just love your videos
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.
I'm curious to kearn more about the circuitry needed to do computations with floats. What does a FP adder look like?
when bad times hit this guy posts a video and then the time is no longer bad you just amazing!!
Always a good day when Ben posts
Eater Alert 👍
Very awesome
the king is alive
A new Ben Eater video! What a wonderful day :D
A whole video on IEEE 754 would be cool. I think the FAC would be the F from FRMEVL, or Formula.
15:45 Looks much more like a fixed point number for me.
WOW... fantastic
Oh how I would love to see float (or maybe fixed?) point number video😊
Ooo new video
If you're still doing videos on communication protocols, I'd love to see one on I2C
I would love a video on floating point numbers
Do you include the 65C02 assembler in your kits?
The aseembler is some software you can grab off the website, but to write to the eeprom youll need a programmer, which is sold separately. If im completely honest the price Ben charges for one is a little high, but seems good quality
I am jee aspirant, and I love to do what you do but , i haven't resources
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.
I would be interested to see how it is reserving and freeing memory works there.
I'd like both a floating point video, and maybe a transition into using the C functionality of cc65.
Did that BASIC only have 3 data types? Like floating point number, string literal and pointer?
FRMEVL is , of course, FRoMEViL... It is used everytime input arguments are passed from MSBasic into assembly /s
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?"
You could fold the conditional includes instead of temporarily deleting them. 😊
Hot swapping ROMs, wild man 👍😎
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.
What a great Saturday! Great morning with my family. Now a Ben eater video?
Hey ben☺️
BEN EATER UPLOADDDDDD
Should have a look at Acorn's BBC Basic, though.
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.)
Cool 👍
yes floating point please
oh cool
Woot!
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
Engagement driving comment right here
„Hopefully you found that interesting“ - oh yes, most definitely.
Yup, you've run into Microsoft BASIC's string garbage collection. :)
idk, seems kinda basic to me
not basic, BASIC
@saulmighty same difference lol
it's only kinda basic, but is fully BASIC
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.
@@samuelhulme8347 32K RAM is far too small for Doom, so first you'd need to implement bank switching, to select between different memory pages.
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”
@@samuelhulme8347 that's a _videocard_ not a _GPU_
Er.. 6*9 is 42
Frmevl From Evil 😂
Please create the video on floating point representation, your analogies and method of explaining makes things too clear... !
19-20th comment
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 🍿😎👍
Dad comeback with the milk
First! 😍
first
nobody cares
TH-camPRINT “first”