This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Jack Compiler for nand2tetris project 11 -- written in Rust. | |
// License: CC BY-SA 4.0 -- https://creativecommons.org/licenses/by-sa/4.0/ | |
use std::collections::HashMap; | |
use std::env; | |
use std::fs::File; | |
use std::io; | |
use std::io::{BufRead, BufReader, BufWriter, Read, Write}; | |
use std::iter::Peekable; | |
use std::path::Path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Jack Analyzer for nand2tetris project 10 -- written in Rust. | |
// License: CC BY-SA 4.0 -- https://creativecommons.org/licenses/by-sa/4.0/ | |
use std::env; | |
use std::fs::File; | |
use std::io; | |
use std::io::{BufRead, BufReader, BufWriter, Read, Write}; | |
use std::iter::Peekable; | |
use std::path::Path; | |
use std::str::Chars; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VM Translator for nand2tetris project 8 -- written in Rust by Kevin Brothaler. | |
// CC BY-SA 4.0 -- https://creativecommons.org/licenses/by-sa/4.0/ | |
use std::env; | |
use std::fs::File; | |
use std::io; | |
use std::io::{BufRead, BufReader, BufWriter, Read, Write}; | |
use std::path::Path; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example output for VM Translator for nand2tetris project 7 -- written in Rust. | |
// CC BY-SA 4.0 -- https://creativecommons.org/licenses/by-sa/4.0/ | |
// Initialize stack pointer | |
@256 | |
D=A | |
@SP | |
M=D | |
// Push 10 onto the stack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prerequisites: | |
- rustup target install x86_64-apple-ios | |
Steps: | |
DOCUMENTATION ON COMPILING FOR IOS SIMULATOR | |
1) Create a shim to the cross-compiling linker for the simulator: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assember for nand2tetris project 6 written in Rust. | |
// CC BY-SA 4.0 -- https://creativecommons.org/licenses/by-sa/4.0/ | |
use std::collections::HashMap; | |
use std::env; | |
use std::fs::File; | |
use std::io; | |
use std::io::{BufRead, BufReader, BufWriter, Read, Seek, SeekFrom, Write}; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <time.h> | |
#include "dsp.h" | |
using namespace std; | |
static const int LENGTH = 524288; |