wprintf.asm

来自「a fat12 source code, it is verified for 」· 汇编 代码 · 共 30 行

ASM
30
字号
* Current window printf: register wprintf(format, args ...)
wprintf	MOV	BX,SP		Address stack
	ADD	BX,AX		BX = operand pointer
	ADD	BX,AX		(word entries)
	SUB	SP,#100		Allocate space
	MOV	DI,SP		DI = output string
	PUSH	DI		Argument to wputs
	CALL	_format_	Do the formatting
	CALL	wputs		Write to window
	ADD	SP,#102		Fix stack
	RET
* Any window printf: register w_printf(window, format, args ...)
w_printf MOV	BX,SP		Address stack
	ADD	BX,AX		BX = operand pointer
	ADD	BX,AX		(word entries)
	MOV	AX,[BX]		Get output window
	DEC	BX		Backup
	DEC	BX		Backup
	SUB	SP,#100		Allocate space
	MOV	DI,SP		DI = output string
	PUSH	DI		Argument for w_puts
	PUSH	AX		Argument to w_puts
	CALL	_format_	Process it
	CALL	w_puts		Output in window
	ADD	SP,#104		Fix stack
	RET
$EX:_format_
$EX:wputs
$EX:w_puts

⌨️ 快捷键说明

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