Category : Assembly Language Source Code
Archive   : RHSTDLIB.ZIP
Filename : STRSET2.ASM
assume cs:stdlib
;
extrn sl_malloc:far
;
;
; strset2- Allocates a string containing CX+1 characters and initializes
; all but the last byte to the character passed in AL. Zero
; terminates the entire string.
;
; inputs:
;
; AL- Character to copy.
; CX- # of characters in new string.
;
; outputs:
;
; es:di- Points at newly created string (if allocated).
;
; carry=0 if no error creating string.
; carry=1 if insufficient memory to allocate storage for string.
;
;
;
;
public sl_strset2
;
sl_strset2 proc far
pushf
push ax
push cx
;
cld
inc cx ;Include zero byte at EOS.
call sl_malloc ;Allocate space for string
jc ss2sc ;Branch if insufficent memory.
;
pop cx ;Retrieve count.
push cx
push di ;Save ptr to free memory
rep stosb ;Fill string with char in AL.
mov byte ptr es:[di], 0 ;Zero terminate
pop di
;
ss2cc: pop cx
pop ax
popf
clc
ret
ss2sc: pop cx
pop ax
popf
stc
ret
sl_strset2 endp
;
;
;
;
stdlib ends
end
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/