CTF Wiki
  • 简介
  • 如何使用 CTF Wiki
  • introduction
    • CTF 历史
    • CTF 竞赛模式简介
    • CTF 竞赛内容
    • 线下攻防经验小结
    • CGC 超级挑战赛
    • 学习资源
  • misc
    • 杂项简介
    • 取证隐写前置技术
    • 信息搜集技术
    • encode
      • 通信领域常用编码
      • 计算机相关的编码
      • 现实世界中常用的编码
    • picture
      • 图片分析简介
      • JPG
      • PNG
      • GIF
    • audio
      • 音频隐写
    • archive
      • RAR 格式
      • ZIP 格式
    • traffic
      • 流量包分析简介
      • 协议分析概述
        • Wireshark
        • DNS
        • HTTP
        • HTTPS
        • FTP
        • USB
        • WIFI
      • 数据提取
      • PCAP 文件修复
    • disk-memory
      • 磁盘内存分析
      • 题目
    • shellcode
    • other
      • pyc
  • web
    • Web 简介
    • XSS
    • php
      • PHP 代码审计
    • SQL 注入
      • sqlmap绕过脚本
      • 各版本数据库语句备忘
    • CSRF
    • SSRF
  • reverse
    • 软件逆向工程简介
    • identify-encode-encryption
      • 常见加密算法和编码识别
    • language
      • 简介
      • go
        • Golang 逆向入门
      • python
        • Python 逆向入门
      • rust
        • Rust 逆向入门
    • maze
      • 迷宫问题
    • obfuscate
      • 控制流平坦化
      • 花指令
      • movofuscator
      • Self-Modified Code
    • vm
      • 虚拟机分析
    • platform
      • linux
        • Detecting Breakpoints
        • Detecting debugging
        • False Disassembly
        • LD_PRELOAD
      • windows
        • anti-debug
          • CheckRemoteDebuggerPresent
          • 反调试技术例题
          • Heap Flags
          • Interrupt 3
          • IsDebuggerPresent
          • 花指令
          • NtGlobalFlag
          • NtQueryInformationProcess
          • The Heap
          • Thread Local Storage(TLS)
          • ZwSetInformationThread
        • unpack
          • 一步到达 OEP 法
          • ESP 定律法
          • DUMP 及 IAT 重建
          • 最后一次异常法
          • 手动查找 IAT 并使用 ImportREC 重建
          • 内存镜像法
          • 保护壳简介
          • SFX 法
          • 单步跟踪法
          • DLL 文件脱壳
    • tools
      • constraint
        • z3
      • debug
        • gdb
        • ollydbg
        • windbg
        • x64dbg/x32dbg
      • simulate-execution
        • angr
        • Unicorn Engine
      • static-analyze
        • dnspy
        • Ghidra
        • IDA Pro
        • jadx
  • crypto
    • 密码学简介
    • asymmetric
      • 介绍
      • discrete-log
        • 离散对数
        • ECC
        • ElGamal
      • knapsack
        • 背包加密
      • lattice
        • CVP
        • 基本介绍
        • 格基规约算法
        • 格概述
      • rsa
        • RSA 选择明密文攻击
        • RSA 复杂题目
        • Coppersmith 相关攻击
        • 公钥指数相关攻击
        • 模数相关攻击
        • Bleichenbacher's attack
        • RSA 侧信道攻击
        • RSA 介绍
        • d_attacks
          • 私钥 d 相关攻击
          • 扩展维纳攻击
    • attack-summary
      • 简介
      • 比特攻击
      • 中间相遇攻击 - MITM
    • basic
      • 基础数学知识
    • blockcipher
      • AES
      • ARX: Add-Rotate-Xor
      • DES
      • IDEA
      • 块加密
      • Simon and Speck Block Ciphers
      • mode
        • CBC
        • CFB
        • CTR
        • ECB
        • 分组模式
        • OFB
        • Padding Oracle Attack
        • 填充方式
        • PCBC
    • certificate
      • 证书格式
    • classical
      • 古典密码简介
      • 单表代换加密
      • 其它类型加密
      • 多表代换加密
      • 总结
    • hash
      • Hash Attack
      • 综合题目
      • Fowler–Noll–Vo hash function
      • 哈希函数
      • MD5
      • SHA1
    • signature
      • DSA
      • ElGamal
      • 数字签名
      • RSA 数字签名
    • streamcipher
      • 流密码
      • fsr
        • 反馈移位寄存器
        • 线性反馈移位寄存器 - LFSR
        • 非线性反馈移位寄存器
      • lcg
        • 题目
        • 线性同余生成器
      • prng
        • 密码安全伪随机数生成器
        • 伪随机数生成器介绍
        • 题目
      • special
        • RC4
  • pwn
    • MacOS
    • misc-os
    • 概述
      • stackoverflow
        • 执行 Shellcode
        • 栈介绍
        • 栈溢出原理
    • browser
      • Chrome
      • Firefox
      • Safari
    • hardware
      • 简介
        • side-channel
          • prefetch side-channel attack
      • trusted-computing
        • 可信执行环境
    • linux
      • kernel-mode
        • 基础知识
        • Introduction
          • DoS
          • Information Disclosure
          • Introduction
            • Change Others
            • Change Self
        • Introduction
          • Introduction
            • 信息泄漏
            • Misc
          • Introduction
            • Kernel Stack Canary
          • Introduction
            • inner-kernel
              • 内部隔离
            • Introduction
              • KPTI - Kernel Page Table Isolation
              • 用户代码不可执行
              • 用户数据不可访问
          • Introduction
            • FGKASLR
            • KASLR
        • Introduction
          • 编译内核驱动
          • 内核下载与编译
          • Qemu 模拟环境
          • Real Device
        • exploitation
          • heap
            • 内核堆概述
            • buddy
              • Cross-Cache Overflow & Page-level Heap Fengshui
              • Page-level UAF
            • slub
              • freelist 劫持
              • Heap Spray
              • kernel UAF
          • race
            • Double Fetch
            • userfaultfd 的使用
          • rop
            • bypass-smep
            • ret2dir
            • 利用 pt_regs 构造通用内核 ROP
            • ret2usr(已过时)
            • Kernel ROP
          • tricks
            • 在内存中直接搜索 flag
      • user-mode
        • environment
        • fmtstr
          • 检测
          • 例子
          • 利用
          • 原理介绍
        • integeroverflow
          • 整数溢出
        • io-file
          • glibc 2.24下 IO_FILE 的利用
          • 伪造vtable劫持程序流程
          • FSOP
          • FILE结构
        • mitigation
          • Canary
        • race-condition
          • introduction
          • 题目
        • summary
          • 获取地址
          • shell 获取小结
          • 控制程序执行流
        • Type Confusion
        • Uninitialized Memory
        • heap
          • mallocng
          • ptmalloc2
            • Chunk Extend and Overlapping
            • Fastbin Attack
            • 堆概述
            • 堆相关数据结构
            • 堆溢出
            • House Of Einherjar
            • House Of Force
            • House of Lore
            • House of Orange
            • House of Pig
            • House of Rabbit
            • House of Roman
            • 堆利用
            • Large Bin Attack
            • 通过堆进行信息泄漏
            • 堆中的 Off-By-One
            • 堆中的检查
            • tcache makes heap exploitation easy again
            • Unlink
            • Unsorted Bin Attack
            • Use After Free
            • implementation
              • 基础操作
              • 释放内存块
              • 堆初始化
              • malloc_state 相关函数
              • 申请内存块
              • 测试支持
              • 深入理解堆的实现
              • tcache
        • stackoverflow
          • arm
            • 环境搭建
            • Arm ROP
          • mips
            • mips - ROP
          • RISC-V
          • x86
            • 基本 ROP
            • 花式栈溢出技巧
            • 中级ROP
            • 栈介绍
            • 栈溢出原理
            • advanced-rop
              • 高级 ROP
              • ret2dlresolve
              • ret2VDSO
              • SROP
    • sandbox
      • Chroot
      • Docker
      • Namespace
      • python
        • Python 沙盒
      • seccomp
        • C 沙盒逃逸
      • Shell Sandbox
    • virtualization
      • basic-knowledge
        • 虚拟化技术简介
        • CPU 虚拟化
        • IO 虚拟化
        • 内存虚拟化
      • parallels
        • Parallels
      • VirtualBox
      • VMWare
      • qemu
        • basic-knowledge
          • QEMU 设备模拟
          • QEMU 内存管理
        • environment
          • 编写 QEMU 模拟设备
          • QEMU 下载与编译
        • exploitation
          • QEMU 逃逸入门
          • 越界读写
  • Android 安全
    • basic_develop
      • Android 开发基础
    • Android 应用运行机制简述
      • Android 中 Java 层的运行机制
        • dex
          • DEX文件
          • ODEX文件
        • smali
          • Smali
      • native_layer
        • so 介绍
    • basic_reverse
      • Android 关键代码定位
      • Android 逆向基本介绍
      • dynamic
        • Android 动态调试
        • IDA 动态调试原生层程序
        • IDA 动态调试 smali 代码
      • static
        • 静态分析综合题目
        • 静态分析 java 层例子
        • 静态分析原生层程序
  • blockchain
    • Blockchain Security Challenges
    • Blockchain Security Overview
    • ethereum
      • Ethereum Basics
      • Ethereum Overview
      • Ethereum Opcodes
      • 学习资源
      • Smart Contract Reverse
      • Function Selector and Argument Encoding
      • Ethereum Storage
      • attacks
        • Airdrop Hunting
        • Arbitrary Writing
        • CREATE2
        • Delegatecall
        • Introduction
        • Jump Oriented Programming
        • Integer Overflow and Underflow
        • Randomness
        • Re-Entrancy
        • Short Address Attack
        • Uninitialized Storage Pointer
    • publicblockchain
      • Public Blockchain Security Overview
      • Blockchain Weaknesses
  • assembly
    • ARM
    • MIPS
    • x86_x64
  • executable
    • elf
      • 程序加载
      • 程序执行流程
      • linking
        • 程序链接
        • Symbol Reslove
      • structure
        • ELF 文件
        • Code Section
        • Data Related Sections
        • Dynamic Sections
        • Misc Sections
        • Sections
        • String Sections
        • .symtab: Symbol Table
    • pe
      • PE 文件格式
      • 导出表
      • 导入表
      • 基址重定位表
  • ics
    • ICS_CTF 竞赛
    • ICS_CTF 发现
    • ICS_CTF 利用
    • ICS_CTF 学习资源
  • contribute
    • 贡献之前
    • 基本贡献方式
    • 贡献文档要求
    • 翻译
  • write up
    • 浙江工业大学CTF赛事
      • 2023第四届“安恒杯”CTF新生赛题解
