diff --git a/libs/BorlandC/memset.asm b/libs/BorlandC/memset.asm new file mode 100644 index 00000000..868cd021 --- /dev/null +++ b/libs/BorlandC/memset.asm @@ -0,0 +1,60 @@ +; void __cdecl setmem(void *addr, unsigned int len, char val) +public _setmem +_setmem proc DIST +@@addr = dword ptr 6 +@@len = word ptr 0Ah +@@val = byte ptr 0Ch + + push bp + mov bp, sp + push si + push di + LES_ di, [bp+@@addr] + mov cx, [bp+@@len] + mov al, [bp+@@val] + mov ah, al + cld + test di, 1 + jz short @@isAligned + jcxz short @@done + stosb + dec cx + +@@isAligned: + shr cx, 1 + rep stosw + jnb short @@noOdd + stosb + +@@noOdd: +@@done: + pop di + pop si + pop bp + ret +_setmem endp + +; void *__cdecl memset(void *src, int c, size_t n) +public _memset +_memset proc DIST +@@src = dword ptr 6 +@@c = byte ptr 0Ah +@@n = word ptr 0Ch + + push bp + mov bp, sp + push si + push di + push word ptr [bp+@@c] + push [bp+@@n] + push word ptr [bp+@@src+2] + push word ptr [bp+@@src] + call _setmem + add sp, 8 + mov dx, word ptr [bp+@@src+2] + mov ax, word ptr [bp+@@src] + pop di + pop si + pop bp + ret +_memset endp diff --git a/th01_fuuin.asm b/th01_fuuin.asm index db0e9385..6f4e31ef 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -8806,77 +8806,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_4947 - jcxz short loc_494E - stosb - dec cx - -loc_4947: - shr cx, 1 - rep stosw - jnb short loc_494E - stosb - -loc_494E: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -14198,9 +14128,7 @@ loc_7674: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_77C7 ; --------------------------------------------------------------------------- diff --git a/th01_op.asm b/th01_op.asm index 89ac3c62..3bc009ac 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -8685,85 +8685,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_4C29 - jcxz short loc_4C30 - stosb - dec cx - -loc_4C29: - shr cx, 1 - rep stosw - jnb short loc_4C30 - stosb - -loc_4C30: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc near - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 -_memset endp ; sp-analysis failed - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function - -sub_4C4C proc far - mov dx, [bp+8] - mov ax, [bp+6] - pop di - pop si - pop bp - retf -sub_4C4C endp ; sp-analysis failed - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -14029,9 +13951,7 @@ loc_78EF: push ss ; c les bx, [bp+arg_6] push word ptr es:[bx+36h] - nop - push cs ; s - call _memset + nopcall _memset add sp, 8 jmp loc_7A42 ; --------------------------------------------------------------------------- @@ -22694,7 +22614,7 @@ _s = dword ptr -4 call near ptr sub_B976 push large 7D0000FFh ; c push large [bp+_s] ; s - call far ptr _memset + call _memset add sp, 0Ah push cs call near ptr sub_BA0A @@ -22735,7 +22655,7 @@ sub_BB3C endp call near ptr sub_B976 push large 7D0000FFh push large dword ptr [bp-4] - call far ptr _memset + call _memset add sp, 0Ah push cs call near ptr sub_BA0A @@ -22891,7 +22811,7 @@ var_2 = word ptr -2 push ss lea ax, [bp+_s] push ax ; s - call far ptr _memset + call _memset add sp, 8 mov [bp+var_2], 0 jmp loc_BD2E @@ -23109,7 +23029,7 @@ loc_BDF4: push ss lea ax, [bp-32h] push ax - call far ptr _memset + call _memset add sp, 8 mov word ptr [bp-2], 0 jmp loc_BE9F @@ -25269,7 +25189,7 @@ loc_CF49: push ss lea ax, [bp-34h] push ax - call far ptr _memset + call _memset add sp, 8 xor di, di jmp loc_CFFD diff --git a/th01_reiiden.asm b/th01_reiiden.asm index 302c6239..9a7a0894 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -9886,9 +9886,7 @@ loc_48E8: push [bp+_length] ; length push word ptr [bp+dest+2] push word ptr [bp+dest] ; dest - nop - push cs - call near ptr _setmem + nopcall _setmem add sp, 8 mov bx, [bp+_length] xor cx, cx @@ -12392,77 +12390,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_5F9F - jcxz short loc_5FA6 - stosb - dec cx - -loc_5F9F: - shr cx, 1 - rep stosw - jnb short loc_5FA6 - stosb - -loc_5FA6: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -17868,9 +17796,7 @@ loc_8D62: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_8EB5 ; --------------------------------------------------------------------------- diff --git a/th02_main.asm b/th02_main.asm index c579166b..0c14e5d8 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -9270,77 +9270,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_676C - jcxz short loc_6773 - stosb - dec cx - -loc_676C: - shr cx, 1 - rep stosw - jnb short loc_6773 - stosb - -loc_6773: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -14045,9 +13975,7 @@ loc_8C6D: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_8DC0 ; --------------------------------------------------------------------------- diff --git a/th02_maine.asm b/th02_maine.asm index c773de11..c0457aca 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -5230,77 +5230,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_4B6C - jcxz short loc_4B73 - stosb - dec cx - -loc_4B6C: - shr cx, 1 - rep stosw - jnb short loc_4B73 - stosb - -loc_4B73: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -9954,9 +9884,7 @@ loc_706D: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_71C0 ; --------------------------------------------------------------------------- diff --git a/th02_op.asm b/th02_op.asm index a3955225..5f600c8a 100644 --- a/th02_op.asm +++ b/th02_op.asm @@ -5313,77 +5313,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_51B9 - jcxz short loc_51C0 - stosb - dec cx - -loc_51B9: - shr cx, 1 - rep stosw - jnb short loc_51C0 - stosb - -loc_51C0: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -10046,9 +9976,7 @@ loc_76BA: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_780D ; --------------------------------------------------------------------------- diff --git a/th03_main.asm b/th03_main.asm index a6220347..bda7a314 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -5559,78 +5559,7 @@ sub_4C4C endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_4CEE - jcxz short loc_4CF5 - stosb - dec cx - -loc_4CEE: - shr cx, 1 - rep stosw - jnb short loc_4CF5 - stosb - -loc_4CF5: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - ; sub_1D189+153P - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -10293,9 +10222,7 @@ loc_71EF: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_7342 ; --------------------------------------------------------------------------- diff --git a/th03_mainl.asm b/th03_mainl.asm index 1469a5ca..6a12e2d0 100644 --- a/th03_mainl.asm +++ b/th03_mainl.asm @@ -4773,77 +4773,7 @@ sub_4B43 endp ; sp-analysis failed include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_4BBC - jcxz short loc_4BC3 - stosb - dec cx - -loc_4BBC: - shr cx, 1 - rep stosw - jnb short loc_4BC3 - stosb - -loc_4BC3: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -9552,9 +9482,7 @@ loc_70BD: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_7210 ; --------------------------------------------------------------------------- diff --git a/th03_op.asm b/th03_op.asm index 4df1ccad..6051ccf7 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -5192,77 +5192,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_4E9E - jcxz short loc_4EA5 - stosb - dec cx - -loc_4E9E: - shr cx, 1 - rep stosw - jnb short loc_4EA5 - stosb - -loc_4EA5: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -9968,9 +9898,7 @@ loc_739F: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_74F2 ; --------------------------------------------------------------------------- diff --git a/th04_main.asm b/th04_main.asm index 0dd36212..8658aac8 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -7802,77 +7802,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_60FA - jcxz short loc_6101 - stosb - dec cx - -loc_60FA: - shr cx, 1 - rep stosw - jnb short loc_6101 - stosb - -loc_6101: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -12581,9 +12511,7 @@ loc_85FB: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_874E ; --------------------------------------------------------------------------- diff --git a/th04_maine.asm b/th04_maine.asm index ac027a55..8ebacc62 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -4685,77 +4685,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_5662 - jcxz short loc_5669 - stosb - dec cx - -loc_5662: - shr cx, 1 - rep stosw - jnb short loc_5669 - stosb - -loc_5669: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -9415,9 +9345,7 @@ loc_7B63: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_7CB6 ; --------------------------------------------------------------------------- diff --git a/th04_op.asm b/th04_op.asm index 7db5ff73..ea50a2f7 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -5298,77 +5298,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length= word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_5D22 - jcxz short loc_5D29 - stosb - dec cx - -loc_5D22: - shr cx, 1 - rep stosw - jnb short loc_5D29 - stosb - -loc_5D29: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length= word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -10075,9 +10005,7 @@ loc_8223: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_8376 ; --------------------------------------------------------------------------- diff --git a/th05_main.asm b/th05_main.asm index 6bb7570d..7d5ccf30 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -8188,77 +8188,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_6426 - jcxz short loc_642D - stosb - dec cx - -loc_6426: - shr cx, 1 - rep stosw - jnb short loc_642D - stosb - -loc_642D: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -12915,9 +12845,7 @@ loc_8927: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_8A7A ; --------------------------------------------------------------------------- diff --git a/th05_maine.asm b/th05_maine.asm index cf9edf68..be60103a 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -5464,77 +5464,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_5B4E - jcxz short loc_5B55 - stosb - dec cx - -loc_5B4E: - shr cx, 1 - rep stosw - jnb short loc_5B55 - stosb - -loc_5B55: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -10192,9 +10122,7 @@ loc_804F: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_81A2 ; --------------------------------------------------------------------------- diff --git a/th05_op.asm b/th05_op.asm index 80e9e587..96aa51f6 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -4980,77 +4980,7 @@ _getenv endp include libs/BorlandC/memcmp.asm include libs/BorlandC/memcpy.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void __cdecl setmem(void *dest, unsigned int length, char value) -_setmem proc far - -dest = dword ptr 6 -_length = word ptr 0Ah -value = byte ptr 0Ch - - push bp - mov bp, sp - push si - push di - les di, [bp+dest] - mov cx, [bp+_length] - mov al, [bp+value] - mov ah, al - cld - test di, 1 - jz short loc_5972 - jcxz short loc_5979 - stosb - dec cx - -loc_5972: - shr cx, 1 - rep stosw - jnb short loc_5979 - stosb - -loc_5979: - pop di - pop si - pop bp - retf -_setmem endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: library function bp-based frame - -; void *__cdecl memset(void *s, int c, size_t n) -_memset proc far - -dest = dword ptr 6 -value = byte ptr 0Ah -_length = word ptr 0Ch - - push bp - mov bp, sp - push si - push di - push word ptr [bp+value] ; value - push [bp+_length] ; length - push word ptr [bp+dest+2] - push word ptr [bp+dest] ; dest - push cs - call near ptr _setmem - add sp, 8 - mov dx, word ptr [bp+dest+2] - mov ax, word ptr [bp+dest] - pop di - pop si - pop bp - retf -_memset endp - +include libs/BorlandC/memset.asm ; =============== S U B R O U T I N E ======================================= @@ -9659,9 +9589,7 @@ loc_7E73: push ss les bx, [bp+arg_6] push word ptr es:[bx+36h] ; s - nop - push cs - call near ptr _memset + nopcall _memset add sp, 8 jmp loc_7FC6 ; ---------------------------------------------------------------------------