The update that describes why 4KB of RAM was necessary was interesting to me. In 1998 I wrote a Java Virtual Machine in assembly language for a PIC-like microcontroller that only had 4k of ROM (actually it was 4k instructions, but they were 12-bit words giving 6kB). I managed to get all of the important features of the language to fit, including exception handling and an interactive debugger. However by the end, each time I wanted to add a new instruction to my code I had to find something else to optimize first so it would still fit in 4k.
By the end I convinced myself that 4k was the minimum possible code size for implementing a JVM.
As an aside, the SX microcontroller only had 256 bytes (yes bytes!) of RAM internally so I used an external 32kB SRAM for the Java heap and stack. The 256 bytes of internal RAM held the internal state of the interpreter and memory manager.
Around the same time, I wrote a JVM for the PalmPilot [1]. I think it had to fit into 128K of ram with an additional 256K of memory for data (like the class libraries). I was able to fit the entire JDK 1.0.2 runtime into it by transforming the byte code.
The hardware was interesting too. It bit-banged the video display circuit, leaving only the re-trace interval for general purpose computation, including running BASIC programs. Yet the result was an extremely simple and inexpensive design.
Every early microcomputer had to come up with a solution to the video display problem. As I understand it, the Apple II had a bus architecture that interleaved the clock timing of the video circuit and the CPU, sharing a single bus. The Commodore computers had custom video graphics chips. And so forth.
Reading back over the assembly code gives me fond memories - but I am glad I don't spend my nights debugging my code with an oscilloscope and flashing LEDs anymore. It is a bit more productive coding in Ruby!
The JVM had some limitations to fit into 4k: no floating point, 16-bit integers and no dynamic linking. There was a PC program that took the Java class files, statically linked them and translated the bytecode to a more compressed form for download to the chip.
At the time I wrote this code there was a lot of talk about Java specific processors. Ultimately that was a mistake because Moore's law meant the x86 architecture (and JIT technology) got faster more quickly that anyone could get chips to market.
These days I am about as far from embedded systems as you can get. I write Ruby on Rails code for aha.io. There is a lot of satisfaction in seeing the perfect waveform on your oscilloscope when the assembly code finally works - but these days I think there is much more satisfaction in being able to crank out a complex algorithm with some elegant Ruby and have it being used by customers before going home for dinner.
Well, it was 16 years since I wrote most of this so my memory is a bit fuzzy...
The stack and heap are both stored in an external 32kB SRAM. The stack is accessed simply by pushing and popping using the JVMPush and JVMPop routines around line 4553. The CPU is 8-bit, bit the JVM is 16-bit, so everything takes two operations to write both bytes. You can see the stack frame format at line 48.
Java objects and arrays are allocated on another stack that acts as the heap. Objects are allocate only - they are never freed. This isn't as big a deal as you might think since in embedded applications the code tends to just repeat the same operations over and over so you write your code to reuse the same instances instead of allocating new objects (which is slow anyway).
_do_new on line 2044 allocates a new object. Arrays are allocated at line 1991 in _l_j_newarray.
The nice thing about the JVM (at least version 1 which this implements) is that there are not many variations on operations - and if you statically link you can reduce some of the variations to common cases too.
I had a hunch it might be like this. The embedded Java I did on the Dallas part was using fixed sized arrays.
I'd actually love an annotation for Python that ran it under the null-collector. Lots of times in short run or steady state programs one doesn't generate any garbage and the constant GC or ref count over head could done away with.
Did you look @ the Bob language? It was the spiritual seed for Java by David Betz http://www.xlisp.org/
"In 1967 or 1968, as a senior in high school, our electronics teacher ... arranged for me to go to a company in Sunnyvale (Sylvania) to program a computer because I already knew all the electronics in class at school. Mr. McCollum did this for students with electronics abilities every year, finding local companies with engineers and projects that would let high school students come and and get some experience."
It's amazing that his high school had electronics classes and vocational externships. Is that something that was common at the time or just another amazing aspect of Silicon Valley?
I grew up in a small-to-mid-sized town in California's central valley, east of the Bay Area and SV. We had an electronics class, and as a freshman, I took it.
If you needed parts for a homework assignment, the only store that had them was Radio Shack (yes, they actually sold lots of electronic parts back then). So one day, I meandered into The Shack to get a resistor I needed. Lo and behold, there was a new manager, a guy named Tony. This guy was much friendlier than the previous manager had been. That other manager just tried to get us in and out, apparently presuming we wanted to shoplift or something.
This new guy? Happy to show me the new TRS-80, and though my parents wouldn't pay for one, he scarcely complained as I went back to use it every day for more than a year. I taught myself how to code on that machine, and so I have that freshman electronics class to thank, in part, for my career.
Thanks! I didn't mention the following year, when I discovered that my high school's math club had built a Process Technology Sol-20 from a kit, and that the computer was available to anyone who wanted to use it (after school). I spent the next year using that, even hand-assembling machine language programs. Obviously the computer captured my imagination as a kid. Maybe as an adult, too. :-)
In the late 80s and 90s, you could still find specific electrical parts at Frys in the bay area, but that quickly faded towards the late 90s. The only place that had a continual decent stock of components was Quement Electronics in San Jose. A now, gone era.
A few, but not like it used to be :) When I have some free time, I'd be interested in going back and seeing what would be involved in recreating some of the labs these days. I'm curious how many of the parts are available on amazon.
I had a similar experience only for me in the 70's/80's it was Dick Smith Electronics for parts, and then the Computer Age store with its Apple II and Atari stock .. those were definitely different times. The sales guy even gave me a floppy to save my code on - after school, I'd hurry down there to get a couple hours of free computing time. Man, what a rush.
Similar background, only got hooked on the commodore BBS scene... I'd ride my bmx bike holding a box of floppies to a friends to hack on, with the warm smell of manure rising up through the air. (Turlock)
Cool. My first programming experience was as a high school senior going to the CSU, Stanislaus (Turlock) computer lab to play on the Apple II's, and later on the C-64 in that lab. It was my job to be the "lab assistant" for about 6 months before starting school there. (put paper in the printers, make sure equipment stays in the room, show people where the "on" buttons are)
Yeah, a ride down Monte Vista Ave was a pretty "pastoral" experience.
Going from toying with analog electronics to getting to use an actual computer was pretty exciting, at least for somebody in a rural area who could not afford such toys otherwise. Putting simple graphics into the Apple was a stroke of genius and made it quite an experience to play with.
California used to have amongst the highest per pupil education funding, which started changing in the 70s and is now amongst the lowest in the US. This article explains some of the history http://california-in-crisis.news21.com/node/24
The consequence was "more" available to students and teachers.
High schools in Australia have electronics classes.
When I was in grades 7-9 it was mandatory, then elective after that. We didn't flash chips back then (in the late 90's) but I bet they do now.
We mostly did hands on of making circuit boards (acid etch), and soldering all the components together for simple little circuits. I only stayed in electronics until grade 10, but I know they made some pretty cool stuff in grade 11 and 12.
Wow. We had an elective "electricity" class in high school (small K-12 school in US) and we basically went over Ohm's law and how to use a multimeter. Sounds like you had something closer to what first year EE majors get.
I went on to Study Software Engineering with a minor in Digital Electronics.
In my 5th and final year, I took an electronics class called "Digital Electric Design" which actually turned out to be my only hands-on Electronics course at University. All the EE people were shocked to see me there, as I'd not been in all the same hands-on EE type classes as them for the prior 4 years. (I think we only had Maths in common)
They were more that a little shocked I knew how to use a soldering iron, acid etch bath, multimeter, had the resistor charts memorized etc. etc. Apparently, they'd spend the preceding 4 years learning that at Universtiy which I had learned in high school. (The Australians had learned it in High School too, but my university was majority international students)
I don't know if they kind of back slid over the years, But what you learned in high school sound similar to what I did in high school in the late 70s. I used to love playing with the radio shack electronic experimenters kit with spring terminals and color coded wires too!
> High schools in Australia have electronics classes.
They do? None of those I know (high school 2000 - 2005) in Perth did electronics. We had the usual woodworking/metalworking/art/photography electives, plus drama & music, but no electronics. We also had extremely sub-par computing classes, with no option for a T.E.E level (i.e. contributes to your University entrance score) computing class whatsoever.
I did electronics in year 10 in Perth around that time. It was a pretty neat class, we got to program a PIC as well as learn some basic circuit design stuff.
its an amazing aspect of silicon valley. Back then, it was way different too. Just like steve jobs was able to call the founder of HP in highschool and ended up getting a job there for the summer.
"Just like steve jobs was able to call the founder of HP in highschool and ended up getting a job there for the summer."
There is nothing that unusual about that now except with tech companies or any other company that is the current "belle of the ball" or super large and well known.
The idea is to learn and gain experience not to get some buzz because you have achieved some popular culture dream of working for the same place that millions of others would like to. Sure we'd all like to work at those places. That's the problem.
If you pick any company that is generally off the public radar (and not being fawned over in the press with a celebrity CEO) it is quite possible to send a postal letter to the CEO and have a fair shot of getting a summer job. Or even an email but my feeling is a letter would get more attention and seem more genuine.
Not all the value lies in the usual suspects that have more applicants than they can handle.
A corollary to this goes with low paid jobs. Our offices used to be located near a Walmart. Yet not one time in 9 years to anyone ever come through the door looking for an office or admin or warehouse job. Yet everyday people showed up at the Walmart and got a much lower paying job and (from our pov) much worse working conditions. It's important to put effort in, be creative, and not do what everyone else is doing.
The difference now vs then is that if you were a kid who had heard of HP and wrote a letter because you were that interested in computers, there's an extremely high chance that you would be a good employee in some capacity. Today for every single kid with natural curiosity and potential for working in a tech country there are probably more than 100 that want to work at Facebook just because everyone uses it and it sounds like a good job or career stepping stone.
I was a Junior in high school in Springfield, Oregon and we had classes like these. One was Principles of Technology were we played with wiring houses and oscilloscopes. We also had a robust machine shop with CNC machines. In Principles of tech we had a injection molder. I also took four years of drafting and auto-tech.
So we had the tools in the tenth grade to design a part in autocad in drafting class, take it over to the machine shop and have a CNC machine mill a mold that could then be pushed over to have parts injection molded.
All that is gone now due to cuts in funding.
And for fun we actually had a class to teach people how to be a logger.
Doesn't that piss you off that those types of classes are not around anymore? I'm a bit older, so our machine shop was all manual WW2 surplus lathes and mills. Our well equipped woodshop had a teacher with requisite missing digits.
It's been ~3yrs since I've graduated high school, but my high school (top in the county and an 'A' school in Florida) didn't have any electronics, shop, or computer science classes. I vaguely remember almost taking "Web Development" thinking they would go into PHP or something like that, but apparently they just made small sites on Microsoft Word and played video games the entire class. Such a shame.
So much anger. My sisters boy just turned 21. His dad is a electrician and always stressed that he should do jobs that can't be outsourced. Corey just got a union job for 30 a hour as a carpenter.
I can't speak to other areas but Silicon Valley was definitely like that.
In the 1980s in Palo Alto, my high school AP Computer Science teacher asked parents to come in and give guest lectures in the last few weeks of class. Donald Knuth's daughter was in my class so he came and talked about TeX. Another kid's parent was a VP at a bank; he talked about secure transaction processing for ATMs. My dad (a researcher in robotics and AI) talked about expert systems.
Highschools in Portugal had computing and electronic classes in the late 80's.
I started with electricity concepts and basic circuits in the 7th grade and 8th grade. Sadly had to take mechanic in the 9th as electronic classes were full.
On my last three years (10-12 grade), I switched high school to became a computer technician. We had classes about data structures, programming languages, basic compiler design concepts, DB, network and graphics programming.
I went to a suburban high school in southeast Michigan. My high school had three tracks: College Prep, Business, and Vocational. Electronics was one of the Vocational subjects. They also taught "programming" to the Business students, though I have no idea at what level. I assume that these programs had been in place for many years before my time. I was in the College Prep track, so those other courses were pretty much off limits for me.
Nonetheless I got permission to sign up for Electronics. I discovered that the course was mainly going to revolve around TV repair, and the teacher even told me that I'd be bored. So I dropped it and learned that one of the math teachers had started a course in BASIC! It's not an understatement that the course changed my life.
I took votech electronics in HS; 4 hrs/day for junior and senior years. It was the opposite experience though. 1st year was analog, second was digital. Learned small signal response, Karnaugh mapping, 6502 assembly. I'm an EE now of course.
One of my high school friends finds my Arduino obsession ridiculous because he learned all about soldering and electronics st the high school he attended before transferring to mine. Our poor school district could barely afford welding, small gas engines, and basic Windows and Office (document/spreadsheet/presentation program basic use) classes.
Understanding how these work is one thing, and that used to be enough to be worth employing. Today, you have to have a passion for using that knowledge to solve problems.
In the Toronto,Canada area we had electrical classes where we learned the basics of electricity but more with a focus on wiring a house and also after taking that you could choose an electronics class in the more senior levels. This was mid to late 90s. I'm not sure if they are still in the curriculum.
That's sort of vestigial when you compare it to the old Industrial Arts track in Ontario high schools. As I recall, Grade 9 Electricity was a common course required for both the Electricity (what you'd need to know as an apprentice electrician) and Electronics (prep for a technician/technologist program at a College of Applied Arts and Technology) courses in grades 10-12, and both programs required additional courses in drafting and the basics in sheet metal, wordworking and machine shops as well (things you'd need to practically apply what you were taking in your core courses). Unfortunately, the way things were arranged meant that opting for the IA track in Grade 9 pretty much meant giving up university as an option since you'd have to give up the credits in things like history, geography and CanLit that were required at the grade 9 and 10 level for an OSSHGD (Grade 13 diploma). And there was a big gender divide as well, at least at the time. It's a damned shame that the only approach considered for fixing the system was to (mostly) dump it.
I graduated from high school in Toronto in 2009 and we had elective electronics courses in Grades 11 and 12. I remember learning about logic gates, flip-flops, and building simple circuits on breadboards. We even ended up connecting them to the parallel port on a computer and writing simple programs to communicate with them.
It's not unheard-of. My high school (in Waterloo, Ontario) had an internship program like this too, and it's how I got my first programming job in about 2000-2001, at age 15. There were about ten students in my class that got technology jobs of one sort or another that year.
Until I graduated from college it was hard to get anyone to take me seriously or even respond. I think the barriers to enter the tech job market with no experience or degree is so much higher today.
My Chicago-suburban public high school offered Electronics Tech 1, 2, and Independent Study (basically a hacker space pretending to be a class). This was in the early 1990s.
District 211 (Northwest Suburbs). Great fun! Back then I had no idea how spoiled I was. All the power supplies, oscilloscopes, multimeters, soldering stations, and parts I could ever want.
"The other 'bible' was a book "101 Games in BASIC." I was a fan of computer games and knew that as soon as I had a computer of my own I would want to type in all these games to play."
I don't know for sure, but I think Mr. Wozniak is referring to the book edited by David H. Ahl, BASIC Computer Games:
Notes on the page mention the book was "[a]lso published as 101 BASIC Computer Games".
This book happened to be a great influence on me. Reading it in grade school gave me a small taste of what fun programming can be. I especially liked how some of the programs showed how simple rules can result in emergent and unexpected behavior. Not to mention how easy and fun it was to change the source (sometimes by accident... SYNTAX ERROR anyone?) and seeing what would happen.
Today, I have the distinct privilege to do effectively the same (different platforms, of course :)), and now it even pays the bills.
This was how I learned to program BASIC at six years old.
Of course, I also figured out I could get my TRS-80 Model 1 to make sounds of various pitches by tuning an FM radio to its CPU and running loops with varying delays. I added sound to a pinball game this way back then.
Oh, how I loved that book. We were poor, and it took awhile before I got my first computer (Timex sinclair), but until then I read that book, programmed on paper, and dreamed.
Oh, wow, I haven't seen that cover since I was a kid. I'm awash in delightful nostalgia now. I had that book and got it specifically to program games on my Apple IIe, so I guess Woz achieved his goal!
With all the people that book inspired to get into computing, and the sum total of what we've built, I bet Ahl couldn't have guessed what an impact that book would have.
Woz is, for me, the ISO standard geek, the distillation of all that I aspire to. Somewhere in Paris is a vault, and in that vault is a platinum-iridium Steve Wozniak, against which all of us are judged and found wanting.
If you're interested in the actual details of the implementation of the syntax table, I had a great exchange on the 6502.org forum a couple of years back.
There is a (relatively easier to understand) stack-based expression evaluator, with hooks to allow for operator precedence. The interesting part is the scanner, which converts each line of BASIC into the tokens used by the evaluator. This is the bit that has the "syntax table diagram".
You may also find this article by Woz on the Apple][ from the '77 BYTE magazine a pretty interesting read.
In India I studied in a school that had only one electric bulb per class and a second hand MS-DOS machine donated by a politician. The school and teachers were glad to let me use it and I am eternally thankful to them for the same. It changed me totally.
We also had awesome electronics equipment lying around which we could use. I used IC-555 when I was in 8th grade to program a flashing LED and I can not explain the joy of doing it in words.
Our school had no computers. I first saw computers in my University in a air-conditioned room and we were not allowed to go inside. We had a Fortran-77 module (elective) which I took in the hopes of getting a chance to use the computers. However, it turned out that we were supposed to write our code on paper and the teacher would evaluate them by reading them, not compiling them! So the end result was me scoring very well in the exam by writing code on paper, the teacher evaluating it by reading it. Sigh.
I programmed in Forth some time ago and I wonder why didn't Wozniak implement Forth on his first computer. Surely, it would be easier to do and run faster than BASIC. That BASIC was a naive interpreter, it couldn't help being slow, except for the primitives that Woz coded in machine language, I'm sure they were fast.
Was it already clear for Wozniak in 1975 that Forth looks weird and people won't get it?
I'd simply guess he'd never heard of it -- it was pretty obscure in the early 1970s. It might have been less accessible to beginners, but Forth was the perfect language for those early microcomputers. I loved programming in it on my Commodore 64.
It says right there in the article. BASIC had books like "101 computer games" published for it. It had already made Bill Gates a minor celebrity. It already had the most mindshare in his target market.
> "The key to games was BASIC. Bill Gates was unknown except in the electronics hobby world. Everyone in our club knew that he'd written BASIC for the Intel microprocessor. I sniffed the wind and knew that the key to making my computer good (popular) was to include a high-level language and that it had to be BASIC. Engineers programming in FORTRAN were not going to be what would start a home computer revolution."
I checked the above link to confirm my recollection, but while Forth had been around for a while it wasn't really public until the 70s (versus BASIC). I suspect he wouldn't have even heard of it, or at least not realized its potential, in 1975.
I think it must have been. If he was aware of it at all, he would have associated it with the Reverse Polish Notation of his HP calculator, and probably knew that, while they were certainly powerful, RPN calcs were never going to make it to the mainstream.
And actually implementing a basic interpreter isn't all that complex. The loop is simple:
Read a line.
If the line starts with an integer, you're adding a line to your program; otherwise you need to interpret then execute.
Read the first word. In some BASICs, this is the first string of characters that matches one of the keywords; in others, it's all the alphanumerics up to a non-alphanumeric.
(In effect) dispatch to the appropriate interpretation routine based on which keyword you just read in. For example, PRINT goes to the argument handler for PRINT, LET goes to the argument handler for LET, and so on.
Then you just have a bunch of routines (read one variable name, read an expression and interpret it as a number, read a destination line number, etc) and different keywords use them in different ways.
It's pretty simple, really. Way easier than writing a full LALR parser.
Wozniak was all about bringing computers into wider use. At the time, BASIC was considered the "easy" language to learn. So easy that kids could do it.
I thought Logo was, too, and Logo is based on Forth, but I checked Wikipedia article and Forth is not mentioned. Also, don't know about the popularity of Logo back in the day, but I thought it enjoyed some.
Games aren't given nearly the credit they deserve for driving the PC revolution. My house was one of a very few in our neighborhood that had an Apple II in the house (this was 1980), which cost $2000 in 1980 dollars. For that kind of money, people said the reason they bought the computer was for <x>, but the real reason was almost always for the games.
If I recall correctly, the design of the Apple 1 and 2 were heavily influenced by Woz's experience making arcade game machines. From his arcade work, he had a lot of experience (and talent) in reducing costs by doing more with fewer chips and in interfacing with CRT televisions.
"Breakout directly influenced Wozniak's design for the Apple II computer. He said, 'A lot of features of the Apple II went in because I had designed Breakout for Atari. I had designed it in hardware. I wanted to write it in software now.'"
"But I had in the back of my head that I could be a star, that I could get a little fame in the hobby world, like Bill Gates, if I created the first BASIC for the 6502." Big things start small!
"I kept about 50 chronological folders of papers throughout all my BASIC design work. Each one was labelled GAME BASIC. So you can see where my head was coming from."
I'm not sure whether that 'kept' means they are gone, with that "can see" a sentence later, but if they exist, somebody should write a book or a paper on them.
does anyone know if woz lifted weights or participated in any other kind of serious athletics when he was younger? he's always very fit and muscular in early pictures and as many athletes do, he's gained some weight in later years.
i only ask because some contemporary biopic films/representations have portrayed him as out of shape in his early years and that's clearly bullshit.
I suspect what's going on is that he was chubby by early-70s standards, and so contemporary representations start with chubby-by-2010s standards and blow that up for effect. (I've wondered about this too.)
I remember a quote by Woz I think it was with the hardware however, about being forced to design everything more completely before even starting to build it. There's got to be a lesson in that somewhere.
"When you code by hand (couldn't afford a time-share account) it's hard to make changes in the middle structure of things that have to be at fixed addresses."
People always ask me, "what was it like to be homeschooled" and I never have an answer for them. It was all I knew. What was it like to go to public school? But this. This is what it was like. My sister and I did things, made things, whatever we wanted. We went places and interacted with adults and worked on real projects. Nothing as impressive as this, but lots of things far more impressive than our peers.
But that wasn't "being homeschooled", that was having our parents. I've learned that most of our homeschooled peers didn't do anything like we did. It was kind of a weird revelation to grow up in this group of supposed-academic-over-achievers, often feel like the dumb one because I hadn't read all of the books they did (which I now realize was because I had a much more balanced up bringing that included sports and other studies), and then be the only two (my sister and I) to make something out of our lives.
Religious zealotry will do that to people. And they were zealous in both homeschooling and Christianity. I'm now somewhat surprised one or two of them haven't committed suicide yet. I know one has tried, but his zealotry makes him refuse to get help. His father, being the local physician in our small town, apparently doesn't believe depression is a real thing. And yet half or more of his 11 kids are textbook cases.
It makes me sick. But again, that's not homeschooling, that's having certain parents. One's parents are, naturally, the biggest influence on their lives.
Ordinarily I'd vote this down for snark not contributing to the conversation, but I actually do this the underlying thought here is worthy and contributes to the conversation.
There is a core aspect of hacking/making/doing that Woz demonstrated well and aren't represented by many modern thought leaders in the industry.
By the end I convinced myself that 4k was the minimum possible code size for implementing a JVM.
The JVM was used in the Parallax Javelin Stamp - a Java version of the BASIC Stamp (http://en.wikipedia.org/wiki/BASIC_Stamp).
As an aside, the SX microcontroller only had 256 bytes (yes bytes!) of RAM internally so I used an external 32kB SRAM for the Java heap and stack. The 256 bytes of internal RAM held the internal state of the interpreter and memory manager.