Powered by GitBook
On this page
  • MIPS 基础内容
  • 0x01 寄存器
  • (1)通用寄存器
  • (2)特殊寄存器
  • 0x2 指令 Instruction
  • 参考链接
  1. assembly

MIPS

MIPS 基础内容

这里以 MIPS32 为基础作为介绍内容。

0x01 寄存器

(1)通用寄存器

MIPS 有 32 个通用寄存器 (General purpose registers),以美元符号 ($) 表示。可以表示为 $0~$31,也可以用寄存器名称表示如,$sp 、 $t9 、$fp 等等。

Register Number
Conventional Name
Usage
Usage

$0

$zero

Hard-wired to 0

$1

$at

Reserved for pseudo-instructions

$2 - $3

$v0, $v1

Return values from functions

保存表达式或者函数返回值

$4 - $7

$a0 - $a3

Arguments to functions - not preserved by subprograms

函数的参数

$8 - $15

$t0 - $t7

Temporary data, not preserved by subprograms

$16 - $23

$s0 - $s7

Saved registers, preserved by subprograms

$24 - $25

$t8 - $t9

More temporary registers, not preserved by subprograms

临时寄存器,作为 $t0 - $t7 的补充,$t9 通常与调用函数有关

$26 - $27

$k0 - $k1

