Unit 4 Machine Language Roadmap - birdybro/Nand2Tetris_MiSTer GitHub Wiki

Unit 4.1 - Machine Language Overview

The CPU executes the instructions that are loaded by the program into memory, one by one in order, and the output data from the cpu is stored in the memory. The program counter will help with conditional execution. The addressing well tell the hardware what to operate on.

He just kinda talked about how machine languages work, which already makes sense to me.

Unit 4.2 - Machine Languages: Elements

Machine operations

image

Not a whole lot here I didn't already know, moving along.

Unit 4.3 - The Hack Computer and Machine Language

So just an overview of the fantasy hack machine language, doesn't seem very straight forward. Overall I'm going to have to just use it, the notes won't help me here.

Unit 4.4 - Hack Language Specification

This video explains the mapping of the binary instructions to the mnemonic equivalents. Here's the complete specification, it's veyr short and sweet :)

image

They asked me a quiz, what does 1111010101101100 map to given the chart above?

I'll work backward just to organize everything.

jump 100 = if out < 0 jump (JLT)
dest 101 = A register and RAM[A] (AM)
comp 010101 = if a=0 then D|A else if a=1 D|M

AM=D|M;JLT

An example Hack program

image

image

Unit 4.5 - Input / Output

Just some general overview of the inputs and outputs I guess, easy?

image

image

Looks like you have to draw the screen directly to memory, on and off bits positionally :P - That's pretty funny but I like it.