lines.asm

来自「DOS 源代码 系列之 command 源码」· 汇编 代码 · 共 47 行

ASM
47
字号
;/*
; *                      Microsoft Confidential
; *                      Copyright (C) Microsoft Corporation 1988 - 1991
; *                      All Rights Reserved.
; */
;
; Check the mode of the console, and return the number of lines available.
; This function is used in MEM's /P command, to determine the number of lines
; to be printed before a keypress is requested.
;
; On error, return 0.

.MODEL	SMALL

include rombios.inc

.CODE

public _get_lines

_get_lines	proc	near
	push	ds
	mov	ax, ROMBIOS_DATA

	mov	ds, ax
	assume	ds:ROMBIOS_DATA

	mov	ah, 0
	mov	al, CRT_ROWS

	pop	ds
	assume	ds:DGROUP

ifndef JAPAN
	inc	al
endif

	cmp	al, 1
	ja	@f
	mov	al, 0	; Indicate an error (like what?)
@@:	ret

_get_lines	endp

end

⌨️ 快捷键说明

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