Reserved for kernel. Do not use.

$28

$gp

Global Area Pointer (base of global data segment)

MIPS 作为一种 load-store 架构,意味着当我们要访问内存必须要通过加载和存储指令才能访问。所有其他指令(add,sub,mul,div等等)必须从寄存器获取其操作数并将其结果存储在寄存器中。例如下面的例子:

    sum = x + y

我们假设 sum 和 x , y 是程序中的变量,其 MIPS 汇编表示为:

    # sum = x + y
    lw      $t0, x          # Load x from memory into a CPU register
    lw      $t1, y          # Load y from memory into a CPU register
    add     $t0, $t0, $t1   # Add x and y
    sw      $t0, sum        # Store the result from the CPU register to memory

(2)特殊寄存器

MIPS32 架构还定义了3个特殊寄存器,分别是 PC(程序计数器)、HI (乘除结果高位寄存器)和 LO (乘除结果低位寄存器)。在进行乘运算的时候,HI 和 LO 保存乘法的结果,其中 HI 保存高32位,LO 保存低32位。而在除法运算中,HI 保存余数,LO 保存商。

0x2 指令 Instruction

ADD – Add (with overflow)

Description:
Adds two registers and stores the result in a register

Operation:

$d = $s + $t; advance_pc (4);

Syntax:

