Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问clear审计提醒

make-mips-interpreter制作 mips 解释器

Agent Skill

make-mips-interpreter 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

874

周安装

35

GitHub Stars

93

下载量

283
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:make-mips-interpreter(制作 mips 解释器)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/make-mips-interpreter
安装命令:
npx skills add https://github.com/letta-ai/skills --skill make-mips-interpreter
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill make-mips-interpreter

简介

用于处理 GitHub 仓库与代码协作信息。

  • 适合整理 Issue、PR 和仓库状态变更。
  • 支持 Codex、Claude 等宿主环境。
  • 通过 npx 命令从 GitHub 仓库安装。
  • 需确认操作权限与文件访问边界。make-mips-interpreter 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

MIPS Interpreter Implementation

Overview

This skill provides guidance for implementing MIPS interpreters/emulators that can load and execute MIPS ELF binaries. The core challenge involves parsing ELF files, decoding MIPS instructions, managing virtual memory, and handling system calls.

Critical Approach: Incremental Development

The most important principle for this task is incremental development over comprehensive analysis. Avoid spending excessive time analyzing before writing code. Instead:

  1. Start with a minimal working skeleton early
  2. Expand functionality iteratively
  3. Test frequently with partial implementations
  4. Debug and refine based on actual execution

Implementation Phases

Phase 1: Minimal ELF Loader

Start with the bare minimum to load an executable:

  1. Parse ELF header to extract:

- Magic number verification (0x7f, 'E', 'L', 'F') - Architecture (MIPS32) - Endianness (typically little-endian) - Entry point address

  1. Parse program headers to identify loadable segments
  2. Load segments into virtual memory at specified addresses
  3. Set program counter to entry point

Key data structures needed:

  • Memory array/map for virtual address space
  • Registers array (32 general-purpose + PC + HI/LO)

Phase 2: Core Instruction Decoding

Implement instruction decoding for the three MIPS instruction formats:

R-type format (register operations):

  • Bits 31-26: opcode (0x00 for R-type)
  • Bits 25-21: rs (source register 1)
  • Bits 20-16: rt (source register 2)
  • Bits 15-11: rd (destination register)
  • Bits 10-6: shamt (shift amount)
  • Bits 5-0: funct (function code)

I-type format (immediate operations):

  • Bits 31-26: opcode
  • Bits 25-21: rs
  • Bits 20-16: rt
  • Bits 15-0: immediate value

J-type format (jump operations):

  • Bits 31-26: opcode
  • Bits 25-0: target address

Phase 3: Essential Instructions First

Implement instructions in priority order based on typical program needs:

High Priority (implement first):

  • Arithmetic: ADD, ADDU, ADDI, ADDIU, SUB, SUBU
  • Logical: AND, ANDI, OR, ORI, XOR, NOR
  • Shifts: SLL, SRL, SRA, SLLV, SRLV, SRAV
  • Comparison: SLT, SLTI, SLTU, SLTIU
  • Memory: LW, SW, LB, LBU, SB, LH, LHU, SH
  • Branches: BEQ, BNE, BGTZ, BLEZ, BLTZ, BGEZ
  • Jumps: J, JAL, JR, JALR
  • Load: LUI

Medium Priority:

  • Multiply/Divide: MULT, MULTU, DIV, DIVU, MFHI, MFLO, MTHI, MTLO

Lower Priority:

  • Coprocessor instructions (if needed)
  • Floating point (if needed)

Phase 4: Syscall Handler

Implement system call interface based on the target environment:

  1. Detect SYSCALL instruction
  2. Read syscall number from register (typically $v0 or $2)
  3. Read arguments from registers ($a0-$a3 or $4-$7)
  4. Execute syscall and set return value in $v0

Common syscalls to implement:

  • read (file descriptor, buffer, count)
  • write (file descriptor, buffer, count)
  • open (path, flags, mode)
  • close (file descriptor)
  • lseek (file descriptor, offset, whence)
  • exit (status code)

Phase 5: I/O and File System

For programs requiring file access:

  • Implement file descriptor table
  • Handle standard streams (stdin=0, stdout=1, stderr=2)
  • Support opening/reading external files (e.g., data files)
  • Handle output file creation (e.g., frame buffers, results)

Verification Strategies

Incremental Testing

Test after each implementation phase:

  1. ELF loader test: Verify entry point and memory layout match expected values
  2. Instruction test: Create simple test sequences for each instruction group
  3. Syscall test: Test each syscall with known inputs/outputs
  4. Integration test: Run actual target binary

Debugging Techniques

  • Add instruction tracing (PC, instruction, register changes)
  • Log syscall invocations with arguments
  • Verify memory reads/writes at expected addresses
  • Compare register state against expected values at checkpoints

Common Validation Points

  • Entry point address matches ELF header
  • Stack pointer initialized correctly
  • Memory segments loaded at correct addresses
  • Register $0 always reads as zero
  • Signed vs unsigned operations handled correctly
  • Branch delay slots handled (if applicable to target)

Common Pitfalls

Analysis Paralysis

Problem: Spending too much time understanding every detail before writing code. Solution: Start implementation after understanding ELF basics, entry point, and syscall numbers. Iterate and learn through building.

Missing Endianness Handling

Problem: Incorrect byte ordering when loading instructions or data. Solution: Check ELF header for endianness flag and apply consistently when reading multi-byte values.

Register Zero Hardwiring

Problem: Allowing writes to register $0 to persist. Solution: Always return 0 when reading $0, or ignore writes to $0.

Sign Extension Errors

Problem: Incorrect sign extension for immediate values or load operations. Solution: Carefully distinguish signed vs unsigned operations. LB sign-extends, LBU zero-extends.

Branch/Jump Address Calculation

Problem: Incorrect target address computation. Solution:

  • Branches: PC + 4 + (sign-extended offset << 2)
  • Jumps: (PC & 0xF0000000) | (target << 2)

Memory Alignment

Problem: Unaligned memory access causing errors. Solution: Either enforce alignment or handle unaligned access appropriately for the target.

Syscall Return Values

Problem: Not setting error codes or return values correctly. Solution: Set $v0 for return value, handle error cases consistently.

Incomplete Instruction Coverage

Problem: Missing instructions causing silent failures. Solution: Log unimplemented instructions with their encodings for debugging.

Time Management Strategy

For complex interpreter tasks:

  1. First 25% of time: ELF loading + basic instruction loop skeleton
  2. Next 25% of time: Core arithmetic/logic/memory instructions
  3. Next 25% of time: Branches, jumps, and syscalls
  4. Final 25% of time: Testing, debugging, edge cases

Prioritize a running (even incomplete) interpreter over comprehensive analysis. A partial implementation that executes provides more debugging information than complete analysis without code.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.15%
按下载量换算82

Gemini CLI

24.56%
按下载量换算70

Antigravity

16.44%
按下载量换算47

windsurf

13.29%
按下载量换算38

OpenCode

6.79%
按下载量换算19

Codex

3.26%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills