Skip to content

Commit

Permalink
Add symbol-less test scripts for project 6 (#299)
Browse files Browse the repository at this point in the history
Add symbol-less project 6 test scripts
  • Loading branch information
netalondon authored May 16, 2024
1 parent 0635b9e commit 0d4e38d
Show file tree
Hide file tree
Showing 6 changed files with 27,565 additions and 4 deletions.
25 changes: 25 additions & 0 deletions projects/src/samples/project_06/02_max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,31 @@ export const MaxAsm = `// This file is part of www.nand2tetris.org
0;JMP
`;

export const MaxLAsm = `// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/6/max/MaxL.asm
// Symbol-less version of the Max.asm program.
// Designed for testing the basic version of the assembler.
@0
D=M
@1
D=D-M
@10
D;JGT
@1
D=M
@12
0;JMP
@0
D=M
@2
M=D
@14
0;JMP`;

export const MaxHack = [
0, 64528, 1, 62672, 10, 58113, 1, 64528, 12, 60039, 0, 64528, 2, 58120, 14,
60039,
Expand Down
34 changes: 34 additions & 0 deletions projects/src/samples/project_06/03_rect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,40 @@ export const RectAsm = `// This file is part of www.nand2tetris.org
@END
0;JMP`;

export const RectLAsm = `// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/6/rect/RectL.asm
// Symbol-less version of the Rect.asm program.
// Designed for testing the basic version of the assembler.
@0
D=M
@23
D;JLE
@16
M=D
@16384
D=A
@17
M=D
@17
A=M
M=-1
@17
D=M
@32
D=D+A
@17
M=D
@16
MD=M-1
@10
D;JGT
@23
0;JMP`;

export const RectHack = [
0, 64528, 23, 58118, 16, 58120, 16384, 60432, 17, 58120, 17, 64544, 61064, 17,
64528, 32, 57488, 17, 58120, 16, 64664, 10, 58113, 23, 60039,
Expand Down
1 change: 1 addition & 0 deletions projects/src/samples/project_06/04_pong.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const PongAsm = async () => (await import("./04_pong_asm.js")).PongAsm;
export const PongLAsm = async () => (await import("./04_pong_asm.js")).PongLAsm;
export const PongHack = async () => (await import("./04_pong_asm.js")).PongHack;
Loading

0 comments on commit 0d4e38d

Please sign in to comment.