add $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 0000

ADDI -- Add immediate (with overflow)

Description:
Adds a register and a sign-extended immediate value and stores the result in a register

Operation:

$t = $s + imm; advance_pc (4);

Syntax:

addi $t, $s, imm

Encoding:

0010 00ss ssst tttt iiii iiii iiii iiii

ADDIU -- Add immediate unsigned (no overflow)

Description:
Adds a register and a sign-extended immediate value and stores the result in a register

Operation:

$t = $s + imm; advance_pc (4);

Syntax:

addiu $t, $s, imm

Encoding:

0010 01ss ssst tttt iiii iiii iiii iiii

ADDU -- Add unsigned (no overflow)

Description:
Adds two registers and stores the result in a register

Operation:

$d = $s + $t; advance_pc (4);

Syntax:

addu $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 0001

AND -- Bitwise and

Description:
Bitwise ands two registers and stores the result in a register

Operation:

$d = $s & $t; advance_pc (4);

Syntax:

and $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 0100

ANDI -- Bitwise and immediate

Description:
Bitwise ands a register and an immediate value and stores the result in a register

Operation:

$t = $s & imm; advance_pc (4);

Syntax:

andi $t, $s, imm

Encoding:

0011 00ss ssst tttt iiii iiii iiii iiii

BEQ -- Branch on equal

Description:
Branches if the two registers are equal

Operation:

if $s == $t advance_pc (offset << 2)); else advance_pc (4);

Syntax:

beq $s, $t, offset

Encoding:

0001 00ss ssst tttt iiii iiii iiii iiii

BGEZ -- Branch on greater than or equal to zero

Description:
Branches if the register is greater than or equal to zero

Operation:

if $s >= 0 advance_pc (offset << 2)); else advance_pc (4);

Syntax:

bgez $s, offset

Encoding:

0000 01ss sss0 0001 iiii iiii iiii iiii

BGEZAL -- Branch on greater than or equal to zero and link

Description:
Branches if the register is greater than or equal to zero and saves the return address in $31

Operation:

if $s >= 0 $31 = PC + 8 (or nPC + 4); advance_pc (offset << 2)); else advance_pc (4);

Syntax:

bgezal $s, offset

Encoding:

0000 01ss sss1 0001 iiii iiii iiii iiii

BGTZ -- Branch on greater than zero

Description:
Branches if the register is greater than zero

Operation:

if $s > 0 advance_pc (offset << 2)); else advance_pc (4);

Syntax:

bgtz $s, offset

Encoding:

0001 11ss sss0 0000 iiii iiii iiii iiii

BLEZ -- Branch on less than or equal to zero

Description:
Branches if the register is less than or equal to zero

Operation:

if $s <= 0 advance_pc (offset << 2)); else advance_pc (4);

Syntax:

blez $s, offset

Encoding:

0001 10ss sss0 0000 iiii iiii iiii iiii

BLTZ -- Branch on less than zero

Description:
Branches if the register is less than zero

Operation:

if $s < 0 advance_pc (offset << 2)); else advance_pc (4);

Syntax:

bltz $s, offset

Encoding:

0000 01ss sss0 0000 iiii iiii iiii iiii

BLTZAL -- Branch on less than zero and link

Description:
Branches if the register is less than zero and saves the return address in $31

Operation:

if $s < 0 $31 = PC + 8 (or nPC + 4); advance_pc (offset << 2)); else advance_pc (4);

Syntax:

bltzal $s, offset

Encoding:

0000 01ss sss1 0000 iiii iiii iiii iiii

BNE -- Branch on not equal

Description:
Branches if the two registers are not equal

Operation:

if $s != $t advance_pc (offset << 2)); else advance_pc (4);

Syntax:

bne $s, $t, offset

Encoding:

0001 01ss ssst tttt iiii iiii iiii iiii

DIV -- Divide

Description:
Divides $s by $t and stores the quotient in $LO and the remainder in $HI

