



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




addi $t7, $k0, 0x
bfni $a0 done
Interpreter Compiler Assembler Linker Loader
if ((bit[31]âŠbit[26] == 0) {
// Look elsewhere for which R it is⊠inst_type = Rl inst = ??;
} else if ((bit[31]âŠbit[26] == 2) {
inst_type = J; inst = jump;
} else if ((bit[31]âŠbit[26] == 3) {
inst_type = Jl inst = jal;
} else {
// Remaining ops are I // Ignore Floating Pt formats FR,FI inst_type = I; inst = ??; }
if (bit[31] == 1) {// Most-signif. Bit
inst_type = J if (bit[30] == 1) inst = jump; else inst = jal;
} else if ((bit[31]âŠbit[26] == 0) {
// Look elsewhere for which R it is⊠inst_type = Rl inst = ??;
} else {
// Remaining ops are I // Ignore Floating Pt formats FR,FI inst_type = I; inst = ??; }
int main() { bst_t heat = NULL; head = Fill(); / Somehow fill the table via user input / head = Insert(head, âTigerâ, âWoodsâ); / Insert another entry into table / Print(head); / Somehow print the table / Delete(head); / Delete the table (code on next page) / DoSomething(); / Do something, but we need the space back! */ }
bst_t *Insert (bst_t *table, const char *key, const char value) { if ( ) { / New */
} else if ( ) { /* Clobber! */
} else if ( ) { /* Left */
} else { /* Right */
return table; }
char *strcpy(char *s, const char *ct) : Copy string ct to string s, including â\0; return s int strcmp(const char *cs, const char *ct) : Compare string cs to string ct; return < 0 if cs0 if cs>ct size_t strlen(const char *cs) : Return length of cs
1 bst_t *head = NULL; 2 int main(int argc, char *argv[]) { 3 bst_t mybst; 4 head = Insert(head, â61Câ, âAwesomeâ); 5 printf(âKey: %s, Value: %s\nâ, head->key, head->value); 6 }
void Delete (bst_t *table) {
return; }
Typedef struct node { char key[80]; char *value; struct node *left; struct node *right; } bst_t;
Main:......
jal mystery
...... mystery: addi $sp, $sp, - sw $ra, 0($sp) sw $s0, 4($sp) lw $s0, 0($a0) beq $s0, $0, mystery_label addi $a0, $a0, 4 jal mystery xor $v0, $v0, $s andi $v0, $v0, 1 j mystery_label mystery_label1: li $v0, 0 mystery_label2: lw $ra, 0($sp) lw $s0, 4($sp) addi $sp, $sp, 8 jr $ra
if ( ________________________________ ) {
} else {
XOR Truth Table a | b | a XOR b 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0