if (dif & 800) then goto :nopm
;   205                              <1> protectedmode	equ	 800h	; in (DPMI) protected mode
s dcode1seg:0 l dcode1len 88 65 04 80 65 05 FD 89 4D 06
;  2491 00001C74 886504              <1> 	mov byte [di + 4], ah		; store the multiplex number
;  2492 00001C77 806505FD            <1> 	clropt [di + 4], 200h		; indicate it is claimed
;  2493 00001C7B 894D06              <1> 	mov word [di + 6], cx		; = how many list entries before ours,
;  2494                              <1> 					;  or = -1 if not from a list
;  2495 00001C7E E9B900              <1> 	jmp .done
;  2496                              <1> 
;  2497                              <1> @@:
;  2498                              <1> 		; ds:di -> second terminator (will be overwritten)
;  2499                              <1> %if _AUXBUFFSIZE == _AUXBUFFMAXSIZE
;  2500                              <1> 	cmp di, _AUXBUFFSIZE - 8 * 3	; enough for 1 entry + 2 terminators ?
;  2501                              <1> %else
;  2502 00001C81 3B3E[540A]          <1> 	cmp di, word [auxbuff_current_size_minus_24]
;  2503                              <1> %endif
if (src != 1) then goto :error
r v0 := 2
if (byte [srs:sro + count] == EB) then goto :short
r v0 += 1
if (byte [srs:sro + count] != E9) then goto :error
:short
if (byte [srs:sro + count + v0] == 36) then goto :notneedednew
if (word [srs:sro + count + v0] == FF81) then goto :notneededold
if (word [srs:sro + count + v0] != 3E3B) then goto :error
r word [srs:sro + count + v0 + 2] .
s dcode1seg:0 l dcode1len range srs:sro + count + v0 l 4
if (src != 3) then goto :error
r v1 := 8 * #1024 + #16 - #24
if exists r dauxbuflen then r v1 := dauxbuflen - #24
a srs:sro0
 cmp di, (v1)
 .
a srs:sro1
 cmp di, (v1)
 .
a srs:sro2
 cmp di, (v1)
 .
@goto :eof

:nopm
; Cannot operate in PM
@goto :eof

:notneededold
; Patch not needed, auxiliary buffer has fixed size (or already patched)
@goto :eof

:notneedednew
; Patch not needed, comparison uses ss: segment override
@goto :eof

:error
; Error detected
