Even if you do not have a complete assembler to produce an object file, for example, you only have finished pass1(),you can still use the print_passes() function provided in the print.c file to print out the content of the symbol table and the sections.
These programs weigh the majority in judging the correctness of your work
These programs let you try your assembler on interesting applications such as printing out the Fibonacci numbers and sorting an array of random integers using the Bubble Sort algorithm. Since these programs can be made into executable object files, you only need to use the gcc command with the -o option% gcc -o application application.o% applicationThese programs weigh 10% in judging the correctness of your work
These programs check if your assembler can detect and report error assembly language programs.These programs are the extra credits.
|
|
|
|
|
|
.section ".data"
|
|
|
|
label:
|
|
|
|
.ascii "hello"
|
|
|
|
ld [%r1 + %r2], %r3
|
|
|
|
ld [%r1 + 2], %r3
|
06instrformat.s |
|
|
ld [%fp + 2], %o0
|
|
|
|
ld [%r1 + 1*(2+3)/4], %r3
|
|
|
|
sethi %hi(label), %r3
|
|
|
|
call printf
|
|
|
|
cmp %r1, %r2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.align 4; .byte 0; .half 0
|
|
|
|
label:;label:
|
|
|
|
.align 3
|
|
|
|
ld [%r1 + 4096], %r3
|
|
|
|
sethi %lo(label)], %r3
|
|