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

📄 scroll.asm

📁 在MASM6.15上
💻 ASM
字号:
TITLE Scrolling the Console Window                (Scroll.asm)

; This program writes 50 lines of text to the console buffer,
; resizes, and scrolls the console window back to line 0.
; Demonstrates the SetConsoleWindowInfo function.
; Last update: 1/20/02

INCLUDE Irvine32.inc

.data
message BYTE ":  This line of text was written "
        BYTE "to the screen buffer",0dh,0ah
messageSize = ($-message)

outHandle DWORD 0     		; standard output handle
bytesWritten  DWORD ?		; number of bytes written
lineNum DWORD 0
windowRect SMALL_RECT <0,0,60,11>	; left,top,right,bottom

.code
main PROC
	INVOKE GetStdHandle, STD_OUTPUT_HANDLE
	mov outHandle,eax

.REPEAT
  	mov  eax,lineNum
  	call WriteDec		; display each line number
	INVOKE WriteConsole,
	  outHandle,		; console output handle
	  ADDR message,       		; string pointer
	  messageSize,		; string length
	  ADDR bytesWritten,		; returns num bytes written
	  0		; not used
  	inc  lineNum		; next line number
.UNTIL lineNum > 50

; Resize and reposition the console window relative to the
; screen buffer.
	INVOKE SetConsoleWindowInfo,
	  outHandle,
	  TRUE,
	  ADDR windowRect

	call Readchar	; wait for a key
	call Clrscr	; clear the screen buffer
	call Readchar	; wait for a second key

	INVOKE ExitProcess,0
main ENDP
END main

⌨️ 快捷键说明

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