summaryrefslogtreecommitdiff
path: root/interpreter.c
diff options
context:
space:
mode:
Diffstat (limited to 'interpreter.c')
-rw-r--r--interpreter.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/interpreter.c b/interpreter.c
index 652c181..4598d2f 100644
--- a/interpreter.c
+++ b/interpreter.c
@@ -33,7 +33,7 @@ int main(){
m += dCharToNum(fgetc(stdin));
dPageDump(m);
break;
- case ' ':
+ case ' ': case '\n':
break;
}
}else{ // RUN INSTRUCTION
@@ -43,16 +43,17 @@ int main(){
// Pass in Value
address pass = 0x0000;
int range = fAddressGetLength(getITAddressing(inst));
+ printf("range = %d\n", range); //DEBUG
range = ((2*range)-2);
c = fgetc(stdin);
for(int i = 0; i < range; i++){
- if (c != ' ' && c != EOF){
+ if ((c == ' ') || (c == '\n')){
+ i--;
+ }else{
pass <<= 4;
pass += c;
- c = fgetc(stdin);
- }else{
- break;
}
+ c = fgetc(stdin);
}
current_instruction = getITFunction(inst);
callIT(current_instruction, pass);