flmknm.asm

来自「开放源码的编译器open watcom 1.6.0版的源代码」· 汇编 代码 · 共 50 行

ASM
50
字号
	include ..\cwlib.inc
	scode

;-------------------------------------------------------------------------------
;
;Make a full drive:path\file name from a file list path string and specified
;file name.
;
;On Entry:
;
;ECX	- entry number to make name from.
;ESI	- pointer to file list.
;EDI	- pointer to destination buffer.
;
;On Exit:
;
;ALL registers preserved.
;
;Name in a file list are just the 8.3 portion. A more useful name can be made
;by combineing the path string from the start of the list buffer with the file
;name which this routine does.
;
FileListMakeName proc near
	pushm	eax,edx,esi,edi
	add	esi,4
	call	CopyString		;Copy path string into place.
	pushm	ecx,edi
	or	ecx,-1
	xor	al,al
	repnz	scasb		;find end of string.
	dec	edi
	cmp	b[edi-1],"\"
	jz	@@0
	mov	b[edi],"\"
	mov	b[edi+1],0
@@0:	popm	ecx,edi
	mov	eax,14
	mul	ecx
	add	esi,eax
	add	esi,256
	call	AppendString		;Append file name.
	popm	eax,edx,esi,edi
	ret
FileListMakeName endp


	efile
	end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?