; TITLE GSYSINIT.SYS to grab SYSINIT module from top of mem ; VERSION 1.0 ; DATE 20/3/92 ; (C) 1992 David Woodhouse cseg SEGMENT para public 'code' org 0 assume cs:cseg,ds:cseg,es:nothing,ss:cseg main: dw 0ffffh ;next dvc dw 0ffffh dw 8000h ;attr. dw dvcstrat ;device strategy dw dvcint ;device interrupt db "GSysInit" ;mfg name/unit msg0 db 0Dh,0Ah,"SHOWPARM.SYS",0Dh,0Ah,24h rqhdr dd 0 ;request header ptr ;device strategy dvcstrat proc far mov cs:word ptr rqhdr,bx ;save request header ptr mov cs:word ptr rqhdr+2,es ret dvcstrat endp ;device interrupt dvcint proc far push ax ;save all regs push bx push cx push dx push di push si push bp push ds push es les di,cs:rqhdr ;es:di --> req. header mov es:[di+3],0100h ;status word = done cmp byte ptr es:[di+2],0 ;is it INIT command? jnz cont1 ;no --> call init ;commands all return here cont1: pop es ;restore all regs pop ds pop bp pop si pop di pop dx pop cx pop bx pop ax ret dvcint endp ;........................... INIT: .......................................... Init: push cs pop ds mov dx,offset msg0 mov ah,9 int 21h ;print signon msg lds si,es:[di+12h] ;load pointer to command line loop: mov ax,0e20h int 10h ;print space lodsb call phbyte cmp al,0ah jnz loop mov word ptr es:[di+0eh],0000 ;set last byte needed mov es:[di+10h],cs ret ;.....................phword........................... ; IN: AX word to be printed ; OUT: nothing ; LOST: nothing phword: push ax xchg al,ah call phbyte mov al,ah call phbyte pop ax ret ;................phbyte........... ; IN: AL byte to printed ; OUT: nothing ; LOST: nothing phbyte: push ax mov ah,al shr al,1 shr al,1 shr al,1 shr al,1 call phnibble mov al,ah call phnibble pop ax ret ;..............phnibble................ ; IN: AL nibble to be printed ; OUT: nothing ; LOST: nothing phnibble: push ax and al,0Fh add al,'0' cmp al,'9' jna ph1 add al,'A'-'9'-1 ph1: mov ah,0Eh int 10h pop ax ret ;........................... Get setup parameters ............................. cseg ends end main