DOS		equ 21h

SECTION	CODE
		org	0x100
start:
		jmp main

%include "printf.inc"

main:
		mov ax, 0x6E00 ; NOISE.SYS INSTALLATION CHECK
		int 0x32
		cmp al, 0xff
		jne .not_loaded
		jmp .is_loaded
.not_loaded:
		MPrintf strFalse, loadedFmt
		jmp .exit
.is_loaded:
		push cx ; for versionFmt
		MPrintf strTrue, loadedFmt
		MPrintf versionFmt

		mov ax, 0x6E10 ; NOISE.SYS STATUS CHECK
		int 0x32
		MPrintf cx, dx, poolFmt

.exit:
		mov ax, 0x4C00 ; DOS exit
		int 0x21

loadedFmt	DB	"NoiseLoaded=%s", 13, 10, 0
poolFmt		DB	"PoolSize=%d", 13, 10, "BytesWaiting=%d", 13, 10, 0
strFalse	DB	"FALSE", 0
strTrue 	DB	"TRUE", 0
versionFmt	DB	"NoiseVersion=%x", 13, 10, 0
