# SunPlus unSP

Assembler code

```
ROM:41B3
ROM:41B3 ; =============== S U B R O U T I N E =======================================
ROM:41B3
ROM:41B3
ROM:41B3 sub_41B3:
ROM:41B3                 sp  = $27FF
ROM:41B5                 r1  = $4000
ROM:41B7                 r2  = [r1++]
ROM:41B8                 jmp      loc_41CA
ROM:41B9 ; ---------------------------------------------------------------------------
ROM:41B9
ROM:41B9 loc_41B9:                               ; CODE XREF: sub_41B3+18↓j
ROM:41B9                 push     r2, r2 to [sp]
ROM:41BA                 r3  = [r1++]
ROM:41BB                 r4  = [r1++]
ROM:41BC                 r4  = r4 lsl 4
ROM:41BD                 r4  = r4 lsl 4
ROM:41BE                 r4  = r4 lsl 2
ROM:41BF                 sr  = r4
ROM:41C0                 r4  = [r1++]
ROM:41C1                 bp  = [r1++]
ROM:41C2                 jmp      loc_41C6
ROM:41C3 ; ---------------------------------------------------------------------------
ROM:41C3
ROM:41C3 loc_41C3:                               ; CODE XREF: sub_41B3+14↓j
ROM:41C3                 r2  = ds:[r4++]
ROM:41C4                 [r3++]  = r2
ROM:41C5                 bp -= 1
ROM:41C6
ROM:41C6 loc_41C6:                               ; CODE XREF: sub_41B3+F↑j
ROM:41C6                 cmp      bp, 0
ROM:41C7                 jne      loc_41C3
ROM:41C8                 pop      r2, r2 from [sp]
ROM:41C9                 r2 -= 1
ROM:41CA
ROM:41CA loc_41CA:                               ; CODE XREF: sub_41B3+5↑j
ROM:41CA                 cmp      r2, 0
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/9.0/user-guide/disassembler/disassembly-gallery/sunplus-unsp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
