![nand to tetris screen nand to tetris screen](https://i.ytimg.com/vi/wTl5wRDT0CU/mqdefault.jpg)
init: goes through all OS classes with init and calls it, then calls Main. Building a computer from first principles starting with NAND gates and building all the way up to a general purpose computer that can play tetris.OS: Sys.init should initialize OS and then call Main.main.
![nand to tetris screen nand to tetris screen](https://image.slidesharecdn.com/introductiontonand2tetris-170616163241/95/introduction-to-nand2-tetris-1-638.jpg)
VM: always puts sp = 256 and call Sys.init at top.
Nand to tetris screen software#
Nand to tetris screen update#
hardware contract: update memory map when key pressed.newline, backspace, and move space with other chars will define charMap = map and create 2d array.Output class will have an array of char maps.each char needs bitmap represented by 8 pixels wide and 11 high.think of grid of 23 rows and 64 chars each.draw circle: think of each row as a unit away from the center and use pythagorean theorem to figure out how wide to draw the horizontal lines based on unit from center.draw up or right depending on how much the slope over or undershoots the slope of the start end points.think of line that is drawing north and east.use (x % 16)th bit to target bit in word.2 seconds and clear the screen between two iterations (frames). will implement drawPixel, drawLine, and drawCircle Tetris Game source code is useful for you if you want to develop a similar.vector represents instructions and should be able to scale with resolution.dealloc: append obj/block to the free list.arr and and obj var declarations in stack and content in heap.init array ram and set value 0 (can do because weakly typed).division: can do long division with an array of ints.math can be done as a repetitive addition (inefficient) or with bit shifting O(logN) In this course will write 8 classes: Memory, Screen, Output, Keyboard, String, Array, Sys.Also provides system orientated services (low-level): memory management, I/O device drivers, UI management (shell/windows), multi-tasking, networking, security.Can view as a set of classes in a library.Examples include windows, linux, android, mac.The most important thing to know about the book is how. OS closes gap between software and hardware Basically, you build a simple computer practically from scratch, going from Nand to Tetris so to speak.