Rewrite Kate Forbes-Riley's (Dartmouth University) x86 NASM assembly language program, tree.s, in Sparc assembly language. You may substitute any standard C libary function calls for any parts of the code. Also add printing "Inspecting node dd\n" where dd is the number stored in the tree node (e.g., node1 is 11, node2 is 22). Finally, turn in two versions of your program, one with the tree in the x86 program and another, called tree2.s with a different tree that has nine nodes.
Here are some useful references:
Note that in sparc assembly language, you cannot forward reference symbolic labels like node2: in .data sections. Instead use a numeric label like 2: and forward reference it with "2f" (a backward reference would be "2b"). Be sure to put a nop instruction or better yet a useful instruction that is executed before the branch/call/ret after all branch, call and ret instructions (except do not put synthetic instructions like "set" that translate into two actual instructions, because only the first half of the synthetic instruction will be executed before the branch). You can use gcc to compile your tree.s program on uhunix2. The equivalent of x86's "dd" (define double) is ".word" in sparc. The .word can be followed by any number of comma separated values without needing to repeat ".word" (e.g. "node1: .word 11, 2f, 5f" and "2: .word 22, 3f, 4f").
To submit your assignment, zip you tree.s, tree2.s files and your transcript(s) of your sample runs and email the zip archive to our TA, dwkang@hawaii.edu.