Git Product home page Git Product logo

ce201's Introduction

BEST YOUTUBE VIDEO TO WATCH RIGHT NOW

Note: Each Memory Adress is 1 Byte (8-bits) AND Each Register is 4 Bytes (32-bit), which means u need 4 Memory addresses.

MIPS Registers

Register Name Usage
$zero, $0 Zero Hardwired zero, always reads as zero, cannot be written
$at $1 Reserved for assembler use
$v0, $v1 $2 - $3 Return values from functions, function results
$a0 to $a3 $4 -$7 Function arguments
$t0 to $t7 $8- $15 Temporary registers, not preserved across function calls
$s0 to $s7 $16 - $23 Saved registers, preserved across function calls
$t8 to $t9 $24 - $25 More temps
$k0 - $k1 $26 - $27 Reserved for OS Kernel
$gp $28$ Global pointer, used for accessing global data
$sp $29$ Stack pointer, points to the top of the stack
$fp $30$ Frame pointer, used for accessing function arguments and locals
$ra $31$ Return address for function calls, saved during function calls

Endianess

Little Endian: Most Significant Byte --> Least address Big Endian: Little Endian Opposite ofc :)

MIPS is Big Endian

Some Instructions

# Most used MIPS Instructions Summary:

# Load and Store Instructions:
# lw - Load Word: Loads a word from memory into a register.
# sw - Store Word: Stores a word from a register into memory.

# Arithmetic Instructions:
# add - Add: Adds two registers and stores the result in a register.
# addi - Add Immediate: Adds a constant to a register and stores the result in a register.
# sub - Subtract: Subtracts one register from another and stores the result in a register.
# addu, subu - Unsigned Add/Subtract: Similar to add and sub but treat operands as unsigned.

# Data Transfer Instructions:
# lb - Load Byte: Loads a byte from memory into a register.
# lh - Load Halfword: Loads a halfword from memory into a register.

# Branch Instructions:
# beq - Branch if Equal: Branches to a target address if two registers are equal.
# bne - Branch if Not Equal: Branches to a target address if two registers are not equal.

# Logical Instructions:
# and - Bitwise AND: Performs a bitwise AND operation between two registers.
# or - Bitwise OR: Performs a bitwise OR operation between two registers.
# xor - Bitwise XOR: Performs a bitwise XOR operation between two registers.
# nor - Bitwise NOR: Performs a bitwise NOR operation between two registers.

# Shift Instructions:
# sll - Shift Left Logical: Shifts the bits in a register to the left by a specified number of positions.
# srl - Shift Right Logical: Shifts the bits in a register to the right by a specified number of positions.

# Conditional and Loop Instructions:
# slt - Set Less Than: Sets a register to 1 if one register is less than another, else sets it to 0.
# sltu - Set Less Than Unsigned: Sets a register to 1 if one register is less than another (unsigned), else sets it to 0.
# beq, bne - Branch if Equal/Not Equal: Branches to a target address based on a condition.
# j - Jump: Unconditionally jumps to a target address.

# Comparison Instructions:
# slt, sltu - Signed/Unsigned Less Than: Compare two registers and set a target register based on the result.


List of Instructions

ce201's People

Contributors

ahmad-mtr avatar nabeelokal2003 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.