Operation:

$LO = $s / $t; $HI = $s % $t; advance_pc (4);

Syntax:

div $s, $t

Encoding:

0000 00ss ssst tttt 0000 0000 0001 1010

DIVU -- Divide unsigned

Description:
Divides $s by $t and stores the quotient in $LO and the remainder in $HI

Operation:

$LO = $s / $t; $HI = $s % $t; advance_pc (4);

Syntax:

divu $s, $t

Encoding:

0000 00ss ssst tttt 0000 0000 0001 1011

J -- Jump

Description:
Jumps to the calculated address

Operation:

PC = nPC; nPC = (PC & 0xf0000000) | (target << 2);

Syntax:

j target

Encoding:

0000 10ii iiii iiii iiii iiii iiii iiii

JAL -- Jump and link

Description:
Jumps to the calculated address and stores the return address in $31

Operation:

$31 = PC + 8 (or nPC + 4); PC = nPC; nPC = (PC & 0xf0000000) | (target << 2);

Syntax:

jal target

Encoding:

0000 11ii iiii iiii iiii iiii iiii iiii

JR -- Jump register

Description:
Jump to the address contained in register $s

Operation:

PC = nPC; nPC = $s;

Syntax:

jr $s

Encoding:

0000 00ss sss0 0000 0000 0000 0000 1000

LB -- Load byte

Description:
A byte is loaded into a register from the specified address.

Operation:

$t = MEM[$s + offset]; advance_pc (4);

Syntax:

lb $t, offset($s)

Encoding:

1000 00ss ssst tttt iiii iiii iiii iiii

LUI -- Load upper immediate

Description:
The immediate value is shifted left 16 bits and stored in the register. The lower 16 bits are zeroes.

Operation:

$t = (imm << 16); advance_pc (4);

Syntax:

lui $t, imm

Encoding:

0011 11-- ---t tttt iiii iiii iiii iiii

LW -- Load word

Description:
A word is loaded into a register from the specified address.

Operation:

$t = MEM[$s + offset]; advance_pc (4);

Syntax:

lw $t, offset($s)

Encoding:

1000 11ss ssst tttt iiii iiii iiii iiii

MFHI -- Move from HI

Description:
The contents of register HI are moved to the specified register.

Operation:

$d = $HI; advance_pc (4);

Syntax:

mfhi $d

Encoding:

0000 0000 0000 0000 dddd d000 0001 0000

MFLO -- Move from LO

Description:
The contents of register LO are moved to the specified register.

Operation:

$d = $LO; advance_pc (4);

Syntax:

mflo $d

Encoding:

0000 0000 0000 0000 dddd d000 0001 0010

MULT -- Multiply

Description:
Multiplies $s by $t and stores the result in $LO.

Operation:

$LO = $s * $t; advance_pc (4);

Syntax:

mult $s, $t

Encoding:

0000 00ss ssst tttt 0000 0000 0001 1000

MULTU -- Multiply unsigned

Description:
Multiplies $s by $t and stores the result in $LO.

Operation:

$LO = $s * $t; advance_pc (4);

Syntax:

multu $s, $t

Encoding:

0000 00ss ssst tttt 0000 0000 0001 1001

NOOP -- no operation

Description:
Performs no operation.

Operation:

advance_pc (4);

Syntax:

noop

Encoding:

0000 0000 0000 0000 0000 0000 0000 0000

Note: The encoding for a NOOP represents the instruction SLL $0, $0, 0 which has no side effects. In fact, nearly every instruction that has $0 as its destination register will have no side effect and can thus be considered a NOOP instruction.

OR -- Bitwise or

Description:
Bitwise logical ors two registers and stores the result in a register

Operation:

$d = $s | $t; advance_pc (4);

Syntax:

or $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 0101

ORI -- Bitwise or immediate

Description:
Bitwise ors a register and an immediate value and stores the result in a register

Operation:

$t = $s | imm; advance_pc (4);

Syntax:

ori $t, $s, imm

Encoding:

0011 01ss ssst tttt iiii iiii iiii iiii

SB -- Store byte

Description:
The least significant byte of $t is stored at the specified address.

Operation:

MEM[$s + offset] = (0xff & $t); advance_pc (4);

Syntax:

sb $t, offset($s)

Encoding:

1010 00ss ssst tttt iiii iiii iiii iiii

SLL -- Shift left logical

