> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/9.0sp1/user-guide/disassembler/disassembly-gallery/80-86-architecture-watcom-runtime-1.md).

# 80×86 Architecture: Watcom Runtime

Assembler code

```
cseg01:1044
cseg01:1044 ; =============== S U B R O U T I N E =======================================
cseg01:1044
cseg01:1044 ; Attributes: library function
cseg01:1044
cseg01:1044 __MemFree       proc far                ; CODE XREF: _ffree_+1A↓p
cseg01:1044                                         ; _nfree_+31↓p ...
cseg01:1044
cseg01:1044 ; FUNCTION CHUNK AT cseg01:1041 SIZE 00000003 BYTES
cseg01:1044
cseg01:1044                 push    si
cseg01:1045                 push    di
cseg01:1046                 push    cx
cseg01:1047                 push    ds
cseg01:1048                 mov     ds, dx
cseg01:104A                 or      ax, ax
cseg01:104C                 jz      short loc_1041
cseg01:104E                 mov     si, ax
cseg01:1050                 sub     si, 2
cseg01:1053                 mov     ax, [si]
cseg01:1055                 test    al, 1
cseg01:1057                 jz      short loc_1041
cseg01:1059                 and     al, 0FEh
cseg01:105B                 mov     di, si
cseg01:105D                 add     di, ax
cseg01:105F                 test    word ptr [di], 1
cseg01:1063                 jnz     short loc_1084
cseg01:1065                 cmp     di, [bx+6]
cseg01:1068                 jnz     short loc_106D
cseg01:106A                 mov     [bx+6], si
cseg01:106D
cseg01:106D loc_106D:                               ; CODE XREF: __MemFree+24↑j
cseg01:106D                 add     ax, [di]
cseg01:106F                 mov     [si], ax
cseg01:1071                 push    bx
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hex-rays.com/9.0sp1/user-guide/disassembler/disassembly-gallery/80-86-architecture-watcom-runtime-1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
