Forum Assignment

COMP1521 – 22T3 Outline Timetable Forum Assignment 1 Assignment 2
MIPS Instruction Subset vol. need to implement only these 14 MIPS instructions:
Assembler C Bit Pattern add Sd, Ss, St d.S+t 000000ssssstttttddadO00000100020 Sub Ed, Ss, St 0 . s – t 000000ssssstUttddaddO6P00100010 Sit Sd, Ss, St d . S < t 000000ssssstUttddadO00000101010 Ohl Sd 0 . HI 0002008020000020J2dn400020010200 nflo Sd d . LO emeeeeeeeeeeeeedeaddeeeeeeleete Cult Si, St MAO . s • t 000000sssssttttt0000000020011020 dim Ss, St HI . s S t; 10 . s / t eseeeessssstutummeeeeeeeelteie nul Sd, Ss, St d = s • t 011100ssssstttttddIdd00000000010 ben Si. St, I if (S .– t) PC • I 000100ssssstttttIIIIIIIIIIIIIIII bne Si. St, I if (s != t) PC ♦. I 000101ssssstttttIIIIIIIIIIIIIIII add1 St, Si. I t . S .. I 001000ssssstttttIIIIIIIIIIIIIIII orl St, Ss, I t =s1I 001101ssssstttttIIIIIIIIIIIIIIII lul St, I t . I « 16 00111100000tttttIIIIIIIIIIIIIIII SySeall syscall eeeeeeeeeeeeeeeeeeeeeeeeeeeettoe
The instruction bit pattern uniquely identifies each instruction:
• 0: Literal bit zero • 1: Literal bit one • I: Immediate (16-bit signed number) • dl s. t: five-bit register number
System Calls You only need to implement these 3 system calls.
Description Son Pseudo-C printintegr 1 prIntf(“%d’, Sae) exh 10 exit(0) print character 11 prIntf(“%c”, Sae)
Syscall 1 should print Sa0 as a signed 32-bit integer. Syscall 11 should print the low byte (lowest 8 bits) of Sae . Syscall 10 should exit the program. See the section on halting for more details. If an invalid syscall number is supplied an error message should be printed: Match the reference implementation’s message:
S1S2/n1pSCexaMpleS/bad_SySCall.hex 0: 0x20021092 add1 82, 80, 4242 ,» 52 = 4242 it 0A0430000( syscall • syscall 4242 Unknown systen call: 4242
After printing the error message, the program should exit.
Aims The Assignment Refecence implementation MIPS Instruction Subset System Calls Registers Halting Converting MIPS Assembler Instruction codes Examples Getting Started Assumptions and Clarifications Change Log Assessment