41 lines
958 B
C
41 lines
958 B
C
//generates assembled code based on two pass assembly method
|
|
|
|
void generateSymbolTable(a64inst_instruction instrs[], int numInstrs){
|
|
//TODO:
|
|
//generate symbol table based on inputted assembly code and labels
|
|
for(int i=0; i<numInstrs; i++){
|
|
// discuss defining a LABEL type
|
|
if(instrs[i]->type==LABEL){
|
|
// symbol table stuff here
|
|
}
|
|
}
|
|
}
|
|
|
|
word assembleBranch(a64inst_instruction *instr, int ){
|
|
word binInstr = 0;
|
|
switch (instr->data.BranchData.BranchType)
|
|
{
|
|
case a64inst_UNCONDITIONAL:
|
|
//000101
|
|
//25-0: sign extended simm26
|
|
|
|
break;
|
|
case a64inst_REGISTER:
|
|
//1101011
|
|
//0000
|
|
//11111
|
|
//000000
|
|
//9-5: address from register
|
|
//0000
|
|
|
|
break;
|
|
case a64inst_CONDITIONAL:
|
|
// 01010100
|
|
// 25-5: sign extended offset
|
|
// 4-0: 0{condition}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|