ppsspp_assemble
Assemble MIPS instructions and write the encoded bytes to a specified address in PPSSPP memory. Use force to write to protected areas.
Instructions
PURPOSE: Assemble MIPS instruction(s) and write the resulting bytes to memory.
USAGE: session_id + address + code ('
' or ';' separated — PPSSPP assembles one line per call so the tool loops; armips-style ';' comments are NOT supported here).
BEHAVIOR: DESTRUCTIVE. Protected ranges (kernel, top.prx code) need force=true. A partial write is reported with an error directing you to disassemble and inspect.
RETURNS: {address, code, bytes_written, response, text}.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | MIPS assembly source. May be a single instruction ('nop', 'addiu r5, r0, 0x10') or multiple instructions separated by '\n' or ';'. The assembler is PPSSPP's built-in MIPS encoder. | |
| force | No | Set to True to write assembled bytes to protected code-section addresses (kernel memory < 0x08800000 or top.prx code section 0x08804000-0x08D34000). Writing to these ranges without force=True raises ToolError to prevent accidental crashes. | |
| address | Yes | Target address where assembled bytes will be written, as a hex string (e.g. '0x08804000'). Must be a valid MIPS-aligned address for the ISA. | |
| session_id | Yes | Active session ID. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Assembly source string passed in. | |
| text | Yes | Unified text representation: 'Assembled N bytes → 0x{ADDR:08X}'. | |
| address | Yes | Target address, hex string (e.g. '0x08804000'). | |
| response | Yes | Raw PPSSPP WebSocket response. | |
| bytes_written | Yes | Number of bytes written. Best-effort: derived from response['bytes'] length when available, else 0. |