Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tinywine.asm A small wine that runs on dosbox+dpmi

23 views
Skip to first unread message

ericmatteson...@hotmail.com

unread,
May 10, 2012, 2:52:56 PM5/10/12
to
; a small wine that runs on dosbox + dpmi
; this is the first line of this program.
; written by Eric Matteson. 05-10-2012
; permission is granted to copy this source code
; file tinywine.asm and to publish it on the
; Internet and to use it at least for
; non-profit use. No warranty!!
; tinywine.asm or tinywine.509
; This program requires dpmi 0.9
; after assembling
; tinywine.exe app32.exe
; and is used to load a application program
; written for 32-bit wine and run it.
; tinywine is very small and most programs
; will not run with it. 32-bit only.
; requested result is 16384 bytes
; of tinywine.exe
db 04dh, 5ah, 00h, 00h, 20h, 00h, 00h, 00h
db 020h, 00h, 0ffh, 3fh, 0ffh, 0dfh, 0f0h, 0ffh
db 0f4h, 0ffh, 00h, 00h, 00h, 01h, 0f0h, 0ffh
db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
bits 16
org 0100h
twi100: mov ax,ds
xor di,di
mov [di+tses],ax
mov [di+tsds],ax
mov [di+tsss],ax
jmp prmain
db 00h
shifstate dd 0
ctrlstate dd 0
shifmask dd 03effh, 03bffh
ctrlmask dd 03dffh, 037ffh
; ------------------------
wkeytable dw 02000h, 000h, 000h, 000h
dw 0, 0, 0, 0
dw 1308h, 1309h, 194ah, 194bh
dw 194ch, 130dh, 194eh, 194fh
dw 1950h, 1951h, 1952h, 1953h
dw 1954h, 1955h, 1956h, 1957h
dw 1958h, 1959h, 195ah, 131bh
dw 0000h, 0000h, 0000h, 0000h
dw 1320h, 1631h, 16deh, 1633h
dw 1634h, 1635h, 1637h, 13deh
dw 1639h, 1630h, 1638h, 16bbh
dw 13bch, 13bdh, 13beh, 13bfh
dw 1330h, 1331h, 1332h, 1333h
dw 1334h, 1335h, 1336h, 1337h
dw 1338h, 1339h, 16bah, 13bah
dw 16bch, 13bbh, 16beh, 16bfh
dw 1632h, 1641h, 1642h, 1643h
dw 1644h, 1645h, 1646h, 1647h
dw 1648h, 1649h, 164ah, 164bh
dw 164ch, 164dh, 164eh, 164fh
dw 1650h, 1651h, 1652h, 1653h
dw 1654h, 1655h, 1656h, 1657h
dw 1658h, 1659h, 165ah, 13dbh
dw 13dch, 13ddh, 1636h, 16bdh
dw 13c0h, 1341h, 1342h, 1343h
dw 1344h, 1345h, 1346h, 1347h
dw 1348h, 1349h, 134ah, 134bh
dw 134ch, 134dh, 134eh, 134fh
dw 1350h, 1351h, 1352h, 1353h
dw 1354h, 1355h, 1356h, 1357h
dw 1358h, 1359h, 135ah, 16dbh
dw 16dch, 16ddh, 16c0h, 0000h
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 02000h, 000h, 000h, 000h
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 00h, 00h, 00h, 1324h
dw 1326h, 1321h, 0000h, 1325h
dw 0000h, 1327h, 0000h, 1323h
dw 1328h, 1322h, 132dh, 132eh
dw 0000h, 0000h, 0000h, 0000h
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
dw 0, 0, 0, 0
; -----------
rdsbase dd 0
dd 0
ioobase dd 0
; es:edi table for ax=0300h bx=real interupt number
; rename tedi rdsbase.ioobase tedi: dd 0
tesi: dd 0
tebp: dd 00007000h
trsv: dd 00000000h
tebx: dd 0
tedx: dd 0
tecx: dd 00000010h
teax: dd 0
tshf: dw 02h
tses: dw 08h
tsds: dw 08h
dw 0,0,0,0
tssp: dw 06000h
tsss: dw 08h
dw 0,0,0,0,0,0,0
; end of es:edi table 0300h ------------------
memad dd 0
memhan dd 0
fnbuffaz db 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0
wbuff11 dd 0
rbuff118 dd 0, 0
dd 0
pmcs dw 0
pmds dw 0
pmvs dw 0
; --------
; int isnegwrap()
; isnegwrap returns negative number such as ff6f in ax
; if in wraparound mode at one megabyte.
; isnegwrap starts checking for differences
; at offset 0080h and returns
; low address of first difference - 0080h
; if not in wraparound mode.
isnegwrap: push di
push ds
push es
push si
push bp
push bx
push dx
push cx
xor ax,ax
push ax
push ax
push ax
push ax
push ax
mov bp,sp
xor si,si
xor di,di
mov cx,0008h
mov ds,cx
; dsb=0080h
; diff = 0090h
mov cx,0ffffh
mov es,cx
; ffff0 + 0010h + 0080h == 0090h
; diff at es: DI is 0090h
; cutoff is 10000h - (0010h + 0080h) -> ff70h
mov cx,0ff6fh
xor dx,dx
loopwrap: mov dl,[si+00h]
es:
cmp dl,[di+0090h]
jnz nonwrap
inc si
inc di
dec cx
jnz loopwrap
nonwrap: mov [bp+0008h],si
pop ax
pop ax
pop ax
pop ax
pop ax
pop cx
pop dx
pop bx
pop bp
pop si
pop es
pop ds
pop di
ret
; bottom of isnegwrap (if ax < 0)
; artihmetic subroutines return result in DX:AX
; radd(cah,cal,cbh,cbl)
; bp+ variables
; 0a cbl 08 cbh 06 cal 04 cah
; 02 retad 00 bpsave
; returns with sum in DX:AX
radd: push bp
mov bp,sp
mov ax,[bp+0ah]
add ax,[bp+06h]
mov dx,[bp+08h]
adc dx,[bp+04h]
pop bp
ret
; rsubtract(cbigh,cbigl,ctinyh,ctinyl)
; 32-bit subtract result is in DX:AX
; CX is comparision result
; RETURNS CX=0000 equal. Or cx,08h for borrow
; or cx,04h for sign
; or cx,02h for UNEQUAL.
; bp+variables in stack
; 0e ctinyl 0c ctinyh
; 0a cbigl 08 cbigh
; 06 retad 04 disave
; 02 sisave 00 bpsave
rsubtract: push di
push si
push bp
mov bp,sp
mov ax,[bp+0ah]
mov dx,[bp+08h]
mov si,[bp+0eh]
mov di,[bp+0ch]
sub ax,si
sbb dx,di
jb aresdone
jne aresdone
mov di,dx
or di,ax
jz aresdone
or di,000fh
and di,000fh
aresdone: jb abparcond
js asparcond
je aeqcond
agrcond: mov cx,0002h
jmp acmpbot
aeqcond: xor cx,cx
jmp acmpbot
asparcond: mov cx,0006h
jmp acmpbot
abparcond: js abscond
je abeqcond
abgrcond: mov cx,000ah
jmp acmpbot
abeqcond: mov cx,0008h
mov di,dx
or di,ax
jnz abgrcond
jmp acmpbot
abscond: mov cx,000eh
acmpbot: pop bp
pop si
pop di
ret
; rmpy(slh,sll,srh,srl)
; returns 32 bit ordinal product in DX:AX
; stack variables bp+
; 0c srl 0a srh 08 sll 06 slh
; 04 retad 02 bpsave 00 cxsave
rmpy: push bp
push cx
mov bp,sp
xor dx,dx
xor ax,ax
rmpyl: test word [bp+0ch],01h
jz rkipaddm
add ax,[bp+08h]
adc dx,[bp+06h]
rkipaddm: shr word [bp+0ah],1
rcr word [bp+0ch],1
shl word [bp+08h],1
rcl word [bp+06h],1
mov cx,[bp+0ch]
or cx,[bp+0ah]
jnz rmpyl
pop cx
pop bp
ret
; rposdiv(numerh,numerl,denomh,denoml)
; returns fraction in DX:AX
; 22 denoml 20 denomh 1e numerl
; 1c numerh 1a retad 18 disave
; 16 sisave 14 bpsave
; 12 bxsave 10 dxsave 0e cxsave
; 0c axsave 0a bigl
; 08 bigh 06 dlctr 04 negctr
; 02 resultl 00 resulth
rposdiv: push di
push si
push bp
push bx
push dx
push cx
push ax
xor di,di
push di
push di
push di
push di
push di
push di
mov bp,sp
cmp [bp+020h],di
jns askipnegden
push word [bp+022h]
push word [bp+020h]
push di
push di
call rsubtract
add sp,0008h
mov [bp+022h],ax
mov [bp+020h],dx
inc word [bp+04h]
askipnegden: cmp [bp+01ch],di
jns askipnegnum
push word [bp+01eh]
push word [bp+01ch]
push di
push di
call rsubtract
add sp,008h
mov [bp+01eh],ax
mov [bp+01ch],dx
inc word [bp+04h]
askipnegnum: shl word [bp+02h],1
rcl word [bp+di],1
shl word [bp+01eh],1
rcl word [bp+01ch],1
rcl word [bp+0ah],1
rcl word [bp+08h],1
push word [bp+022h]
push word [bp+020h]
push word [bp+0ah]
push word [bp+08h]
call rsubtract
add sp,0008h
test cx,08h
jnz askipdiv
mov [bp+0ah],ax
mov [bp+08h],dx
inc word [bp+02h]
jnz askipdiv
inc word [bp+di]
askipdiv: inc word [bp+06h]
cmp word [bp+06h],0020h
jns acheckneg
jmp askipnegnum
acheckneg: test word [bp+04h],01h
jz aposres
push word [bp+02h]
push word [bp+di]
push di
push di
call rsubtract
add sp,0008h
mov [bp+02h],ax
mov [bp+di],dx
aposres: pop [bp+010h]
pop [bp+0ch]
add sp,0008h
pop ax
pop cx
pop dx
pop bx
pop bp
pop si
pop di
ret
; end of I/O arithmetic section is line 0478
; 0175 break *******************************
; edjim.bot 1540 01715 - 175
; non I/O artihmetic subroutines return
; result in DX:AX
cadd: jmp radd
csubtract: jmp rsubtract
cmpy: jmp rmpy
cposdiv: jmp rposdiv
; 0182 break
; numberprn(*xyptr,startline,startsubscript,
; width,base,numberhigh,numberlow)
; *xyptr > 3 for startline is line number.
; *xyptr == 2 for startline is absolute address
; within ss
; 40 numberlow 3e numberhigh
; 3c base base of number 3a width
; 38 startsubscript x position within line
; 36 startline 34 *xyptr
; 32 retad 30 disave 2e sisave
; 2c bpsave 2a bxsave
; 28 dxsave 26 cxsave 24 axsave
; 22 diga 20 dig8
; 1e dig6 1c dig4 1a dig2
; 18 dig0 16 tnh 14 tnl
; 12 tfh 10 tfl 0e totalsubscript
; 0c prnctr 0a
; 08 06 04 02 00
numberprn: push di
push si
push bp
push bx
push dx
push cx
push ax
sub sp,0024h
mov bp,sp
xor bx,bx
mov di,[bp+034h]
sub di,bp
mov ax,[bp+0036h]
cmp word [bp+0034h],0002h
jz nbp4647
; *xyptr is 2 or > 3 switch
push ax
push word [bp+034h]
; missing subroutine call alselset
add sp,04h
nbp4647: sub ax,bp
add ax,[bp+038h]
dec ax
mov [bp+0eh],ax
cmp word [bp+03ch],02h
jns hexcmpy
prnbasezur: jmp prnbasequit
hexcmpy: cmp word [bp+03ch],010h
ja prnbasezur
cmp word [bp+03ah],0ch
ja prnbasezur
cmp word [bp+03ah],01h
js prnbasezur
mov ax,[bp+03ah]
mov [bp+0ch],ax
push word [bp+040h]
pop word [bp+014h]
push word [bp+03eh]
pop word [bp+016h]
mberloopxp: dec word [bp+0ch]
jns mberloopyp
jmp mberlooprbot
mberloopyp: push word [bp+03ch]
push bx
push word [bp+014h]
push word [bp+016h]
call cposdiv
add sp,08h
push ax
push dx
push word [bp+03ch]
push bx
mov [bp+010h],ax
mov [bp+012h],dx
call cmpy
add sp,08h
push ax
push dx
push word [bp+014h]
push word [bp+016h]
call csubtract
add sp,08h
push word [bp+010h]
pop word [bp+014h]
push word [bp+012h]
pop word [bp+016h]
cmp ax,000ah
js prfoureight
add ax,037h
jmp prdigithy
prfoureight: add ax,0030h
prdigithy: mov si,[bp+0ch]
mov [bp+si+018h],al
jmp mberloopxp
mberlooprbot: mov [bp+0ch],bx
mov dx,[bp+016h]
or dx,[bp+0014h]
jz mberloopnext
jmp prnbasezur
mberloopnext: mov si,[bp+0ch]
cmp si,[bp+03ah]
jns mberdoney
mov al,[bp+si+018h]
add si,[bp+0eh]
mov [bp+si],al
inc word [bp+0ch]
jmp mberloopnext
mberdoney: jmp prnbasezur
prnbasequit: add sp,024h
pop ax
pop cx
pop dx
pop bx
pop bp
pop si
pop di
ret
; dx:ax = cdigitval(character)
; dx=0 numeric dx=1 non numeric
; 0e character 0c retad 0a disave
; 08 sisave 06 bpsave 04 resuH 02 cxsave
; 00 resuL
cdigitval: push di
push si
push bp
xor dx,dx
push dx
push cx
push dx
mov bp,sp
mov ax,[bp+0eh]
and ax,00ffh
cmp ax,066h
ja ucdigcomp
cmp ax,061h
jb ucdigcomp
sub ax,057h
jmp digcommon
ucdigcomp: cmp ax,046h
ja decdigcmp
cmp ax,041h
jb decdigcmp
sub ax,037h
jmp digcommon
decdigcmp: cmp ax,039h
ja nondigcmp
cmp ax,030h
jb nondigcmp
sub ax,030h
jmp digcommon
nondigcmp: mov word [bp+04h],01h
xor ax,ax
digcommon: inc sp
inc sp
pop cx
pop dx
pop bp
pop si
pop di
ret
; dx:ax = numberget(*xyptr,startline,
; startsubscript,width,base)
; also returns cx is next startsubscript.
; *xyptr > 3 for normal operation with
; startline being a line number.
; *xyptr < 3 for segment selection and
; startline is absolute offset.
; *xyptr == 2 for ss:(startline+startsubscript-1)
; *xyptr == 1 for cs:(startline+startsubscript-1)
; 28 base 26 width 24 startsubscript
; 22 startline 20 *xyptr 1e retad
; 1c disave
; 1a sisave 18 bpsave 16 bxsave
; 14 dxsave 12 cxsave 10 axsave
; 0e totalsubscript 0c prnctr
; 0a 08 06 04 02 00
numberget: push di
push si
push bp
push bx
xor bx,bx
push bx
push cx
push bx
sub sp,010h
mov bp,sp
mov di,[bp+0020h]
sub di,bp
mov ax,[bp+022h]
cmp word [bp+020h],03h
jb linefailget
push ax
push word [bp+0020h]
; missing subroutine call alselset
add sp,04h
linefailget: add ax,[bp+0024h]
dec ax
cmp word [bp+0020h],01h
jz linenobpsub
sub ax,bp
linenobpsub: mov [bp+0eh],ax
mov [bp+000ch],bx
cmp word [bp+026h],01h
jb widfailget
cmp word [bp+026h],0ch
ja widfailget
jmp basegetnx
widfailget: mov cx,[bp+0ch]
add cx,[bp+0024h]
mov [bp+012h],cx
awidfailget: jmp numberquit
basegetnx: cmp word [bp+028h],02h
jb widfailget
cmp word [bp+028h],010h
ja widfailget
mov si,[bp+0eh]
numberprv: cmp word [bp+0020h],0001h
jnz snumberprv
cs
mov dl,[si]
jmp dnumberprv
snumberprv: mov dl,[bp+si]
dnumberprv: push dx
call cdigitval
inc sp
inc sp
inc si
cmp dx,bx
jz numberbth
inc word [bp+0ch]
mov cx,[bp+0ch]
cmp cx,[bp+026h]
js numberprv
jmp widfailget
numberbth: dec si
numberbca: cmp word [bp+0020h],0001h
jnz snumberbca
cs
mov dl,[si]
jmp dnumberbca
snumberbca: mov dl,[bp+si]
dnumberbca: inc si
push dx
call cdigitval
inc sp
inc sp
cmp dx,bx
jnz widfailget
push ax
push dx
push word [bp+028h]
push bx
push word [bp+010h]
push word [bp+014h]
call cmpy
add sp,08h
push ax
push dx
call cadd
add sp,08h
mov [bp+010h],ax
mov [bp+014h],dx
inc word [bp+0ch]
mov cx,[bp+0ch]
cmp cx,[bp+026h]
js numberbca
jmp widfailget
numberquit: add sp,010h
pop ax
pop cx
pop dx
pop bx
pop bp
pop si
pop di
ret
; -------------------------
; xmdebug(h,l)
xmdebug: push di
push si
push bp
push bx
push dx
push cx
push ax
sub sp,090h
mov bp,sp
; a0,a2
xor si,si
mov dx,0020h
clrdloop: mov [bp+si+00h],dl
add si,0001h
cmp si,0028h
js clrdloop
mov bx,0d0ah
mov [bp+si+00h],bh
mov [bp+si+01h],bl
mov dx,[bp+0a0h]
mov ax,[bp+0a2h]
mov bx,0010h
mov si,0008h
mov di,0002h
push ax
push dx
push bx
push si
push di
mov cx,bp
mov di,0002h
push cx
push di
call numberprn
add sp,000eh
lea dx,[bp+0000h]
mov cx,002ah
mov bx,0001h
mov ax,04000h
; rem int 21h
add sp,0090h
pop ax
pop cx
pop dx
pop bx
pop bp
pop si
pop di
ret
; -------
prfail: xor bx,bx
lea dx,[bx+crashmsg]
mov ax,0900h
int 21h
mov ax,04c08h
int 21h
crashmsg: db "*** ERROR *** protected mo"
db "de is not supported.$$$$"
prmain: xor di,di
push ax
mov ax,ds
push ax
push di
mov ax,0010h
push ax
push di
call cmpy
add sp,08h
mov [di+rdsbase],ax
add di,0002h
mov [di+rdsbase],dx
xor di,di
push ax
push dx
call xmdebug
add sp,04h
call isnegwrap
; ax is negative if a20 is in wraparound mode.
push ax
push ds
call xmdebug
add sp,04h
xor di,di
cmp ax,di
js needxms
jmp aftxms
needxms: xor di,di
mov ax,cs
push ax
lea dx,[di+afta]
push dx
; ax=4310h to get xms driver entry point.
mov ax,04310h
int 2fh
; returns es:bx address to call with ax value
; for xms function
push es
push bx
; call xms entry point with ax = 0500h local enable a20
mov ax,0500h
retf
afta: xor di,di
call isnegwrap
; ax must be >= 0 now for enabled a20 confirmation.
push ax
push di
call xmdebug
add sp,04h
aftxms: xor di,di
cmp ax,di
jns getprb
prfail2: jmp prfail
; ax=1687h get DPMI calling address
getprb: mov ax,01687h
xor bx,bx
int 2fh
; returns BX flags (Must be ODD for 32-bits)
; returns SI number of paragraphs of needed
; reserved memory,
; returns ES:DI dpmi switch call point
; ----
; call es:di with ax = 1 or flags
; ES: private data area (If SI was != 0)
; returns with
; cf clear if in 16-bit protected mode.
; es psp 256 byte limit
; cs ss ds 64k byte limit 16 bit protected mode.
mov cx,0001h
and cx,bx
jz prfail2
mov cx,bx
or si,si
jz notalo
; *** ERROR *** primary documentation
; forgot shrink memory block
xor bx,bx
mov ax,[bx+0002h]
mov bx,ds
mov dx,es
mov es,bx
push ax
push bx
call xmdebug
add sp,04h
sub ax,bx
sub ax,si
sub ax,0001h
push ax
push si
call xmdebug
add sp,04h
; ax=4a00h bx=new size
; es: = base of resizable memory block
mov bx,ax
mov ax,04a00h
int 21h
jb prfail2
push bx
push ax
call xmdebug
add sp,04h
mov es,dx
; ------------------------ end of hidden 4a00h
mov ax,04800h
; ax=4800h allocate dos memory.
; bx= number of paragraphs needed.
push si
push ax
call xmdebug
add sp,04h
mov bx,si
int 21h
; ax = segment address of allocated block.
jb prfail2
notalo: mov dx,es
mov bx,cx
mov es,ax
mov ax,di
xor si,si
lea cx,[si+prcall]
mov si,cx
mov [si+01h],al
mov [si+02h],ah
mov [si+03h],dl
mov [si+04h],dh
push ax
push cx
call xmdebug
add sp,04h
push dx
push cx
call xmdebug
add sp,04h
mov ax,bx
or ax,0001h
jmp prcall
prfail3: jmp prfail2
; call with ax=flags
;(Must be ODD for 32-bit capable DPMI)
; ES: private data area
prcall: db 09ah
db "xx"
db "ss"
jb prfail3
; in 16-bit protected mode if carry flag clear.
; ax = 0002h bx = real mode segment value
; mov bx,0b800h
; mov ax,0002h
; int 31h
; ; reurns alias to real mode segment in ax
; mov di,0000h
; mov [di+pmvs],ax
; ----------------
mov ax,0000h
mov cx,0001h
int 31h
mov di,0000h
mov [di+pmcs],ax
; ax = 0000 cx = 0001 allocate new selector
mov ax,0000h
mov cx,0001h
int 31h
mov di,0000h
mov [di+pmds],ax
; ax is new selector
mov di,0000h
mov si,0002h
mov dx,[di+rdsbase]
mov cx,[si+rdsbase]
mov ax,0007h
mov bx,[di+pmcs]
int 31h
mov di,0000h
mov [di+pmcs],bx
; address = dx:cx ax=0007
; bx is selector to set linear address of
mov di,0000h
mov si,0002h
mov dx,[di+rdsbase]
mov cx,[si+rdsbase]
mov ax,0007h
mov bx,[di+pmds]
int 31h
mov di,0000h
mov [di+pmds],bx
; --------
mov di,0000h
mov bx,[di+pmcs]
mov ax,0008h
mov cx,0ffffh
mov dx,0ffffh
; cx:dx is segment limit
; bx is selector ax is 0008
int 31h
mov di,0000h
mov bx,[di+pmds]
mov ax,0008h
mov cx,0ffffh
mov dx,0ffffh
; cx:dx is segment limit
; bx is selector ax is 0008
int 31h
; ------------
mov di,0000h
mov bx,[di+pmcs]
mov ax,0009h
; bx is selector ax=0009
; cx is access rights code or data
mov cx,0cfffh
int 31h
mov di,0000h
mov [di+pmcs],bx
mov di,0000h
mov bx,[di+pmds]
mov ax,0009h
; bx is selector ax=0009
; cx is access rights code or data
mov cx,0cff3h
int 31h
mov di,0000h
mov [di+pmds],bx
; ------------------------
; ax=0501h allocate memory block
; bx:cx requested size in bytes
mov ax,0501h
mov bx,01ffh
mov cx,0fcffh
int 31h
; returns bx:cx linear address of block
; si:di handle
mov ax,di
mov dx,si
mov di,0000h
mov si,0002h
mov [di+memad],cx
mov [si+memad],bx
mov [di+memhan],ax
mov [si+memhan],dx
; -------------------
xor bx,bx
xor si,si
lea di,[bx+begin32]
; begin32 after32
cmp si,[bx+pmds]
jnz skipbigrsp
add si,[bx+rdsbase]
add di,[bx+rdsbase]
skipbigrsp: mov cx,sp
add si,sp
mov dx,ss
mov ax,[bx+pmds]
mov ss,ax
mov sp,si
push cx
push dx
lea cx,[bx+after32]
mov ax,cs
mov dx,[bx+pmcs]
push ax
push cx
push dx
push di
retf
after32: xor bx,bx
pop dx
pop ax
mov ss,dx
mov sp,ax
mov ds,dx
mov es,dx
mov ax,0502h
mov di,[bx+memhan]
mov bx,0002h
mov si,[bx+memhan]
int 31h
xor si,si
mov bx,[si+pmds]
mov ax,0001h
int 31h
xor si,si
mov bx,[si+pmcs]
mov ax,0001h
int 31h
xor si,si
mov ax,04c00h
int 21h
; --------------------
bits 32
; 32 bit subroutines are next
; void isubtract(*iminus08, *ibig0c, *itiny10)
; f8 esi fc edi 00 ebp 04 retad
; e8 eax ec ecx f0 edx f4 ebx
isubtract: push ebp
mov ebp,esp
push edi
push esi
push ebx
push edx
push ecx
push eax
mov ebx,[ebp+08h]
mov esi,[ebp+0ch]
mov edi,[ebp+010h]
clc
mov edx,[esi+00h]
sbb edx,[edi+00h]
mov [ebx+00h],edx
mov ecx,[esi+04h]
sbb ecx,[edi+04h]
mov [ebx+04h],ecx
mov edx,[esi+08h]
sbb edx,[edi+08h]
mov [ebx+08h],edx
mov ecx,[esi+0ch]
sbb ecx,[edi+0ch]
mov [ebx+0ch],ecx
jnz botsbb
mov edx,[ebx+08h]
or edx,[ebx+04h]
or edx,[ebx+00h]
jz botsbb
mov edx,0007h
and edx,0007h
botsbb: pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
mov [ebp+0ch],eax
mov eax,[ebp+04h]
mov [ebp+010h],eax
pop ebp
pop eax
pop eax
pop eax
ret
; end of isubtract
; void iadd(*isum08, *ilefa0c, *irighta10)
; f8 esi fc edi 00 ebp 04 retad
; e8 eax ec ecx f0 edx f4 ebx
iadd: push ebp
mov ebp,esp
push edi
push esi
push ebx
push edx
push ecx
push eax
mov ebx,[ebp+08h]
mov esi,[ebp+0ch]
mov edi,[ebp+010h]
clc
mov edx,[esi+00h]
adc edx,[edi+00h]
mov [ebx+00h],edx
mov ecx,[esi+04h]
adc ecx,[edi+04h]
mov [ebx+04h],ecx
mov edx,[esi+08h]
adc edx,[edi+08h]
mov [ebx+08h],edx
mov ecx,[esi+0ch]
adc ecx,[edi+0ch]
mov [ebx+0ch],ecx
jnz botadc
mov edx,[ebx+08h]
or edx,[ebx+04h]
or edx,[ebx+00h]
jz botadc
mov edx,0007h
and edx,0007h
botadc: pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
mov [ebp+0ch],eax
mov eax,[ebp+04h]
mov [ebp+010h],eax
pop ebp
pop eax
pop eax
pop eax
ret
; end of iadd
; impy(*iprod1008, *isl1012, *isr1016)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 sr2
; 944 sl2
; 940 espsave
impy: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
mov ecx,esp
sub esp,036
mov [ebp+940],ecx
mov ebx,[ebp+1008]
push ebx
push ebx
push ebx
call isubtract
; rem add esp,00 12
mov eax,[ebp+1012]
mov ecx,[ebp+1016]
lea edi,[ebp+960]
lea esi,[ebp+944]
push ebx
push eax
push esi
call iadd
; rem add esp,00 12
push ebx
push ecx
push edi
call iadd
; rem add esp,00 12
xor ecx,ecx
impyl: mov edx,0001h
and edx,[edi+00h]
jz impyzt
push esi
push ebx
push ebx
call iadd
; rem add esp,00 12
impyzt: clc
rcr [edi+12],1
rcr [edi+08],1
rcr [edi+04],1
rcr [edi+00],1
push esi
push esi
push esi
call iadd
; rem add esp,00 12
xor eax,eax
or eax,[edi+12]
or eax,[edi+08]
or eax,[edi+04]
or eax,[edi+00]
jz impyq
add ecx,0001
cmp ecx,0128
js impyl
impyq: mov edx,[ebp+940]
mov esp,edx
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
mov [ebp+1012],eax
mov eax,[ebp+1004]
mov [ebp+1016],eax
pop ebp
pop eax
pop eax
pop eax
ret
; end of impy
; iposdiv(*ifrac1008, *inume1012, *idenom1016)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 bigcstone
; 944 rnumel
; 928 rnumer
; 912 (rnumel - *idenom1016)
; 908
iposdiv: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
sub esp,0068
mov ebx,[ebp+1008]
push ebx
push ebx
push ebx
call isubtract
lea edx,[ebp+944]
push edx
push edx
push edx
call isubtract
lea eax,[ebp+960]
push eax
push eax
push eax
call isubtract
lea eax,[ebp+928]
mov esi,[ebp+1012]
push esi
push edx
push eax
call iadd
mov edi,0001
mov [ebp+960],edi
mov ecx,0000
mov edi,[ebp+1016]
divzop: lea eax,[ebp+928]
clc
rcl [eax+00],1
rcl [eax+04],1
rcl [eax+08],1
rcl [eax+12],1
rcl [eax+16],1
rcl [eax+20],1
rcl [eax+24],1
rcl [eax+28],1
lea edx,[ebp+944]
push ebx
push ebx
push ebx
call iadd
lea eax,[ebp+912]
push edi
push edx
push eax
call isubtract
jb divnotfit
push edi
push edx
push edx
call isubtract
lea eax,[ebp+960]
push eax
push ebx
push ebx
call iadd
divnotfit: add ecx,0001
cmp ecx,0128
jns donedivi
jmp divzop
donedivi: add esp,0068
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
mov [ebp+1012],eax
mov eax,[ebp+1004]
mov [ebp+1016],eax
pop ebp
pop eax
pop eax
pop eax
ret
; end of iposdiv
; iwrtsc(*cdesi1008,zsub01012,iwwid1016,
; iwbase1020,*iwfrom1024)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 iwlbase
; 912 iwprod 928 iwfrac 944 iwtop
; 864 temp128 880 negone 896 iwrem
; 736 chw[128]
; 728 tnyiwctr 732 tnynegw
iwrtsc: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
mov ecx,0064
xor ebx,ebx
iwrtsu: push ebx
sub ecx,0001
jnz iwrtsu
mov ecx,[ebp+1020]
mov [ebp+960],ecx
mov eax,[ebp+1024]
lea edx,[ebp+944]
push edx
push eax
push edx
call isubtract
jns iwkeepoz
mov edi,0001
mov [ebp+896],edi
lea esi,[ebp+896]
lea edi,[ebp+880]
push esi
push edi
push edi
call isubtract
push eax
push edi
push edx
call isubtract
mov ecx,0001
mov [ebp+732],ecx
iwkeepoz: mov ecx,[ebp+1016]
mov [ebp+728],ecx
iwlopt: mov ecx,[ebp+728]
sub ecx,0001
jns iwlket
jmp iwkeeb
iwlket: mov [ebp+728],ecx
lea edi,[ebp+960]
lea esi,[ebp+944]
lea ebx,[ebp+928]
push edi
push esi
push ebx
call iposdiv
lea eax,[ebp+912]
push edi
push ebx
push eax
call impy
lea edx,[ebp+864]
push edx
push edx
push edx
call isubtract
lea ecx,[ebp+896]
push eax
push esi
push ecx
call isubtract
push edx
push ebx
push esi
call iadd
xor esi,esi
cmp esi,[ebp+732]
jz keepotwo
lea eax,[ebp+880]
push eax
push edi
push edx
call iadd
push ecx
push edx
push ecx
call isubtract
keepotwo: mov edx,[ebp+896]
mov edi,[ebp+728]
mov [ebp+edi*1+736],dl
jmp iwlopt
iwkeeb: mov ebx,0000
iwklopb: cmp ebx,[ebp+1016]
jns iwkpop
mov edi,ebx
add edi,[ebp+1012]
add edi,[ebp+1008]
mov esi,ebx
xor edx,edx
or dl,[ebp+esi*1+736]
cmp edx,0016
js iwisnume
iwibreak: mov edx,0000
sub edx,0006
iwisnume: cmp edx,0010
js iwnonsev
add edx,0007
iwnonsev: add edx,0048
mov [edi+0000],dl
add ebx,0001
jmp iwklopb
iwkpop: add esp,0256
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
mov [ebp+1020],eax
mov eax,[ebp+1004]
mov [ebp+1024],eax
pop ebp
pop eax
pop eax
pop eax
pop eax
pop eax
ret
; end of iwrtsc
; balrzint()
; 00 ebp 04 retad
balrzint: push ebp
mov ebp,esp
mov eax,[ebp+04]
pop ebp
ret
; int balrzpos()
; 988 ebx 992 esi 996 edi 1000 ebp 1004 retad
balrzpos: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
xor edi,edi
lea ebx,[edi+aftrzint]
call balrzint
aftrzint: sub eax,ebx
pop ebx
pop esi
pop edi
pop ebp
ret
; bottom of balrzpos
; ---------
; int128 prdos3221()
; call with data ebx:edx:ecx:eax
; edi is interrupt type
; returns ebx:edx:ecx:eax and flags
; 992 edi 996 flags 1000 ebp 1004 retad
; 976 ecx 980 edx 984 ebx 988 esi
; 960 balpoz 964 ds 968 es 972 eax
prdos3221: push ebp
mov ebp,esp
sub ebp,1000
pushf
push edi
push esi
push ebx
push edx
push ecx
push eax
push es
push ds
call balrzpos
push eax
mov esi,[ebp+960]
mov ecx,ss
mov ds,ecx
mov es,ecx
lea edi,[esi+ioobase]
mov eax,[ebp+992]
mov [edi+00],eax
mov eax,[ebp+988]
mov [edi+04],eax
mov eax,[ebp+1000]
mov [edi+08],eax
mov eax,[ebp+984]
mov [edi+16],eax
mov eax,[ebp+980]
mov [edi+20],eax
mov eax,[ebp+976]
mov [edi+24],eax
mov eax,[ebp+972]
mov [edi+28],eax
mov edx,[ebp+996]
mov [edi+32],dl
mov [edi+33],dh
mov eax,0768
mov ecx,0000
mov ebx,[ebp+992]
int 31h
xor esi,esi
add esi,ebp
add esi,960
mov esp,esi
mov ecx,ss
mov ds,ecx
mov es,ecx
mov ebx,[ebp+960]
lea edi,[ebx+ioobase]
mov edx,[ebp+996]
mov dl,[edi+32]
mov dh,[edi+33]
mov [ebp+996],edx
mov eax,[edi+028]
mov ecx,[edi+024]
mov edx,[edi+020]
mov ebx,[edi+016]
add esp,04
pop ds
pop es
add esp,0016
pop esi
pop edi
popf
pop ebp
ret
; bottom of prdos3221
; int dwmpy(sl,sr)
; 1004 retad.ecx 1008 sl.edx 1012 sr.retad
; 988 ebx 992 esi 996 edi 1000 ebp
dwmpy: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
xor eax,eax
mov ebx,[ebp+1004]
mov esi,[ebp+1008]
mov edi,[ebp+1012]
mov [ebp+1012],ebx
mov [ebp+1008],edx
mov [ebp+1004],ecx
mov ecx,0032
mov ebx,0001
dwmploop: mov edx,ebx
and edx,edi
jz dwskipm
add eax,esi
dwskipm: shr edi,1
add esi,esi
or edi,edi
jz dwpopm
sub ecx,ebx
jnz dwmploop
dwpopm: pop ebx
pop esi
pop edi
pop ebp
pop ecx
pop edx
ret
; bottom of dwmpy
; int keynowait()
; 1004 retad
; 988 esi 992 edi 996 flags 1000 ebp
; 972 eax 976 ecx 980 edx 984 ebx
keynowait: push ebp
mov ebp,esp
sub ebp,1000
pushf
push edi
push esi
push ebx
push edx
push ecx
push eax
mov ecx,ss
mov ds,ecx
mov es,ecx
xor esi,esi
redkoop: mov eax,01536
mov edi,0021h
xor edx,edx
add edx,00255
call prdos3221
pushf
pop ecx
mov [ebp+996],ecx
xor ecx,ecx
mov [ebp+972],ecx
mov edx,0064
and edx,[ebp+996]
jz yekeyab
jmp nokeyab
; ----------------
yekeyab: and eax,00ffh
mov ebx,0002
push ebx
push eax
call dwmpy
add esi,eax
call balrzpos
mov edi,eax
lea ebx,[edi+wkeytable]
xor edx,edx
mov dl,[ebx+esi*1+00]
mov dh,[ebx+esi*1+01]
mov ebx,edi
mov edi,[ebx+shifstate]
mov eax,[ebx+edi*1+shifmask]
mov edi,[ebx+ctrlstate]
mov ecx,[ebx+edi*1+ctrlmask]
and edx,eax
and edx,ecx
mov [ebp+972],edx
mov eax,0000h
mov ecx,0100h
and ecx,edx
jz nrshiftkn
mov [ebx+shifstate],eax
nrshiftkn: mov ecx,0200h
and ecx,edx
jz nrctrlkn
mov [ebx+ctrlstate],eax
nrctrlkn: mov eax,0004h
mov ecx,0400h
and ecx,edx
jz nsshiftkn
mov [ebx+shifstate],eax
nsshiftkn: mov ecx,0800h
and ecx,edx
jz nsctrlkn
mov [ebx+ctrlstate],eax
nsctrlkn: mov ecx,2000h
and ecx,edx
jz nokeyab
mov esi,0512
jmp redkoop
nokeyab: pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
popf
pop ebp
ret
; bottom of keynowait
; prwrtone(1008 Bata1, 1012 whan01)
; 988 esi 992 edi 996 flags
; 1000 ebp 1004 retad
; 972 eax 976 ecx 980 edx 984 ebx
; 960 balzw 964 es 968 ds
prwrtone: push ebp
mov ebp,esp
sub ebp,1000
pushf
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
push eax
call balrzpos
mov [ebp+960],eax
mov esi,[ebp+960]
lea edx,[esi+wbuff11]
mov ecx,[ebp+1008]
mov [esi+wbuff11],ecx
mov eax,[ebp+1004]
xor ecx,ecx
add ecx,0001
mov ebx,[ebp+1012]
mov [ebp+1012],eax
mov eax,16384
mov edi,0033
call prdos3221
pushf
pop esi
mov [ebp+996],esi
add esp,0004
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
popf
pop ebp
add esp,0008
ret
; bottom of prwrtone(ByVal byteD,ByVal Hanl)
; ------------
; long edx:eax redpr18(1008 len18, 1012 rhan018)
; maximum read record length is 8 bytes.
; 988 esi 992 edi 996 flags 1000 ebp
; 1004 retad
; 972 eax 976 ecx 980 edx 984 ebx
; 960 balz 964 es 968 ds
redpr18: push ebp
mov ebp,esp
sub ebp,1000
pushf
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
push eax
mov ecx,[ebp+1008]
call balrzpos
mov [ebp+960],eax
mov esi,[ebp+960]
lea edx,[esi+rbuff118]
mov ebx,[ebp+1012]
mov eax,16128
mov edi,0033
call prdos3221
pushf
pop esi
mov [ebp+996],esi
mov ebx,[ebp+960]
lea edi,[ebx+rbuff118]
mov eax,[edi+00]
mov edx,[edi+04]
mov [ebp+972],eax
mov ecx,[ebp+1008]
cmp ecx,0005
js popr18
mov [ebp+980],edx
popr18: mov esi,[ebp+1004]
mov [ebp+1012],esi
add esp,0004
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
popf
pop ebp
add esp,0008
ret
; bottom of redpr18
; int wlens(1008 *wstr, 1012 wlset)
; 992 esi 996 edi 1000 ebp 1004 retad
; 972 es 976 ds 980 ecx 984 edx 988 ebx
wlens: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push ds
push es
mov edx,ss
mov es,edx
mov ds,edx
mov ebx,[ebp+1012]
add ebx,[ebp+1008]
mov edx,0033
xor esi,esi
wlolop: xor eax,eax
mov al,[ebx+esi*1+0000]
cmp eax,edx
js wlobot
add esi,0001
cmp esi,0122
js wlolop
wlobot: mov eax,[ebp+1004]
mov [ebp+1012],eax
mov [ebp+1008],esi
pop es
pop ds
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
pop eax
ret
; bottom of wlens
; void flags wsymeq(1008 *wlstc,1012 wlsvt,
; 1016 *wrstc,1020 wrsvt)
; 996 flags 1000 ebp 1004 retad
; 980 edx 984 ebx 988 esi 992 edi
; 964 es 968 ds 972 eax 976 ecx
wsymeq: push ebp
mov ebp,esp
sub ebp,1000
pushf
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov edx,ss
mov ds,edx
mov es,edx
mov esi,[ebp+1008]
add esi,[ebp+1012]
mov edi,[ebp+1016]
add edi,[ebp+1020]
xor ecx,ecx
sub ecx,0001
xor ecx,0064
and ecx,[ebp+996]
mov [ebp+1016],ecx
mov eax,[ebp+1004]
mov [ebp+1020],eax
mov edx,[ebp+972]
mov [ebp+1012],edx
xor ebx,ebx
push ebx
push esi
call wlens
mov ecx,eax
push ebx
push edi
call wlens
cmp eax,ecx
jnz wsymquit
or eax,ecx
jz wsymquit
cmp ecx,0121
jns wsymquit
xor ebx,ebx
wsymloop: xor edx,edx
mov dl,[ebx+esi*1+0000h]
cmp dl,[ebx+edi*1+0000h]
jnz wsymquit
add ebx,0001
cmp ebx,ecx
js wsymloop
mov edx,0064
or [ebp+1016],edx
wsymquit: pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
add esp,0004
pop ebp
add esp,0008
pop eax
popf
ret
; end of wsymeq
; ideb128(*wfset1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 896 iwbuff80[80]
ideb128: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
mov ecx,0020
mov ebx,020202020h
idebu: push ebx
dec ecx
jnz idebu
mov ecx,ss
mov ds,ecx
mov es,ecx
; -----------
mov esi,[ebp+1008]
lea edi,[ebp+896]
mov edx,0013
mov eax,0010
mov [edi+0038],dl
mov [edi+0039],al
mov eax,0016
mov ecx,0032
mov edx,0002
push esi
push eax
push ecx
push edx
push edi
call iwrtsc
xor esi,esi
mov ecx,0040
mov eax,0001
lea edx,[ebp+0896]
push esi
push esi
push ecx
push edx
push eax
call suwf014
botdeby add esp,0080
pop eax
pop ecx
pop edx
pop ebx
pop esi
mov edi,[ebp+1004]
mov [ebp+1008],edi
pop edi
mov [ebp+1004],edi
pop ebp
pop edi
ret
; bottom of ideb128
begin32: xor ebx,ebx
mov ecx,ss
mov ds,ecx
mov es,ecx
sub esp,512
mov ebp,esp
call wstrinit
mov [ebp+0012],ebx
mov [ebp+0008],ebx
mov [ebp+0004],ebx
mov [ebp+0000],ecx
lea edi,[ebp+0000]
xor eax,eax
push eax
call sugmh09
mov ebx,eax
xor edi,edi
mov ecx,16384
mov edx,090909090h
rnopu: mov [ebx+edi*1+0000],edx
add edi,0004
sub ecx,0001
jnz rnopu
lea esi,[ebx+memad]
lea edi,[ebp+0000]
call yload
mov [ebp+0008],eax
lea edi,[ebp+0000]
push edi
call ideb128
mov edx,[ebp+0008]
or edx,edx
jnz notrst
call balrzpos
mov ebx,eax
xor eax,eax
push eax
call sugmh09
mov edx,eax
sub edx,0016
mov esp,edx
lea edx,[ebx+notrun]
push edx
push eax
ret
notrun: xor edi,edi
jnz notrst
mov eax,0003
mov edi,0016
call prdos3221
notrst: mov eax,04c00h
int 21h
; invalid add esp,512
retf
db "xxxxx..........."
db "xx.xx"
; -------------------
rdleft dd 0
rdtop dd 0
rdright dd 0
rdbottom dd 0
absinner dd 0
sacreate dd 619
sadestroy dd 620
sapaint dd 633
sakeydown dd 874
sakeyup dd 875
rickdraw dd 0
rickrun dd 0001
; subroutine string
lpsdd01 dd 0000,0000
; xxxxxxxxxxxxxxxxxxx
lpch05 dd 0000,0000
lpcfa06 dd 0000,0000
lpgcl07 dd 0000,0000
lpgcl08 dd 0000,0000
lpgmh09 dd 0000,0000
lpgl010 dd 0000,0000
lpgu011 dd 0000,0000
lprf012 dd 0000,0000
lpsfp013 dd 0000,0000
lpwf014 dd 0000,0000
; xxxxxxxxxxxxxxxxxxxx
lpbp016 dd 0000,0000
lpcc017 dd 0000,0000
lpcwe018 dd 0000,0000
lpdwp19 dd 0000,0000
lpdma20 dd 0000,0000
lpep021 dd 0000,0000
lpgco22 dd 0000,0000
lpgcd23 dd 0000,0000
lpgma24 dd 0000,0000
lpgwr25 dd 0000,0000
lplca26 dd 0000,0000
lplica27 dd 0000,0000
lpoc28 dd 0000,0000
lppqm29 dd 0000,0000
lprw30 dd 0000,0000
lprca31 dd 0000,0000
lpsw32 dd 0000,0000
lptm33 dd 0000,0000
lpuw34 dd 0000,0000
; ---------------------
; ---------------------
; ---------------------
; ---------------------
; additional luxury functions
lprca35 dd 0000,0000
lpwca36 dd 0000,0000
lpgsh37 dd 0000,0000
dd 0,0,0,0,0,0,0,0
; --------------
; -------
; ----
sdd01 db "SetDIBitsToDevice"
db 0, 0, 0, 0, 0
; xxxxxxxxxxxxxxxxxxxxxxxxxxx
ch05 db "CloseHandle"
db 0, 0
cfa06 db "CreateFileA"
db 0, 0
; ......................
gcl07 db "GetCommandLineA"
db 0, 0
gcl08 db "GetCommandLineW"
db 0, 0
gmh09 db "GetModuleHandleA"
db 0, 0
gl010 db "GlobalLock"
db 0, 0
gu011 db "GlobalUnlock"
db 0, 0
rf012 db "ReadFile"
db 0, 0
sfp013 db "SetFilePointer"
db 0, 0
wf014 db "WriteFile"
db 0, 0
; xxxxxxxxxxxxxxxxxxx
bp016 db "BeginPaint"
db 0, 0
cc017 db "CloseClipboard"
db 0, 0
cwe018 db "CreateWindowExA"
db 0, 0
dwp19 db "DefWindowProcA"
db 0, 0
dma20 db "DispatchMessageA"
db 0, 0, 0
ep021 db "EndPaint"
db 0, 0
gco22 db "GetClipboardOwner"
db 0, 0
gcd23 db "GetClipboardData"
db 0, 0
gma24 db "GetMessageA"
db 0, 0
gwr25 db "GetWindowRect"
db 0, 0
lca26 db "LoadCursorA"
db 0, 0
lica27 db "LoadIconA"
db 0, 0
oc28 db "OpenClipboard"
db 0, 0
pqm29 db "PostQuitMessage"
db 0, 0
rw30 db "RedrawWindow"
db 0, 0
rca31 db "RegisterClassA"
db 0, 0
sw32 db "ShowWindow"
db 0, 0
tm33 db "TranslateMessage"
db 0, 0
uw34 db "UpdateWindow"
db 0, 0
; ----------
; ----------
; ----------
; ----------
; additional luxury names
rca35 db "ReadConsoleA"
db 0, 0, 0, 0
wca36 db "WriteConsoleA"
db 0, 0, 0
gsh37 db "GetStdHandle"
db 0, 0, 0, 0
; ----------------
; void wstrinit()
; --
; --
wstrinit: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov es,ecx
mov ds,ecx
call balrzpos
mov ebx,eax
; -------------------
lea edx,[ebx+susdd01]
lea edi,[ebx+lpsdd01]
lea esi,[ebx+sdd01]
mov [edi+0000],edx
mov [edi+0004],esi
; -------------------
lea edx,[ebx+such05]
lea edi,[ebx+lpch05]
lea esi,[ebx+ch05]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sucfa06]
lea edi,[ebx+lpcfa06]
lea esi,[ebx+cfa06]
mov [edi+0000],edx
mov [edi+0004],esi
; ?????????????????
lea edx,[ebx+sugcl07]
lea edi,[ebx+lpgcl07]
lea esi,[ebx+gcl07]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugcl08]
lea edi,[ebx+lpgcl08]
lea esi,[ebx+gcl08]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugmh09]
lea edi,[ebx+lpgmh09]
lea esi,[ebx+gmh09]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugl010]
lea edi,[ebx+lpgl010]
lea esi,[ebx+gl010]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugu011]
lea edi,[ebx+lpgu011]
lea esi,[ebx+gu011]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+surf012]
lea edi,[ebx+lprf012]
lea esi,[ebx+rf012]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+susfp013]
lea edi,[ebx+lpsfp013]
lea esi,[ebx+sfp013]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+suwf014]
lea edi,[ebx+lpwf014]
lea esi,[ebx+wf014]
mov [edi+0000],edx
mov [edi+0004],esi
; ---------------------
lea edx,[ebx+subp016]
lea edi,[ebx+lpbp016]
lea esi,[ebx+bp016]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+succ017]
lea edi,[ebx+lpcc017]
lea esi,[ebx+cc017]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sucwe018]
lea edi,[ebx+lpcwe018]
lea esi,[ebx+cwe018]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sudwp19]
lea edi,[ebx+lpdwp19]
lea esi,[ebx+dwp19]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sudma20]
lea edi,[ebx+lpdma20]
lea esi,[ebx+dma20]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+suep021]
lea edi,[ebx+lpep021]
lea esi,[ebx+ep021]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugco22]
lea edi,[ebx+lpgco22]
lea esi,[ebx+gco22]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugcd23]
lea edi,[ebx+lpgcd23]
lea esi,[ebx+gcd23]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugma24]
lea edi,[ebx+lpgma24]
lea esi,[ebx+gma24]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sugwr25]
lea edi,[ebx+lpgwr25]
lea esi,[ebx+gwr25]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sulca26]
lea edi,[ebx+lplca26]
lea esi,[ebx+lca26]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sulica27]
lea edi,[ebx+lplica27]
lea esi,[ebx+lica27]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+suoc28]
lea edi,[ebx+lpoc28]
lea esi,[ebx+oc28]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+supqm29]
lea edi,[ebx+lppqm29]
lea esi,[ebx+pqm29]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+surw30]
lea edi,[ebx+lprw30]
lea esi,[ebx+rw30]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+surca31]
lea edi,[ebx+lprca31]
lea esi,[ebx+rca31]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+susw32]
lea edi,[ebx+lpsw32]
lea esi,[ebx+sw32]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+sutm33]
lea edi,[ebx+lptm33]
lea esi,[ebx+tm33]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+suuw34]
lea edi,[ebx+lpuw34]
lea esi,[ebx+uw34]
mov [edi+0000],edx
mov [edi+0004],esi
; luxury section
; luxury section
; ------
; ------
lea edx,[ebx+surf012]
lea edi,[ebx+lprca35]
lea esi,[ebx+rca35]
mov [edi+0000],edx
mov [edi+0004],esi
lea edx,[ebx+suwf014]
lea edi,[ebx+lpwca36]
lea esi,[ebx+wca36]
mov [edi+0000],edx
mov [edi+0004],esi
; --
lea edx,[ebx+sugsh37]
lea edi,[ebx+lpgsh37]
lea esi,[ebx+gsh37]
mov [edi+0000],edx
mov [edi+0004],esi
; -----------------
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
ret
; bottom of wstrinit
; rename SetDIBitsToDevice susdd01
; void susdd01(hdc1008,xdest1012,ydest1016,
; srcwid1020,srchgt1024,
; xsrc1028,ysrc1032,ustartscanline1036,cscanlines1040,
; *lpvbits621044,*lpbmi141048,clru1052)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 scrnA000 964 balrZ 968 es 972 ds
; 944 rawdep 948 cst80 952 rawhgt 956 rawWid
; 928 932 bxd 936 maxhgt 940 bwid
; 912 916 920 edistart 924
; 896 900 904 908 esistart
; 880 884 888 892
; 868 872 876
susdd01: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,0025
xor ebx,ebx
susdd61pu: push ebx
sub ecx,0001
jnz susdd61pu
mov edx,ss
mov es,edx
mov ds,edx
call balrzpos
mov [ebp+964],eax
mov ebx,[ebp+964]
mov ecx,[ebx+rdsbase]
mov esi,[ebp+964]
mov edi,0000
mov [esi+rickdraw],edi
mov edi,0A0000h
sub edi,ecx
mov [ebp+960],edi
mov edx,0080
mov [ebp+948],edx
xor eax,eax
xor ecx,ecx
xor edx,edx
mov esi,[ebp+1048]
sub esi,0014
mov al,[esi+0018]
mov ah,[esi+0019]
mov cl,[esi+0022]
mov ch,[esi+0023]
mov dl,[esi+0028]
mov dh,[esi+0029]
mov [ebp+956],eax
mov [ebp+952],ecx
mov [ebp+944],edx
cmp edx,0001
jz susdd63
susdd62: jmp susdd01fail
susdd63: xor edx,edx
xor ecx,ecx
jz susdd65
or dl,[esi+054]
or dl,[esi+055]
or dl,[esi+056]
or dl,[esi+057]
jnz susdd65
mov eax,00ffh
and al,[esi+058]
and al,[esi+059]
and al,[esi+060]
cmp eax,00ffh
jz susdd65
; 2390 set colors
mov dh,[esi+058]
mov ch,[esi+059]
mov cl,[esi+060]
mov edi,0010h
mov eax,01010h
mov ebx,0001h
call prdos3221
susdd65: mov ebx,[ebp+964]
mov eax,[ebp+956]
mov ecx,[ebp+952]
mov edx,[ebp+944]
mov esi,eax
add esi,0031
mov ecx,0005
shr esi,cl
add esi,esi
add esi,esi
mov [ebp+940],esi
mov edx,[ebp+1012]
mov ecx,0003
shr edx,cl
mov [ebp+932],edx
add edx,esi
cmp edx,0080
js sus2417
sus2416: jmp susdd62
sus2417: mov esi,[ebp+952]
sub esi,0001
add esi,[ebp+1016]
cmp esi,0480
jns sus2416
mov [ebp+936],esi
mov edx,[ebp+1044]
mov [ebp+0908],edx
mov ecx,[ebp+948]
mov edx,[ebp+936]
push ecx
push edx
call dwmpy
mov edi,[ebp+960]
add edi,eax
add edi,[ebp+932]
mov [ebp+920],edi
susdd68: xor edx,edx
or edx,[ebp+952]
jnz susdd70
jmp susdd62
susdd70: mov edx,0001
sub [ebp+952],edx
mov esi,[ebp+908]
mov edi,[ebp+920]
mov ecx,[ebp+940]
mov edx,[ebp+948]
add [ebp+908],ecx
sub [ebp+920],edx
rep
movsb
xor ecx,ecx
jz susdd68
susdd01fail: mov edx,[ebp+1004]
mov [ebp+1052],edx
add esp,0100
pop es
pop ds
pop eax
mov [ebp+1048],eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0044
pop eax
ret
; bottom of susdd01
; --------------------------
; rename CloseHandle such05
; such05(hObject1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
such05: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov es,ecx
mov ds,ecx
mov ebx,[ebp+1008]
mov eax,03e00h
mov edi,0021h
call prdos3221
mov edx,[ebp+1004]
mov [ebp+1008],edx
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
ret
; bottom of CloseHandle such05
; rename CreateFileA sucfa06
; int sucfa06(*gcfn1008,drwsel1012,zsm,*securnel,dwcd,
; zattrib,cfnelly1032)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 balzop 964 968 es 972 ds
; 944 948 0c010002 952 956
sucfa06: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,0006
xor ebx,ebx
cfa06u: push ebx
sub ecx,0001
jnz cfa06u
call balrzpos
mov [ebp+960],eax
xor edi,edi
mov esi,[ebp+960]
lea ebx,[esi+fnbuffaz]
xor eax,eax
clr06i: mov [ebx+edi*1+00],al
add edi,0001
cmp edi,0128
js clr06i
xor eax,eax
mov esi,[ebp+1008]
push eax
push esi
call wlens
mov ecx,eax
cmp ecx,02
js nofnc
xor edi,edi
lop06j: mov al,[esi+00]
mov [ebx+edi*1+00],al
add esi,0001
add edi,0001
cmp edi,ecx
js lop06j
nofnc: mov esi,0200010ch
mov [ebp+948],esi
xor edx,edx
mov ecx,0006
mov dl,[ebp+1015]
shr edx,cl
mov esi,edx
xor eax,eax
mov al,[ebp+esi*1+0948]
cmp eax,0001h
jz cfatrun
add eax,03d00h
mov edx,[ebp+1008]
xor ecx,ecx
jz cfacmn
cfatrun: add eax,03c00h
mov edx,[ebp+1008]
mov ecx,0032
cfacmn: mov esi,[ebp+960]
lea edx,[esi+fnbuffaz]
mov edi,0021h
call prdos3221
jnb isvfn
xor eax,eax
isvfn: mov [ebp+1028],eax
mov ecx,[ebp+1004]
mov [ebp+1032],ecx
add esp,0024
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0024
pop eax
ret
; bottom of sucfa06
; rename GetCommandLineA sugcl07
; char* sugcl07()
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sugcl07: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov ebx,eax
xor edx,edx
mov dl,[ebx+0080h]
or edx,edx
jz gclnull7
xor edi,edi
lea esi,[ebx+0082h]
push edi
push esi
call wlens
sub edx,003
cmp eax,edx
jns gclnull7
add esi,eax
add esi,001
mov [ebp+976],esi
gclnull7: pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
ret
; bottom of sugcl07
; rename GetCommandLineW sugcl08
; char* sugcl08()
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 668 ar300 968 es 972 ds
sugcl08: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,0075
xor ebx,ebx
pugcl08: push ebx
sub ecx,001
jnz pugcl08
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov ebx,eax
xor edx,edx
mov dl,[ebx+0080h]
or edx,edx
jnz gcl82673
jmp gclnull8
gcl82673: lea esi,[ebx+0082h]
xor edi,edi
push edi
push esi
call wlens
sub edx,003
cmp eax,edx
js gclpro8
jmp gclnull8
gclpro8: add esi,eax
add esi,001
mov edi,0000
gcloo8: xor edx,edx
mov dl,[esi+0]
cmp edx,0033
js gclcomp81
mov [ebp+edi*1+0668],dl
add esi,001
add edi,002
cmp edi,0123
js gcloo8
gclcomp81: mov [ebp+edi*1+0668],dl
add esi,001
add edi,002
gclcvmp81: xor edx,edx
mov dl,[esi+0]
cmp edx,0033
js gclcomp82
mov [ebp+edi*1+0668],dl
add esi,001
add edi,002
cmp edi,0123
js gclcvmp81
gclcomp82: mov ecx,edi
add ecx,004
xor edi,edi
gcl002: xor edx,edx
mov dl,[ebp+edi*1+0668]
mov [ebx+edi*1+0082h],dl
add edi,0001
cmp edi,ecx
js gcl002
lea esi,[ebx+0082h]
mov [ebp+976],esi
gclnull8: add esp,0300
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
ret
; bottom of sugcl08
; rename GetModuleHandleA sugmh09
; int sugmh09(neednull09)
; 1008 neednull09
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sugmh09: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov ebx,eax
mov edi,[ebx+memad]
mov esi,[ebx+rdsbase]
mov edx,edi
sub edx,esi
xor ecx,ecx
cmp edx,1048576
jns bigmh09
add ecx,1048576
bigmh09: add ecx,524288
add ecx,edx
mov [ebp+976],ecx
mov esi,[ebp+1004]
mov [ebp+1008],esi
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
ret
; bottom of sugmh09
; rename GlobalLock sugl010
; int sugl010(*hmemL1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sugl010: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov ebx,eax
; -----
mov edx,[ebp+1004]
mov [ebp+1008],edx
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
ret
; bottom of sugl010
; rename GlobalUnlock sugu011
; int sugl011(*hmemUL1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sugu011: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov ebx,eax
; -----
mov edx,[ebp+1004]
mov [ebp+1008],edx
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
ret
; bottom of sugu011
; rename ReadFile surf012
; int surf012(rhfile1008,*rlpbuffer1012,rwidth1016,
; *outwidr1020,*nellyr1024)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 read03 964 read47 968 es 972 ds
; 944 948 952 956 hmanylong
; 928 932 936 940 hrem
surf012: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,0010
xor ebx,ebx
purf012: push ebx
sub ecx,0001
jnz purf012
mov ecx,ss
mov ds,ecx
mov es,ecx
mov esi,[ebp+1016]
mov ebx,esi
and ebx,0007
mov [ebp+940],ebx
xor edi,edi
mov ebx,esi
mov ecx,0003
shr ebx,cl
mov [ebp+956],ebx
or ebx,[ebp+940]
jnz sjrf012
ecrf012: jmp btrf012
sjrf012: mov ebx,[ebp+1012]
tlrf012: xor esi,esi
cmp esi,[ebp+956]
jz rerf012
mov ecx,0008
mov eax,[ebp+1008]
push eax
push ecx
xor esi,esi
call redpr18
mov [ebp+960],eax
mov [ebp+964],edx
jnb torf012
mov [ebp+956],esi
mov [ebp+940],esi
torf012: mov edx,0001
tqrf012: xor eax,eax
mov al,[ebp+esi*1+960]
mov [ebx+edi*1+0000],al
add esi,edx
add edi,edx
sub ecx,edx
jnz tqrf012
mov esi,0001
sub [ebp+956],esi
jmp tlrf012
rerf012: mov ecx,[ebp+940]
rlrf012: xor esi,esi
cmp esi,ecx
jnz rirf012
jmp ecrf012
rirf012: xor edx,edx
add edx,0001
mov eax,[ebp+1008]
push eax
push edx
call redpr18
jnb xirf012
xor ecx,ecx
xirf012: mov [ebx+edi*1+0000],al
add edi,0001
sub ecx,0001
jnz rlrf012
btrf012: mov [ebp+976],edi
mov ebx,[ebp+1020]
or ebx,ebx
jz bzrf012
mov [ebx+0000],edi
bzrf012: mov esi,[ebp+1004]
mov [ebp+1024],esi
add esp,0040
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0020
ret
; bottom of surf012
; rename SetFilePointer susfp013
; dword susfp013(hsfile,dmovel,*dhigh,method)
; hsfile1008 dmovel1012 *dhigh1016 method1020
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 968 es 972 ds
susfp013: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
xor eax,eax
push eax
push eax
mov al,[ebp+1020]
add eax,04200h
mov ebx,[ebp+1008]
xor ecx,ecx
xor edx,edx
mov cl,[ebp+1014]
mov ch,[ebp+1015]
mov dl,[ebp+1012]
mov dh,[ebp+1013]
mov edi,0021h
call prdos3221
pushf
pop esi
mov [ebp+1016],esi
; mov [ebp+976],eax
or [ebp+976],al
or [ebp+977],ah
or [ebp+978],dl
or [ebp+979],dh
mov ebx,[ebp+1004]
mov [ebp+1020],ebx
add esp,0008
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0012
popf
ret
; bottom of susfp013
; rename WriteFile suwf014
; suwf014(whfile1008,*wlpbuffer1012,wwidth16,
; *outwid20,*nellyw)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
suwf014: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
xor esi,esi
mov ebx,[ebp+1012]
mov edi,[ebp+1008]
mov ecx,[ebp+1016]
olwf014: cmp esi,ecx
jns bcwf014
xor eax,eax
mov al,[ebx+esi*1+0000]
push edi
push eax
call prwrtone
jb bcwf014
add esi,0001
cmp esi,ecx
js olwf014
bcwf014: mov edi,[ebp+1020]
or edi,edi
jz bowf014
mov [edi+0000],esi
bowf014: mov [ebp+1020],esi
mov edx,[ebp+1004]
mov [ebp+1024],edx
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0016
pop eax
ret
; bottom of suwf014
; -----------------
; rename BeginPaint subp016
; void subp016(bphw1008,bps1012)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
subp016: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
xor esi,esi
mov edi,[ebp+976]
mov [ebp+1008],edi
mov edx,[ebp+1004]
mov [ebp+1012],edx
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,004
pop eax
ret
; bottom of subp016
; rename CloseClipboard succ017
; void succ017()
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
succ017: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
xor esi,esi
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
ret
; bottom of succ017
; rename CreateWindowExA sucwe018
; han sucwe018(isz01008,*jn1012,*snw1016,olap31020,
; xul1024,yul1028,widcw1032,hgtcw1036,
; cw81040,cw91044,*cwinstance1048,cwii1052)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balzloc 968 es 972 ds
; 944 sdLeft 948 sdTop 952 sdRight 956 sdBottom
; 928 932 936 940
sucwe018: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
xor ebx,ebx
mov ecx,0010
pucwe018: push ebx
sub ecx,0001
jnz pucwe018
call balrzpos
mov [ebp+964],eax
mov edx,[ebp+1004]
mov [ebp+1052],edx
mov esi,[ebp+1024]
mov edi,[ebp+1028]
cmp esi,0
js skipxye018
cmp edi,0
js skipxye018
cmp esi,608
jns skipxye018
cmp edi,476
jns skipxye018
and esi,4088
mov [ebp+944],esi
mov [ebp+948],edi
skipxye018: mov ecx,0032
mov edx,0004
add ecx,[ebp+944]
add edx,[ebp+948]
mov [ebp+952],ecx
mov [ebp+956],edx
mov ecx,[ebp+1032]
mov edx,[ebp+1036]
cmp ecx,032
js skipwhe018
cmp edx,04
js skipwhe018
add ecx,[ebp+944]
add edx,[ebp+948]
cmp ecx,641
jns skipwhe018
cmp edx,481
jns skipwhe018
mov [ebp+952],ecx
mov [ebp+956],edx
skipwhe018: xor eax,eax
push eax
call sugmh09
mov [ebp+1048],eax
mov ebx,[ebp+964]
mov ecx,0003
xywh018loop: mov esi,ecx
mov edi,ecx
mov edx,[ebp+esi*4+944]
mov [ebx+edi*4+rdleft],edx
sub ecx,0001
jns xywh018loop
; -------------------------
mov edi,0010h
mov eax,0011h
call prdos3221
; -------------------------
add esp,0040
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0044
pop eax
ret
; bottom of sucwe018
; rename DefWindowProcA sudwp19
; sudwp19(dwpa1008,dwpb1012,dwpc1016,dwpd1020)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sudwp19: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
mov esi,[ebp+976]
mov edi,[ebp+1004]
mov [ebp+1016],esi
mov [ebp+1020],edi
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0012
pop eax
ret
; bottom of sudwp19
; rename DispatchMessageA sudma20
; sudma20(msg* mcb1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balzloc 968 es 972 ds
; 944 h 948 msgtype 952 rawkey 956 dmouxy
sudma20: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
add eax,0001
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
xor ebx,ebx
mov ecx,0006
pudma20: push ebx
sub ecx,0001
jnz pudma20
call balrzpos
mov [ebp+964],eax
mov esi,[ebp+1008]
mov edx,[ebp+1004]
mov [ebp+1008],edx
mov eax,[esi+00]
mov ecx,[esi+04]
mov edx,[esi+08]
mov [ebp+944],eax
mov [ebp+948],ecx
mov [ebp+952],edx
mov eax,[esi+12]
mov [ebp+956],eax
mov ebx,[ebp+964]
lea edi,[ebx+afdma20]
mov esi,[ebx+absinner]
mov edx,[ebp+956]
mov ecx,[ebp+952]
mov eax,[ebp+948]
push edx
push ecx
push eax
mov edx,[ebp+944]
push edx
push edi
push esi
ret
afdma20: lea esi,[ebp+944]
mov esp,esi
add esp,0024
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
ret
; bottom of sudma20
; rename EndPaint suep021
; suep021(ephw1008,*eps1012)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
suep021: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
mov esi,[ebp+976]
mov edi,[ebp+1004]
mov [ebp+1008],esi
mov [ebp+1012],edi
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
pop eax
ret
; bottom of suep021
; rename GetClipboardOwner sugco22
; int sugco22()
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sugco22: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
; ----------
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
ret
; bottom of sugco22
; rename GetClipboardData sugcd23
; char* sugcd23(type1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sugcd23: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
mov esi,0000
mov edi,[ebp+1004]
mov [ebp+1008],edi
mov [ebp+1004],esi
; ----------
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
ret
; bottom of sugcd23
; rename GetMessageA sugma24
; int sugma24(*gmsg1008,zgm1012,zgm1016,zgm1020)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 cstnegmsg 964 balz 968 es 972 ds
; 944 hwnd 948 messtype 952 kelkey 956 dmouxy
; 928 than 932 tempmess 936 tmpkey 940 tmouxy
; 912 916 920 924
sugma24: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
xor ebx,ebx
mov ecx,0014
pugma24: push ebx
sub ecx,0001
jnz pugma24
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov [ebp+964],eax
xor edx,edx
push edx
call sugmh09
mov [ebp+944],eax
mov [ebp+928],eax
mov esi,[ebp+964]
mov ecx,0614
sub ecx,0616
sub ecx,0616
mov [ebp+960],ecx
mov edx,[ebp+1004]
mov [ebp+1020],edx
mov edi,[esi+rickrun]
mov [ebp+1016],edi
call keynowait
mov edi,eax
and edi,01000h
jnz iskey24
mov ecx,0000h
cmp ecx,[esi+rickdraw]
jz nonkey23
mov edx,[ebp+960]
add edx,[esi+sapaint]
mov [ebp+948],edx
nonkey23: jmp nonk0824
iskey24: mov [ebp+952],eax
mov edx,[ebp+960]
add edx,[esi+sakeydown]
mov [ebp+948],edx
mov edi,eax
mov ecx,[ebp+960]
add ecx,[esi+sakeyup]
mov edx,0010h
mov [ebp+932],ecx
mov [ebp+936],edx
lea ebx,[ebp+928]
and edi,0100h
jz nonk0124
push ebx
call sudma20
nonk0124: mov edi,eax
mov edx,0011h
mov [ebp+936],edx
and edi,0200h
jz nonk0224
push ebx
call sudma20
nonk0224: mov edi,eax
mov ecx,[ebp+960]
add ecx,[esi+sakeydown]
mov [ebp+932],ecx
mov edx,0010h
mov [ebp+936],edx
and edi,0400h
jz nonk0424
push ebx
call sudma20
nonk0424: mov edi,eax
mov edx,0011h
mov [ebp+936],edx
and edi,0800h
jz nonk0824
push ebx
call sudma20
nonk0824: mov ebx,[ebp+1008]
mov esi,0000h
xor edx,edx
loopgma24: mov dl,[ebp+esi*1+944]
mov [ebx+esi*1+0000],dl
add esi,0001
cmp esi,0016
js loopgma24
add esp,0056
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0012
pop eax
ret
; bottom of sugma24
; rename GetWindowRect sugwr25
; sugwr25(gwrhh1008,*gwrwh1012)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balz 968 es 972 ds
sugwr25: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
push eax
mov esi,[ebp+964]
mov edi,[ebp+1012]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
mov [edi+0000],eax
mov [edi+0004],ecx
mov [edi+0008],edx
mov [edi+0012],ebx
mov eax,[ebp+976]
mov edx,[ebp+1004]
mov [ebp+1012],edx
mov [ebp+1008],eax
add esp,0008
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
pop eax
ret
; bottom of sugwr25
; rename LoadCursorA sulca26
; sulca26(lclpc1008,lcona1012)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balz 968 es 972 ds
sulca26: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
push eax
mov esi,[ebp+964]
mov edi,[ebp+1012]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
; 026
mov eax,[ebp+976]
mov edx,[ebp+1004]
mov [ebp+1012],edx
mov [ebp+1008],eax
add esp,0008
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
pop eax
ret
; bottom of sulca26
; rename LoadIconA lica27
; sulica27(lilpc1008,liona1012)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balz 968 es 972 ds
sulica27: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
push eax
mov esi,[ebp+964]
mov edi,[ebp+1012]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
; 026
mov eax,[ebp+976]
mov edx,[ebp+1004]
mov [ebp+1012],edx
mov [ebp+1008],eax
add esp,0008
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
pop eax
ret
; bottom of sulica27
; rename OpenClipboard suoc28
; suoc28(ocbfrom1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balz 968 es 972 ds
suoc28: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
push eax
mov esi,[ebp+964]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
; 026
mov eax,[ebp+976]
xor eax,eax
mov edx,[ebp+1004]
mov [ebp+1008],edx
mov [ebp+1004],eax
add esp,0008
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
ret
; bottom of suoc28
; rename PostQuitMessage supqm29
; supqm29(qmess1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balz 968 es 972 ds
supqm29: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
push eax
mov esi,[ebp+964]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
; 026
mov eax,[ebp+976]
xor eax,eax
mov edx,[ebp+1004]
mov [ebp+1008],edx
mov [ebp+1004],eax
xor edx,edx
mov [esi+rickrun],edx
add esp,0008
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
ret
; bottom of supqm29
; rename RedrawWindow surw30
; surw30(rdwh1008,*rdwr1012,rw31016,rwor41020)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balz 968 es 972 ds
surw30: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
push eax
mov esi,[ebp+964]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
; 026
mov eax,[ebp+976]
xor eax,eax
mov edx,[ebp+1004]
mov [ebp+1020],edx
mov [ebp+1016],eax
xor edx,edx
add edx,0001
mov [esi+rickdraw],edx
add esp,0008
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0012
pop eax
ret
; end of surw30
; rename RegisterClassA surca31
; surca31(*kelwnd1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 negt 964 balz 968 es 972 ds
; 944 948 952 956
surca31: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
add eax,0001
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
xor eax,eax
push eax
push eax
push eax
push eax
push eax
mov esi,[ebp+964]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
; 026
mov eax,[ebp+976]
xor edx,edx
mov ebx,[ebp+1008]
add edx,[ebx+0004]
mov [esi+absinner],edx
mov eax,[ebp+1004]
mov [ebp+1008],eax
xor eax,eax
push eax
call sugmh09
mov [ebp+944],eax
mov esi,0614
sub esi,0616
sub esi,0616
mov ebx,[ebp+964]
add esi,[ebx+sacreate]
mov [ebp+948],esi
lea edi,[ebp+944]
push edi
call sudma20
; -----------
mov ecx,0001
mov [ebx+rickdraw],ecx
add esp,0024
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
ret
; bottom of surca31
; rename ShowWindow susw32
; susw32(swh1008,swnum1012)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 964 balz 968 es 972 ds
susw32: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
push eax
push eax
mov esi,[ebp+964]
mov edi,[ebp+1012]
mov eax,[esi+rdleft]
mov ecx,[esi+rdtop]
mov edx,[esi+rdright]
mov ebx,[esi+rdbottom]
; 026
mov eax,[ebp+976]
mov edx,[ebp+1004]
mov [ebp+1012],edx
mov [ebp+1008],eax
; --------------
add esp,0008
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
pop eax
ret
; bottom of susw32
; rename TranslateMessage sutm33
; sutm33(tcb1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sutm33: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
mov esi,0000
mov edi,[ebp+1004]
mov [ebp+1008],edi
mov [ebp+1004],esi
; ----------
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
ret
; bottom of sutm33
; rename UpdateWindow suuw34
; suuw34(uwhan1008)
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
suuw34: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
mov esi,0000
mov edi,[ebp+1004]
mov [ebp+1008],edi
mov [ebp+1004],esi
; ----------
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
ret
; bottom of suuw34
; begin luxury section
; begin luxury section
; rename GetStdHandle gsh37
; int sugsh37(hnegarg1008)
; 992 esi 996 edi 1000 ebp 1004 ret
; 976 eax 980 ecx 984 edx 988 ebx
; 968 es 972 ds
sugsh37: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,ss
mov ds,ecx
mov es,ecx
mov ebx,[ebp+1008]
js gshneg
mov esi,ebx
jmp gshpos
gshneg: mov esi,0000
sub esi,0010
sub esi,ebx
gshpos: mov edi,[ebp+1004]
mov [ebp+1008],edi
mov [ebp+1004],esi
; ----------
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
ret
; bottom of sugsh37
; int whereproc(lpstr1008)
; 988 ebx 992 esi 996 edi 1000 ebp 1004 retad
; 968 es 972 ds 976 eax 980 ecx 984 edx
; 936 940 944 948 952 956 960 964 balz
whereproc: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor eax,eax
push eax
push ds
push es
mov ecx,0008
xor ebx,ebx
puereproc: push ebx
sub ecx,0001
jnz puereproc
mov edx,ss
mov ds,edx
mov es,edx
call balrzpos
mov [ebp+964],eax
mov esi,[ebp+964]
lea edi,[esi+lpsdd01]
mov esi,[ebp+1008]
whereprlp: mov eax,0002
xor edx,edx
add edx,000
mov ecx,[edi+0004]
or ecx,ecx
jz whereprbt
push eax
push esi
push edx
push ecx
call wsymeq
jnz whereprne
mov ecx,[edi+0000]
mov [ebp+976],ecx
or ecx,ecx
jnz whereprbt
whereprne: add edi,0008
jnz whereprlp
whereprbt: mov edi,[ebp+1004]
mov [ebp+1008],edi
add esp,0032
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
add esp,0004
ret
; end of whereproc
; int zload(wfhan8200)
; 8184 esi 8188 edi 8192 ebp 8196 retad
; 8168 eax 8172 ecx 8176 edx 8180 ebx
; 8152 ilopct 8156 8160 es 8164 ds
; 8136 8140 linkbase 8144 8148 cfipos
; 8120 3csave 8124 8128 bapoz 8132
; 8104 ils 8108 rambase 8112 8116 hmanysec
; 8088 ilr 8092 8096 8100 missing
; 8072 addrdc0 8076 sizedc4 8080 8084
; ---------------------------
; 7708 top of loader 40 record
; 7704
; 7700
; 7696
; 7692 5 20 fileoffset check for null
; 7688 4 16 zrsize
; 7684 3 12 zrva ram starting address
; 7680
; 7676
; 7672 szi40:
; -----------------------
; 0 lpstrlist
; 4
; 8
; c dllstr
; 10 lpwritelist
; temp debug 7500 7504 7508 7512
zload: push ebp
mov ebp,esp
sub ebp,8192
push edi
push esi
push ebx
push edx
push ecx
push eax
push ds
push es
xor ecx,ecx
add ecx,2040
xor ebx,ebx
zuload: push ebx
sub ecx,0001
jnz zuload
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov [ebp+8128],eax
xor ecx,ecx
push ecx
call sugmh09
mov [ebp+8108],eax
mov ecx,[ebp+8200]
cmp ecx,0002
js pafilename
cmp ecx,07fffh
js isfilename
pafilename: jmp nofilename
isfilename: mov ecx,0060
j3cloop: mov esi,0001
mov edi,[ebp+8200]
push edi
push esi
call redpr18
sub ecx,0001
jnz j3cloop
mov esi,0004
mov edi,[ebp+8200]
push edi
push esi
call redpr18
mov [ebp+8120],eax
mov ecx,0040h
add [ebp+8148],ecx
sub eax,[ebp+8148]
mov ecx,eax
add [ebp+8148],ecx
or ecx,ecx
jz topebot
topeloop: mov esi,0001
mov edi,[ebp+8200]
push edi
push esi
call redpr18
sub ecx,0001
jnz topeloop
topebot: mov esi,0006
mov edi,[ebp+8200]
push edi
push esi
call redpr18
and eax,65535
cmp eax,04550h
jz kee4075
nofilename: mov esi,0ffffh
mov [ebp+8100],esi
jmp linkbott
; jmp failzl
kee4075: mov esi,0002
mov edi,[ebp+8200]
push edi
push esi
call redpr18
mov ecx,0008
add [ebp+8148],ecx
and eax,0fffh
mov [ebp+8116],eax
; ------------------
; mov [ebp+7512],eax
; lea ecx,[ebp+7500]
; push ecx
; call ideb128
; ------------------
cmp eax,0001
js nofilename
cmp eax,0010
jns nofilename
mov ecx,00b8h
sub ecx,0048h
add [ebp+8148],ecx
tloop48: mov esi,0001
mov edi,[ebp+8200]
push edi
push esi
call redpr18
sub ecx,0001
jnz tloop48
mov ecx,0002
imgdloop4: mov esi,0008
mov edi,[ebp+8200]
push edi
push esi
call redpr18
sub ecx,0001
jnz imgdloop4
mov [ebp+8072],eax
mov [ebp+8076],edx
; -----------------
; lea ecx,[ebp+8072]
; push ecx
; call ideb128
; -----------------
mov ecx,0014
imgdloop8: mov esi,0008
mov edi,[ebp+8200]
push edi
push esi
call redpr18
sub ecx,0001
jnz imgdloop8
mov ecx,0128
add [ebp+8148],ecx
mov edi,0040
mov esi,[ebp+8116]
push edi
push esi
call dwmpy
mov ecx,eax
add [ebp+8148],eax
shr ecx,1
shr ecx,1
shr ecx,1
; -----------------
; mov [ebp+7504],eax
; mov [ebp+7500],ecx
; lea edi,[ebp+7500]
; push edi
; call ideb128
; -----------------
xor edi,edi
sectszil: mov esi,0008
mov eax,[ebp+8200]
push eax
push esi
call redpr18
mov [ebp+edi*1+7672],eax
mov [ebp+edi*1+7676],edx
; -----------------------
; mov [ebp+7512],eax
; mov [ebp+7508],edx
; lea eax,[ebp+7500]
; push eax
; call ideb128
; -----------------------
add edi,0008
sub ecx,0001
jnz sectszil
mov ecx,[ebp+7692]
sub ecx,[ebp+8148]
add [ebp+8148],ecx
or ecx,ecx
jz lskip189
lskip188: mov esi,0001
mov edi,[ebp+8200]
push edi
push esi
call redpr18
sub ecx,0001
jnz lskip188
lskip189: mov ebx,[ebp+8108]
lea esi,[ebp+7672]
dloopcode: mov edx,[ebp+8116]
sub edx,0001
jns eloopcode
jmp dloopbot
eloopcode: mov [ebp+8116],edx
mov ecx,[esi+16]
mov edi,[esi+12]
mov edx,[esi+20]
; ----------------
mov [ebp+7512],ecx
mov [ebp+7508],edi
mov [ebp+7504],edx
lea eax,[ebp+7500]
push eax
call ideb128
; ----------------
add esi,0040
or edx,edx
jz dloopcode
shr ecx,1
shr ecx,1
shr ecx,1
hloopcode: mov edx,[ebp+8200]
mov eax,0008
push edx
push eax
call redpr18
mov [ebx+edi*1+00],eax
mov [ebx+edi*1+04],edx
add edi,0008
sub ecx,0001
jnz hloopcode
jmp dloopcode
dloopbot: mov esi,[ebp+8072]
add esi,[ebp+8108]
mov [ebp+8140],esi
linkolop: mov ebx,[ebp+8140]
mov esi,[ebx+00]
or esi,esi
jnz lincolop
jmp linkbott
lincolop: add esi,[ebp+8108]
mov edi,[ebx+16]
; duplicate add esi,[ebp+8108]
add edi,[ebp+8108]
xor ecx,ecx
mov [ebp+8152],ecx
mov [ebp+8104],esi
mov [ebp+8088],edi
mov ecx,0020
add [ebp+8140],ecx
xor edx,edx
mov [ebp+8152],edx
linkilop: mov edx,[ebp+8152]
mov esi,[ebp+8104]
mov edi,[ebp+8088]
add esi,edx
add edi,edx
add edx,0004
mov [ebp+8152],edx
mov ecx,[esi+0000h]
or ecx,ecx
jz linkolop
mov ecx,[esi+00]
add ecx,[ebp+8108]
push ecx
call whereproc
or eax,eax
jz countmisy
jmp linkisave
; change error printing
countmisy: mov edi,0001
add [ebp+8100],edi
; -----------------
mov edi,[esi+0000]
mov [ebp+7512],edi
mov ebx,0002
add edi,[ebp+8108]
push ebx
push edi
call wlens
mov [ebp+7508],eax
xor edx,edx
mov dl,[edi+00]
mov dh,[edi+01]
mov [ebp+7504],edx
mov edx,0000
nosymerror: mov dl,[ebx+edi*1+0000]
or dl,dl
jz vosymerror
mov eax,0001
push eax
push edx
call prwrtone
add ebx,0001
cmp ebx,0024
js nosymerror
vosymerror: mov eax,0001
mov edx,0032
push eax
push edx
call prwrtone
add ebx,0001
cmp ebx,0020
js vosymerror
lea ecx,[ebp+7500]
push ecx
call ideb128
; -----------------
jmp linkilop
linkisave: mov [edi+0000],eax
jmp linkilop
linkbott: mov edx,8160
mov ecx,[ebp+8196]
mov [ebp+8200],ecx
mov esi,[ebp+8100]
mov [ebp+8196],esi
add esp,edx
pop es
pop ds
add esp,0004
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
pop eax
ret
; bottom of zload
; int yload()
; 992 esi 996 edi 1000 ebp 1004 retad
; 976 eax 980 ecx 984 edx 988 ebx
; 960 zpoz 964 968 es 972 ds
; 944 948 biglen 952 956
; 928 932 han 936 940 tlen
; 672[256]
yload: push ebp
mov ebp,esp
sub ebp,1000
push edi
push esi
push ebx
push edx
push ecx
xor edx,edx
add edx,0004
push edx
push ds
push es
mov ecx,0296
xor ebx,ebx
yuoad: push ebx
sub ecx,edx
jnz yuoad
mov ecx,ss
mov ds,ecx
mov es,ecx
call balrzpos
mov [ebp+960],eax
xor edx,edx
mov ebx,[ebp+960]
mov dl,[ebx+0080h]
mov [ebp+948],edx
mov ecx,0082h
push ecx
push ebx
call wlens
mov [ebp+940],eax
mov edx,[ebp+948]
cmp edx,0005
jns isloady
isloadf: jmp yloafail
isloady: lea esi,[ebx+0082h]
mov ecx,[ebp+940]
cmp ecx,0005
js isloadf
xor edi,edi
lzloady: xor edx,edx
mov dl,[esi+0000h]
mov [ebp+edi*1+672],dl
add esi,0001
add edi,0001
cmp edi,ecx
js lzloady
lea edx,[ebp+672]
mov edi,0033
mov eax,03d00h
call prdos3221
jb isloadf
mov [ebp+932],eax
mov edx,[ebp+932]
push edx
call zload
mov [ebp+976],eax
mov ebx,[ebp+932]
mov edi,0033
mov eax,03e00h
call prdos3221
yloafail: mov esi,296
add esp,esi
pop es
pop ds
pop eax
pop ecx
pop edx
pop ebx
pop esi
pop edi
pop ebp
ret
; bottom of yload
dd 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
dd 0, 0, 0, 0, 0, 0, 0, 0
; This is the last line of this program.
0 new messages