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

📄 console1.asm

📁 在MASM6.15上
💻 ASM
字号:
TITLE Win32 Console Example #1                    (Console1.asm)

; This program calls the following Win32 Console functions:
; GetStdHandle, ExitProcess, WriteConsole
; Last update: 1/20/02

INCLUDE Irvine32.inc

.data
endl EQU <0dh,0ah>		; end of line sequence
message  \
BYTE "-------------------- Console1.asm -----------------------"
BYTE endl,endl
BYTE "This program is a simple demonstration of console ",endl
BYTE "mode output, using the GetStdHandle and WriteConsole ",endl
BYTE "functions.",endl
BYTE "---------------------------------------------------------"
BYTE endl,endl,endl
messageSize = ($-message)

consoleHandle DWORD 0     ; handle to standard output device
bytesWritten  DWORD ?     ; number of bytes written

.code
main PROC
  ; Get the console output handle:
	INVOKE GetStdHandle, STD_OUTPUT_HANDLE
	mov consoleHandle,eax

  ; Write a string to the console:
	INVOKE WriteConsole,
	  consoleHandle,		; console output handle
	  ADDR message,       		; string pointer
	  messageSize,		; string length
	  ADDR bytesWritten,		; returns num bytes written
	  0		; not used

	INVOKE ExitProcess,0
main ENDP
END main

⌨️ 快捷键说明

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