;$$ - start position
bits 16
cpu 8086
org 07c00h
mov ax,cs
mov ds,ax
mov es,ax
;output bootMsg -- first msg
mov ax,bootMsg ;input parameter msg
mov cx,bootMsgLen ;str length
mov dh,00h ;第1行
call ShowMsg ;output str
;不行
;mov ax,5301h
;xor bx,bx
;int 15h
;不行
;MOV AX,530EH ;高级电源管理功能,配置连接设备的版本号
;XOR BX,BX ;系统BIOS设备ID
;MOV CX,0102H ;CH主版本号CL从版本号
;INT 15H
;关机代码成功
MOV AX,5307H ;高级电源管理功能,设置电源状态
MOV BX,0001H ;设备ID,1:所有设备
MOV CX,0003H ;状态,3:表示关机
INT 15H
jmp $ ;loop at current postion
ShowMsg:
mov bp,ax
mov ax,01301h
mov bx,000ch
mov dl,0 ;列 dh 是行
int 10h
ret
bootMsg:
db "Hello,World!"
bootMsgLen equ $-bootMsg
;$ -current position
times 510-($-$$) db 0
dw 0xaa55
汇编关机代码
最新推荐文章于 2024-07-19 21:35:18 发布