From e54a6ad12062fd6206737e62a6ca3312f88b98bc Mon Sep 17 00:00:00 2001 From: nmlgc Date: Wed, 3 Sep 2014 19:13:47 +0200 Subject: [PATCH] [Reduction] #456: DOSCMD ... I, um, cannot comprehend how the C source code I have for this function could have been compiled into such an assembly. --- libs/BorlandC/doscmd.asm | 142 ++++++++++++++++++++++++++++++++++ th01_fuuin.asm | 160 +-------------------------------------- th01_op.asm | 160 +-------------------------------------- th01_reiiden.asm | 160 +-------------------------------------- th02_main.asm | 160 +-------------------------------------- th02_maine.asm | 160 +-------------------------------------- th02_op.asm | 160 +-------------------------------------- th03_main.asm | 160 +-------------------------------------- th03_mainl.asm | 160 +-------------------------------------- th03_op.asm | 160 +-------------------------------------- th04_main.asm | 160 +-------------------------------------- th04_maine.asm | 160 +-------------------------------------- th04_op.asm | 160 +-------------------------------------- th05_main.asm | 160 +-------------------------------------- th05_maine.asm | 159 +------------------------------------- th05_op.asm | 160 +-------------------------------------- 16 files changed, 157 insertions(+), 2384 deletions(-) create mode 100644 libs/BorlandC/doscmd.asm diff --git a/libs/BorlandC/doscmd.asm b/libs/BorlandC/doscmd.asm new file mode 100644 index 00000000..a5dc1cbc --- /dev/null +++ b/libs/BorlandC/doscmd.asm @@ -0,0 +1,142 @@ +; int __stdcall _DOSCMD(int, int, char *s, int, int) +__DOSCMD proc near + +@@dest = dword ptr -0Eh +@@var_A = dword ptr -0Ah +@@var_6 = dword ptr -6 +@@var_2 = word ptr -2 +@@arg_0 = word ptr 4 +@@arg_2 = word ptr 6 +@@arg_4 = dword ptr 8 +@@arg_8 = word ptr 0Ch +@@arg_A = word ptr 0Eh + + push bp + mov bp, sp + sub sp, 0Eh + push si + push di + mov [bp+@@var_2], 3 + mov ax, word ptr [bp+@@arg_4] + or ax, word ptr [bp+@@arg_4+2] + jz short @@L1 + push word ptr [bp+@@arg_4+2] + push word ptr [bp+@@arg_4] + nopcall _strlen + pop cx + pop cx + add ax, [bp+@@var_2] + inc ax + mov [bp+@@var_2], ax + +@@L1: + mov dx, [bp+@@arg_2] + mov ax, [bp+@@arg_0] + mov word ptr [bp+@@var_6+2], dx + mov word ptr [bp+@@var_6], ax + jmp short @@L3 + +@@L2: + les bx, [bp+@@var_6] + push word ptr es:[bx+2] + push word ptr es:[bx] + nopcall _strlen + pop cx + pop cx + add ax, [bp+@@var_2] + inc ax + mov [bp+@@var_2], ax + add word ptr [bp+@@var_6], 4 + +@@L3: + les bx, [bp+@@var_6] + mov ax, es:[bx] + or ax, es:[bx+2] + jnz short @@L2 + push [bp+@@var_2] + nopcall _malloc + pop cx + mov word ptr [bp+@@var_A+2], dx + mov word ptr [bp+@@var_A], ax + or ax, dx + jnz short @@L4 + xor dx, dx + xor ax, ax + jmp @@ret + +@@L4: + mov dx, word ptr [bp+@@var_A+2] + mov ax, word ptr [bp+@@var_A] + inc ax + mov word ptr [bp+@@dest+2], dx + mov word ptr [bp+@@dest], ax + les bx, [bp+@@dest] + mov byte ptr es:[bx], ' ' + inc word ptr [bp+@@dest] + mov ax, word ptr [bp+@@arg_4] + or ax, word ptr [bp+@@arg_4+2] + jz short @@L5 + push word ptr [bp+@@arg_4+2] + push word ptr [bp+@@arg_4] + push word ptr [bp+@@dest+2] + push word ptr [bp+@@dest] + nopcall _stpcpy + add sp, 8 + mov word ptr [bp+@@dest+2], dx + mov word ptr [bp+@@dest], ax + les bx, [bp+@@dest] + mov byte ptr es:[bx], ' ' + inc word ptr [bp+@@dest] + +@@L5: + mov ax, [bp+@@arg_8] + or ax, [bp+@@arg_A] + jz short @@L8 + mov dx, [bp+@@arg_2] + mov ax, [bp+@@arg_0] + mov word ptr [bp+@@var_6+2], dx + mov word ptr [bp+@@var_6], ax + jmp short @@L7 + +@@L6: + les bx, [bp+@@var_6] + push word ptr es:[bx+2] + push word ptr es:[bx] + push word ptr [bp+@@dest+2] + push word ptr [bp+@@dest] + nopcall _stpcpy + add sp, 8 + mov word ptr [bp+@@dest+2], dx + mov word ptr [bp+@@dest], ax + les bx, [bp+@@dest] + mov byte ptr es:[bx], ' ' + inc word ptr [bp+@@dest] + add word ptr [bp+@@var_6], 4 + +@@L7: + les bx, [bp+@@var_6] + mov ax, es:[bx] + or ax, es:[bx+2] + jnz short @@L6 + +@@L8: + les bx, [bp+@@dest] + mov byte ptr es:[bx-1], 0Dh + mov byte ptr es:[bx], 0 + mov ax, word ptr [bp+@@dest] + xor dx, dx + sub ax, word ptr [bp+@@var_A] + sbb dx, 0 + add al, 0FEh + les bx, [bp+@@var_A] + mov es:[bx], al + mov dx, word ptr [bp+@@var_A+2] + mov ax, word ptr [bp+@@var_A] + +@@ret: + pop di + pop si + mov sp, bp + pop bp + retn 0Ch +__DOSCMD endp diff --git a/th01_fuuin.asm b/th01_fuuin.asm index adbdaa8f..0bd1ebc3 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -7661,165 +7661,7 @@ include libs/BorlandC/xx.asm unknown_libname_3 db 0BAh, 10h, 12h, 0EBh, 3, 0BAh, 15h, 12h, 0B9h, 5, 0 db 0B4h, 40h, 0BBh, 2, 0, 0CDh, 21h, 0B9h, 27h, 0, 0BAh db 1Ah, 12h, 0B4h, 40h, 0CDh, 21h, 0E9h, 56h, 8Ch - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -_s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+_s] - or ax, word ptr [bp+_s+2] - jz short loc_8F5A - push word ptr [bp+_s+2] - push word ptr [bp+_s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_8F5A: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8F84 -; --------------------------------------------------------------------------- - -loc_8F68: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_8F84: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8F68 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_8FAA - xor dx, dx - xor ax, ax - jmp loc_9060 -; --------------------------------------------------------------------------- - -loc_8FAA: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+_s] - or ax, word ptr [bp+_s+2] - jz short loc_8FED - push word ptr [bp+_s+2] - push word ptr [bp+_s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_8FED: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_903B - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_902F -; --------------------------------------------------------------------------- - -loc_9003: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_902F: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9003 - -loc_903B: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_9060: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th01_op.asm b/th01_op.asm index 123bff1a..9a534db1 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -7544,165 +7544,7 @@ include libs/BorlandC/xx.asm unknown_libname_3 db 0BAh, 60h, 0Fh, 0EBh, 3, 0BAh, 65h, 0Fh, 0B9h, 5, 0 db 0B4h, 40h, 0BBh, 2, 0, 0CDh, 21h, 0B9h, 27h, 0, 0BAh db 6Ah, 0Fh, 0B4h, 40h, 0CDh, 21h, 0E9h, 9Bh, 8Ah - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -_s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+_s] - or ax, word ptr [bp+_s+2] - jz short loc_91D5 - push word ptr [bp+_s+2] - push word ptr [bp+_s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_91D5: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_91FF -; --------------------------------------------------------------------------- - -loc_91E3: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_91FF: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_91E3 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_9225 - xor dx, dx - xor ax, ax - jmp loc_92DB -; --------------------------------------------------------------------------- - -loc_9225: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+_s] - or ax, word ptr [bp+_s+2] - jz short loc_9268 - push word ptr [bp+_s+2] - push word ptr [bp+_s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_9268: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_92B6 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_92AA -; --------------------------------------------------------------------------- - -loc_927E: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_92AA: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_927E - -loc_92B6: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_92DB: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th01_reiiden.asm b/th01_reiiden.asm index 4279f5b4..05a8429f 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -11103,165 +11103,7 @@ include libs/BorlandC/xx.asm unknown_libname_3 db 0BAh, 3Ch, 20h, 0EBh, 3, 0BAh, 41h, 20h, 0B9h, 5, 0 db 0B4h, 40h, 0BBh, 2, 0, 0CDh, 21h, 0B9h, 27h, 0, 0BAh db 46h, 20h, 0B4h, 40h, 0CDh, 21h, 0E9h, 0A2h, 7Dh - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -_s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+_s] - or ax, word ptr [bp+_s+2] - jz short loc_A648 - push word ptr [bp+_s+2] - push word ptr [bp+_s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_A648: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_A672 -; --------------------------------------------------------------------------- - -loc_A656: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_A672: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_A656 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_A698 - xor dx, dx - xor ax, ax - jmp loc_A74E -; --------------------------------------------------------------------------- - -loc_A698: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+_s] - or ax, word ptr [bp+_s+2] - jz short loc_A6DB - push word ptr [bp+_s+2] - push word ptr [bp+_s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_A6DB: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_A729 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_A71D -; --------------------------------------------------------------------------- - -loc_A6F1: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_A71D: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_A6F1 - -loc_A729: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_A74E: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th02_main.asm b/th02_main.asm index cd0565cd..fa7fc558 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -3963,165 +3963,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_A534 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_A534: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_A55E -; --------------------------------------------------------------------------- - -loc_A542: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_A55E: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_A542 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_A584 - xor dx, dx - xor ax, ax - jmp loc_A63A -; --------------------------------------------------------------------------- - -loc_A584: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_A5C7 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_A5C7: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_A615 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_A609 -; --------------------------------------------------------------------------- - -loc_A5DD: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_A609: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_A5DD - -loc_A615: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_A63A: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th02_maine.asm b/th02_maine.asm index f5ec884f..589c1d53 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -2020,165 +2020,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8934 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_8934: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_895E -; --------------------------------------------------------------------------- - -loc_8942: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_895E: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8942 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_8984 - xor dx, dx - xor ax, ax - jmp loc_8A3A -; --------------------------------------------------------------------------- - -loc_8984: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_89C7 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_89C7: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_8A15 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8A09 -; --------------------------------------------------------------------------- - -loc_89DD: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_8A09: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_89DD - -loc_8A15: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_8A3A: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th02_op.asm b/th02_op.asm index 4b31d6bc..681c847b 100644 --- a/th02_op.asm +++ b/th02_op.asm @@ -1623,165 +1623,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8F81 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_8F81: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8FAB -; --------------------------------------------------------------------------- - -loc_8F8F: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_8FAB: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8F8F - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_8FD1 - xor dx, dx - xor ax, ax - jmp loc_9087 -; --------------------------------------------------------------------------- - -loc_8FD1: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_9014 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_9014: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_9062 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9056 -; --------------------------------------------------------------------------- - -loc_902A: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_9056: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_902A - -loc_9062: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_9087: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th03_main.asm b/th03_main.asm index d3b31d40..923f72a3 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -1542,165 +1542,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8AB6 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_8AB6: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8AE0 -; --------------------------------------------------------------------------- - -loc_8AC4: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_8AE0: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8AC4 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_8B06 - xor dx, dx - xor ax, ax - jmp loc_8BBC -; --------------------------------------------------------------------------- - -loc_8B06: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8B49 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_8B49: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_8B97 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8B8B -; --------------------------------------------------------------------------- - -loc_8B5F: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_8B8B: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8B5F - -loc_8B97: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_8BBC: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th03_mainl.asm b/th03_mainl.asm index 16d49ddc..5b9900a6 100644 --- a/th03_mainl.asm +++ b/th03_mainl.asm @@ -1756,165 +1756,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8984 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_8984: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_89AE -; --------------------------------------------------------------------------- - -loc_8992: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_89AE: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8992 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_89D4 - xor dx, dx - xor ax, ax - jmp loc_8A8A -; --------------------------------------------------------------------------- - -loc_89D4: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8A17 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_8A17: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_8A65 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8A59 -; --------------------------------------------------------------------------- - -loc_8A2D: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_8A59: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8A2D - -loc_8A65: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_8A8A: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th03_op.asm b/th03_op.asm index 5a29d2ca..d8a9275a 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -1813,165 +1813,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8C66 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_8C66: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8C90 -; --------------------------------------------------------------------------- - -loc_8C74: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_8C90: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8C74 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_8CB6 - xor dx, dx - xor ax, ax - jmp loc_8D6C -; --------------------------------------------------------------------------- - -loc_8CB6: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_8CF9 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_8CF9: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_8D47 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_8D3B -; --------------------------------------------------------------------------- - -loc_8D0F: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_8D3B: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_8D0F - -loc_8D47: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_8D6C: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th04_main.asm b/th04_main.asm index 2c71db06..aa3374ec 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -2237,165 +2237,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_9EC2 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_9EC2: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9EEC -; --------------------------------------------------------------------------- - -loc_9ED0: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_9EEC: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9ED0 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_9F12 - xor dx, dx - xor ax, ax - jmp loc_9FC8 -; --------------------------------------------------------------------------- - -loc_9F12: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_9F55 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_9F55: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_9FA3 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9F97 -; --------------------------------------------------------------------------- - -loc_9F6B: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_9F97: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9F6B - -loc_9FA3: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_9FC8: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th04_maine.asm b/th04_maine.asm index d513c269..e4478f8c 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -1901,165 +1901,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_942A - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_942A: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9454 -; --------------------------------------------------------------------------- - -loc_9438: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_9454: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9438 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_947A - xor dx, dx - xor ax, ax - jmp loc_9530 -; --------------------------------------------------------------------------- - -loc_947A: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_94BD - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_94BD: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_950B - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_94FF -; --------------------------------------------------------------------------- - -loc_94D3: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_94FF: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_94D3 - -loc_950B: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_9530: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th04_op.asm b/th04_op.asm index a67cf272..91859148 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -1684,165 +1684,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_9AEA - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_9AEA: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9B14 -; --------------------------------------------------------------------------- - -loc_9AF8: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_9B14: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9AF8 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_9B3A - xor dx, dx - xor ax, ax - jmp loc_9BF0 -; --------------------------------------------------------------------------- - -loc_9B3A: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_9B7D - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_9B7D: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_9BCB - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9BBF -; --------------------------------------------------------------------------- - -loc_9B93: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_9BBF: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9B93 - -loc_9BCB: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_9BF0: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th05_main.asm b/th05_main.asm index 727b6cd4..9bf6d10a 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -2358,165 +2358,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_A1EE - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_A1EE: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_A218 -; --------------------------------------------------------------------------- - -loc_A1FC: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_A218: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_A1FC - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_A23E - xor dx, dx - xor ax, ax - jmp loc_A2F4 -; --------------------------------------------------------------------------- - -loc_A23E: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_A281 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_A281: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_A2CF - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_A2C3 -; --------------------------------------------------------------------------- - -loc_A297: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_A2C3: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_A297 - -loc_A2CF: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_A2F4: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th05_maine.asm b/th05_maine.asm index 67e7de6b..ae954a96 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -2053,164 +2053,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_9916 - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_9916: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9940 -; --------------------------------------------------------------------------- - -loc_9924: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_9940: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9924 - push [bp+var_2] - nop - call _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_9966 - xor dx, dx - xor ax, ax - jmp loc_9A1C -; --------------------------------------------------------------------------- - -loc_9966: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_99A9 - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_99A9: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_99F7 - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_99EB -; --------------------------------------------------------------------------- - -loc_99BF: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_99EB: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_99BF - -loc_99F7: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_9A1C: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th05_op.asm b/th05_op.asm index a5ebfb30..a40fe76b 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -1957,165 +1957,7 @@ include libs/BorlandC/xfflush.asm include libs/BorlandC/xalloc.asm include libs/BorlandC/xmsg.asm include libs/BorlandC/xx.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; int __stdcall _DOSCMD(int, int, char *s, int, int) -__DOSCMD proc near - -dest = dword ptr -0Eh -var_A = dword ptr -0Ah -var_6 = dword ptr -6 -var_2 = word ptr -2 -arg_0 = word ptr 4 -arg_2 = word ptr 6 -s = dword ptr 8 -arg_8 = word ptr 0Ch -arg_A = word ptr 0Eh - - push bp - mov bp, sp - sub sp, 0Eh - push si - push di - mov [bp+var_2], 3 - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_973A - push word ptr [bp+s+2] - push word ptr [bp+s] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - -loc_973A: - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_9764 -; --------------------------------------------------------------------------- - -loc_9748: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - add ax, [bp+var_2] - inc ax - mov [bp+var_2], ax - add word ptr [bp+var_6], 4 - -loc_9764: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_9748 - push [bp+var_2] - nop - push cs - call near ptr _malloc - pop cx - mov word ptr [bp+var_A+2], dx - mov word ptr [bp+var_A], ax - or ax, dx - jnz short loc_978A - xor dx, dx - xor ax, ax - jmp loc_9840 -; --------------------------------------------------------------------------- - -loc_978A: - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - inc ax - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - mov ax, word ptr [bp+s] - or ax, word ptr [bp+s+2] - jz short loc_97CD - push word ptr [bp+s+2] - push word ptr [bp+s] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - -loc_97CD: - mov ax, [bp+arg_8] - or ax, [bp+arg_A] - jz short loc_981B - mov dx, [bp+arg_2] - mov ax, [bp+arg_0] - mov word ptr [bp+var_6+2], dx - mov word ptr [bp+var_6], ax - jmp short loc_980F -; --------------------------------------------------------------------------- - -loc_97E3: - les bx, [bp+var_6] - push word ptr es:[bx+2] - push word ptr es:[bx] ; src - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - nop - call _stpcpy - add sp, 8 - mov word ptr [bp+dest+2], dx - mov word ptr [bp+dest], ax - les bx, [bp+dest] - mov byte ptr es:[bx], 20h ; ' ' - inc word ptr [bp+dest] - add word ptr [bp+var_6], 4 - -loc_980F: - les bx, [bp+var_6] - mov ax, es:[bx] - or ax, es:[bx+2] - jnz short loc_97E3 - -loc_981B: - les bx, [bp+dest] - mov byte ptr es:[bx-1], 0Dh - mov byte ptr es:[bx], 0 - mov ax, word ptr [bp+dest] - xor dx, dx - sub ax, word ptr [bp+var_A] - sbb dx, 0 - add al, 0FEh ; 'þ' - les bx, [bp+var_A] - mov es:[bx], al - mov dx, word ptr [bp+var_A+2] - mov ax, word ptr [bp+var_A] - -loc_9840: - pop di - pop si - mov sp, bp - pop bp - retn 0Ch -__DOSCMD endp - +include libs/BorlandC/doscmd.asm include libs/BorlandC/exec.asm ; =============== S U B R O U T I N E =======================================