Skip to content

Commit

Permalink
Remove divisible by 4 on memory location. Fix demo file
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterhedges committed May 1, 2018
1 parent 7bf2440 commit 0b7978f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions js/parseInputFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,12 @@ function isValidMemoryLocation(memoryLocation) {

memoryNumber = parseInt(memoryLocation);

if(memoryNumber) {
if(memoryNumber >= 0 && memoryNumber < 65280 && memoryNumber % 4 == 0) {
if(memoryNumber || memoryLocation == 0) {
if(memoryNumber >= 0 && memoryNumber < 65280) {
isValid = true;
}
else {
warnings.push("Memory location <strong>" + memoryLocation + "</strong> must be greater than 0, less than 65280, and divisible by 4.");
warnings.push("Memory location <strong>" + memoryLocation + "</strong> must be greater than 0 and less than 65280");
}
}
else {
Expand Down
4 changes: 2 additions & 2 deletions sampleinputs/sample_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ CODE
10001100001000100000000000000000
00000000010000110010000000100000
10101100001001000000000000000000
00010100000001000000000000000010
00010100000001000000000000000001
00100000010000011111111111110111
00000000001000110000100000100000
00000000001000110000100000100000
4 changes: 0 additions & 4 deletions sampleinputs/sample_4.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// This sample should not stall

// add rd, rs, rt
// rd = rs + rt
// 0000 00ss ssst tttt dddd d000 0010 0000

// add r3, r1, r2
// add r4, r1, r2

Expand Down

0 comments on commit 0b7978f

Please sign in to comment.