Adds test script

This commit is contained in:
Nemo 2020-05-30 01:32:31 +05:30
parent f15f5e6906
commit 8985c2a65a
3 changed files with 11 additions and 25 deletions

View File

@ -79,13 +79,13 @@ Counting number of instructions by `wc -l $file.hack`
### Without Symbols
- [ ] `MaxL.asm`
- [ ] `RectL.asm`
- [ ] `PongL.asm`
- [x] `MaxL.asm`
- [x] `RectL.asm`
- [x] `PongL.asm`
- [x] `Add.asm`
### Symbolic Programs
- [ ] `Add.asm`
- [ ] `Max.asm`
- [ ] `Rect.asm`
- [ ] `Pong.asm`

View File

@ -103,10 +103,10 @@ class Parser
end
def comp
if dest and jump
if dest && jump
line.split('=').last.split(';').first
elsif dest
line.split('=').first
line.split('=').last
elsif jump
line.split(';').first
else

View File

@ -1,19 +1,5 @@
#!/bin/sh
pushd ../projects/06/add
../../../tools/Assembler.sh Add.asm
popd
pushd ../projects/06/max
../../../tools/Assembler.sh Max.asm
../../../tools/Assembler.sh MaxL.asm
popd
pushd ../projects/06/rect
../../../tools/Assembler.sh Rect.asm
../../../tools/Assembler.sh RectL.asm
popd
pushd ../projects/06/pong
../../../tools/Assembler.sh Pong.asm
../../../tools/Assembler.sh PongL.asm
popd
#!/bin/bash
diff ../projects/06/add/Add.hack <(ruby assembler.rb ../projects/06/add/Add.asm)
diff ../projects/06/max/MaxL.hack <(ruby assembler.rb ../projects/06/max/MaxL.asm)
diff ../projects/06/rect/RectL.hack <(ruby assembler.rb ../projects/06/rect/RectL.asm)
diff ../projects/06/pong/PongL.hack <(ruby assembler.rb ../projects/06/pong/PongL.asm)