Description:
Shifts a register value left by the shift amount listed in the instruction and places the result in a third register. Zeroes are shifted in.

Operation:

$d = $t << h; advance_pc (4);

Syntax:

sll $d, $t, h

Encoding:

0000 00ss ssst tttt dddd dhhh hh00 0000

SLLV -- Shift left logical variable

Description:
Shifts a register value left by the value in a second register and places the result in a third register. Zeroes are shifted in.

Operation:

$d = $t << $s; advance_pc (4);

Syntax:

sllv $d, $t, $s

Encoding:

0000 00ss ssst tttt dddd d--- --00 0100

SLT -- Set on less than (signed)

Description:
If $s is less than $t, $d is set to one. It gets zero otherwise.

Operation:

if $s < $t $d = 1; advance_pc (4); else $d = 0; advance_pc (4);

Syntax:

slt $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 1010

SLTI -- Set on less than immediate (signed)

Description:
If $s is less than immediate, $t is set to one. It gets zero otherwise.

Operation:

if $s < imm $t = 1; advance_pc (4); else $t = 0; advance_pc (4);

Syntax:

slti $t, $s, imm

Encoding:

0010 10ss ssst tttt iiii iiii iiii iiii

SLTIU -- Set on less than immediate unsigned

Description:
If $s is less than the unsigned immediate, $t is set to one. It gets zero otherwise.

Operation:

if $s < imm $t = 1; advance_pc (4); else $t = 0; advance_pc (4);

Syntax:

sltiu $t, $s, imm

Encoding:

0010 11ss ssst tttt iiii iiii iiii iiii

SLTU -- Set on less than unsigned

Description:
If $s is less than $t, $d is set to one. It gets zero otherwise.

Operation:

if $s < $t $d = 1; advance_pc (4); else $d = 0; advance_pc (4);

Syntax:

sltu $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 1011

SRA -- Shift right arithmetic

Description:
Shifts a register value right by the shift amount (shamt) and places the value in the destination register. The sign bit is shifted in.

Operation:

$d = $t >> h; advance_pc (4);

Syntax:

sra $d, $t, h

Encoding:

0000 00-- ---t tttt dddd dhhh hh00 0011

SRL -- Shift right logical

Description:
Shifts a register value right by the shift amount (shamt) and places the value in the destination register. Zeroes are shifted in.

Operation:

$d = $t >> h; advance_pc (4);

Syntax:

srl $d, $t, h

Encoding:

0000 00-- ---t tttt dddd dhhh hh00 0010

SRLV -- Shift right logical variable

Description:
Shifts a register value right by the amount specified in $s and places the value in the destination register. Zeroes are shifted in.

Operation:

$d = $t >> $s; advance_pc (4);

Syntax:

srlv $d, $t, $s

Encoding:

0000 00ss ssst tttt dddd d000 0000 0110

SUB -- Subtract

Description:
Subtracts two registers and stores the result in a register

Operation:

$d = $s - $t; advance_pc (4);

Syntax:

sub $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 0010

SUBU -- Subtract unsigned

Description:
Subtracts two registers and stores the result in a register

Operation:

$d = $s - $t; advance_pc (4);

Syntax:

subu $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d000 0010 0011

SW -- Store word

Description:
The contents of $t is stored at the specified address.

Operation:

MEM[$s + offset] = $t; advance_pc (4);

Syntax:

sw $t, offset($s)

Encoding:

1010 11ss ssst tttt iiii iiii iiii iiii

SYSCALL -- System call

Description:
Generates a software interrupt.

Operation:

advance_pc (4);

Syntax:

syscall

Encoding:

0000 00-- ---- ---- ---- ---- --00 1100

XOR -- Bitwise exclusive or

Description:
Exclusive ors two registers and stores the result in a register

Operation:

$d = $s ^ $t; advance_pc (4);

Syntax:

xor $d, $s, $t

Encoding:

0000 00ss ssst tttt dddd d--- --10 0110

XORI -- Bitwise exclusive or immediate

Description:
Bitwise exclusive ors a register and an immediate value and stores the result in a register

Operation:

$t = $s ^ imm; advance_pc (4);

Syntax:

xori $t, $s, imm

Encoding:

0011 10ss ssst tttt iiii iiii iiii iiii

参考链接

PreviousARMNextx86_x64

Last updated 1 year ago

MIPS Instruction Reference