< -->

;Может быть запущена невидимой, например, так (из реестра Windows):
;REGEDIT4
;
;[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
;"zBootLogs"="command.com /C C:\\WINDOWS\\APBOOT.COM>>C:\\WINDOWS\\APPLOG\\abootsh.log"

;apboot.asm
	   .model tiny
	   .code
	   .186
	   org 100h
start:
	mov	ah, 2Ah
	int	21h

	xor	bx, bx
	mov	bl, al
	add	bl, al
	mov	ax, word ptr dayofweek[bx]
	mov	word ptr date + 13, ax

	mov	al, dl
	call	bcd2ascii
	mov	word ptr date, ax

	mov	al, dh
	call	bcd2ascii
	mov	word ptr date+3, ax

	mov	ax, cx
	mov	bl, 100
	div	bl

	call	bcd2ascii
	mov	word ptr date+6, ax

	mov	ax, cx
	mov	bl, 100
	div	bl
	mul	bl
	sub	cx, ax
	mov	al, cl

	call	bcd2ascii
	mov	word ptr date+8, ax

	mov	ah, 2Ch
	int	21h

	mov	al, ch
	call	bcd2ascii
	mov	word ptr time, ax

	mov	al, cl
	call	bcd2ascii
	mov	word ptr time+4, ax

	mov	al, dh
	call	bcd2ascii
	mov	word ptr time+8, ax

	mov	al, dl
	call	bcd2ascii
	mov	word ptr time+11, ax

	mov	al, 14	;POST CMOS
	out	70h, al
	call	delay
	in	al, 71h
	call	hex2ascii
	mov	word ptr PostByte, ax

	mov	al, 15	;ShutDown CMOS
	out	70h, al
	call	delay
	in	al, 71h
	call	hex2ascii
	mov	word ptr ShutByte, ax

	mov	ah, 0
	int	1Ah

	mov	al, ch
	call	hex2ascii
	mov	word ptr TimerByteLo, ax

	mov	al, cl
	call	hex2ascii
	mov	word ptr TimerByteLo+2, ax

	mov	al, dh
	call	hex2ascii
	mov	word ptr TimerByteLo+4, ax

	mov	al, dl
	call	hex2ascii
	mov	word ptr TimerByteLo+6, ax

	push	ds
	xor	bx, bx
	mov	ds, bx
	mov	bx, 470h
	mov	al, byte ptr [bx]

	pop	ds
	call	hex2ascii

	mov	word ptr TimerByteHi, ax

	mov	dx, offset newline
	call	output

	mov	dx, offset date
	call	output

	mov	dx, offset time
	call	output

	mov	ax, 1600h
	int	2Fh

	mov	dx, offset DOS

	test	al, al
	jz	no_windows

	mov	dx, offset WIN
no_windows:
	call	output

	mov	dx, offset POST
	call	output

	mov	dx, offset SHUT
	call	output

	mov	dx, offset Timer
	call	output

	mov	dx, offset newline
	call	output

	ret

bcd2ascii	proc	near
	aam
	or	ax, 3030h
	xchg	ah, al
	ret
bcd2ascii	endp

hex2ascii	proc	near
	mov	ah, al
	and	al, 0Fh
	shr	ah, 4

	cmp	al, 10
	sbb	al, 69h
	das

	xchg	al, ah

	cmp	al, 10
	sbb	al, 69h
	das

	ret
hex2ascii	endp

output	proc	near
	mov	ah, 09h
	int	21h
	ret
output		endp

delay	proc	near
	mov	cx, 0FFFFh
lpc:
	inc	ax
	inc	bx
	dec	ax
	dec	bx
	loop	lpc
	ret
delay		endp

WIN		db "WOWWAWS",0Ah,"$"
DOS		db "MS DOS",0Ah,"$"
POST		db "POST: 0"
PostByte	db "**h",0Ah,"$"
SHUT		db "Shut: 0"
ShutByte	db "**h",0Ah,"$"
Timer		db "Таймер: 0"
TimerByteHi	db "**:"
TimerByteLo	db "********h",0Ah,"$"
newline 	db "------v2.5------",0Ah,"$"
date		db "00.00.0000г,    ",0Ah,"$"
time		db "00ч:00м:00.00с",0Ah,"$"
dayofweek	db "ВсПнВтСрЧтПтСб"
end start

Назад