汇编关机代码

;$$ - 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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值