comments for clarity in parser
This commit is contained in:
parent
d0be871e8f
commit
92719b6b33
@ -136,7 +136,6 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
|
|||||||
instr->data.BranchData.BranchType = a64inst_REGISTER;
|
instr->data.BranchData.BranchType = a64inst_REGISTER;
|
||||||
} else {
|
} else {
|
||||||
instr->data.BranchData.BranchType = a64inst_CONDITIONAL;
|
instr->data.BranchData.BranchType = a64inst_CONDITIONAL;
|
||||||
//instr->data.branchData.processOpData.cond = {remove first two chars of opcode}
|
|
||||||
}
|
}
|
||||||
generateBranchOperands(instr, opcode, operandList);
|
generateBranchOperands(instr, opcode, operandList);
|
||||||
} else if(isLoad == 0 || isStore == 0){
|
} else if(isLoad == 0 || isStore == 0){
|
||||||
@ -224,8 +223,11 @@ a64inst_instruction *parser(char asmLine[]){
|
|||||||
//type is instruction
|
//type is instruction
|
||||||
int operandCount = 0;
|
int operandCount = 0;
|
||||||
const char *operandList[4];
|
const char *operandList[4];
|
||||||
|
//generate list of operands
|
||||||
tokeniseOperands(operands, &operandCount, operandList, &numOperands);
|
tokeniseOperands(operands, &operandCount, operandList, &numOperands);
|
||||||
|
//categorise instruction type from opcode and operands
|
||||||
classifyOpcode(opcode, instr, operandList, operandCount);
|
classifyOpcode(opcode, instr, operandList, operandCount);
|
||||||
|
//define struct values according to operands and type
|
||||||
switch(instr->type){
|
switch(instr->type){
|
||||||
case a64inst_BRANCH:
|
case a64inst_BRANCH:
|
||||||
generateBranchOperands(instr, opcode, operandList);
|
generateBranchOperands(instr, opcode, operandList);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user