Assembly
ECE222: An Assembly language is a low-level language that uses symbol representations (Opcode) to designate the bit sequences of Machine Language instructions.
Important: Assembly Language Machine Language
An assembler is a program that translates assembly language into machine language.
Reg(0) alway has value 0.
Find absolute value of the value in Reg(1):
- SLT(Reg(2), Reg(1), Reg(0))
- Compare register 1 and 0, and store binary value in Reg(2)
- BEQ(Reg(2), Reg(0))
- Check if reg 2 == reg 0
- SUB(Reg(1), Reg(0), Reg(1))
- Subtract to make the negative value positive
- JR(31)
- Jump to the register 31