I am having an annoy problem with errors:
processor.c:22: called object is not a function
processor.c:24: called object is not a function
processor.c:26: called object is not a function
processor.c:28: called object is not a function
processor.c:30: called object is not a function
processor.c:32: called object is not a function
processor.c:34: called object is not a function
processor.c:36: called object is not a function
processor.c:38: called object is not a function
processor.c:40: called object is not a function
processor.c:42: called object is not a function
processor.c:44: called object is not a function
The processor.c 's source code is like this:
#include <stdio.h>
#include "memory.h"
#include "processor.h"
#include "Instructions.h"
void execute(void)
{
int instructionRegister = 0;
int instruction = 0;
int operand = 0;
accumulator = 0;
instructionCounter = 0;
while(instructionCounter<size)
{
instructionRegister = readMemory(instructionCounter);
++instructionCounter;
instruction = instructionRegister/100;
operand = instructionRegister%100;
switch(instruction)
{
case read: read(operand);
break;
case write: write(operand);
break;
case load: load(operand);
break;
case store: store(operand);
break;
case add: add(operand);
break;
case substract: substract(operand);
break;
case divide: divide(operand);
break;
case multiply: multiply(operand);
break;
case branch: branch(operand);
break;
case branchNeg: branchNeg(operand);
break;
case branchZero: branchZero(operand);
break;
case halt: halt();
break;
}
}
}
All those "read", "write", "load" , ... functions are declared in the header file "Instructions.h". The Instruction.h is like following:
#define read 10
#define write 11
#define load 20
#define store 21
#define add 30
#define substract 31
#define divide 32
#define multiply 33
#define branch 40
#define branchNeg 41
#define branchZero 42
#define halt 43
void read(int);
void write(int);
void load(int);
void store(int);
void add(int);
void substract(int);
void divide(int);
void multiply(int);
void branch(int);
void branchNeg(int);
void branchZero(int);
void halt(void);
I really can't see why the compiler can't recognise all the functions in the Instruction.h header file???