⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readconsole.asm

📁 在MASM6.15上
💻 ASM
字号:
TITLE Read From the Console         (ReadConsole.asm)

; Read a line of input from standard input.
; Last update: 1/20/02

INCLUDE Irvine32.inc

BufSize = 80

.data
buffer BYTE BufSize DUP(?),0,0
stdInHandle DWORD ?
bytesRead   DWORD ?

.code
main PROC
	; Get handle to standard input
	INVOKE GetStdHandle, STD_INPUT_HANDLE
	mov stdInHandle,eax

	; Wait for user input
	INVOKE ReadConsole, stdInHandle, ADDR buffer,
	  BufSize - 2, ADDR bytesRead, 0

	; Display the buffer
	mov  esi,OFFSET buffer
	mov  ecx,16	; 16 bytes
	mov  ebx,TYPE buffer
	call DumpMem

	exit
main ENDP
END main

⌨️ 快捷键说明

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