# H8 500

Assembler code

```
ROM:1082
ROM:1082 ! =============== S U B R O U T I N E =======================================
ROM:1082
ROM:1082
ROM:1082 sub_1082: ! near
ROM:1082                 mov:g.w @(0xC:8,r3), r0
ROM:1085                 mov:g.w @(0xA:8,r3), r2
ROM:1088                 bra     loc_109D:8
ROM:108A ! ---------------------------------------------------------------------------
ROM:108A
ROM:108A loc_108A:                               ! CODE XREF: sub_1082:loc_109D↓j
ROM:108A                 mov:g.w @r0+, r4
ROM:108C                 mov:g.w @r0+, r1
ROM:108E                 shlr.w  r1
ROM:1090                 sub.w   #1:16, r1
ROM:1094
ROM:1094 loc_1094:                               ! CODE XREF: sub_1082+14↓j
ROM:1094                 clr.w   @r4+
ROM:1096                 scb/f   r1, loc_1094:8
ROM:1099                 sub.w   #1:16, r2
ROM:109D
ROM:109D loc_109D:                               ! CODE XREF: sub_1082+6↑j
ROM:109D                 bne     loc_108A:8
ROM:109F                 mov:g.w @(0x10:8,r3), r4
ROM:10A2
ROM:10A2 loc_10A2:                               ! CODE XREF: sub_1082+34↓j
ROM:10A2                 mov:g.w @r4+, r0
ROM:10A4                 beq     loc_10B8:8
ROM:10A6                 mov:g.w @r4+, r1
ROM:10A8
ROM:10A8 loc_10A8:                               ! CODE XREF: sub_1082+2C↓j
ROM:10A8                 mov:g.b @r4+, r2
ROM:10AA                 mov:g.b r2, @r1+
ROM:10AC                 add:q.w #-1, r0
ROM:10AE                 bne     loc_10A8:8
```


---

# 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/core/disassembler/disassembly-gallery/h8-500.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.
