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

📄 beer.asm

📁 一个用纯汇编 写的操作系统 源代码 是用 TASM 编译器写的
💻 ASM
字号:

; Beer - example of tiny (one section) Win32 program

format PE GUI 4.0

include 'win32a.inc'

; no section defined - fasm will automatically create .flat section for both
; code and data, and set entry point at the beginning of this section

	invoke	MessageBoxA,0,_message,_caption,MB_ICONQUESTION+MB_YESNO
	cmp	eax,IDYES
	jne	exit

	invoke	mciSendString,_cmd_open,0,0,0
	invoke	mciSendString,_cmd_eject,0,0,0
	invoke	mciSendString,_cmd_close,0,0,0

exit:
	invoke	ExitProcess,0

_message db 'Do you need additional place for the beer?',0
_caption db 'Desktop configuration',0

_cmd_open db 'open cdaudio',0
_cmd_eject db 'set cdaudio door open',0
_cmd_close db 'close cdaudio',0

; import data in the same section

data import

 library kernel32,'KERNEL32.DLL',\
	 user32,'USER32.DLL',\
	 winmm,'WINMM.DLL'

 import kernel32,\
	ExitProcess,'ExitProcess'

 import user32,\
	MessageBoxA,'MessageBoxA'

 import winmm,\
	mciSendString,'mciSendStringA'

end data

⌨️ 快捷键说明

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