TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: PETER MAGNUSSON
from: JAMES VAHN
date: 1998-01-04 21:45:00
subject: Re: SYS-files

> Don't think so. I'll try finding it.
Found this in a dusty corner of the hard drive...
;=====================================================================
;==
;==     Project                 : Generic device driver
;==     Module name             : ddrv.asm
;==     Author(s)               : Mark E. Huss
;==     Purpose                 : 
;==
;==     Created                 : Dec 12, 1994 
;==
;==                              Revision history
;==                              ================
;==
;======================================================================
         page 65,132
 .286
 DONE    equ     0100h
 ERROR   equ     8000h
 INIT    equ     0
 reqhdr  struc
         db      ?               ; length
         db      ?               ; unit #
 cmd     db      ?               ; command
 stat    dw      ?               ; status
         db      8 dup(?)        ; reserved
 reqhdr  ends
 inithdr struc
         db      (type reqhdr) dup(?)
 units   db      0
 endofs  dw      0
 endseg  dw      0
 bpbofs  dw      0
 bpbseg  dw      0
 inithdr ends
 ;======================================================================
 CSEG    segment
         assume cs:CSEG, ds:nothing, es:nothing
         dd      -1              ; pointer to next device
         dw      8000h           ; chr device
         dw      offset  strategy
         dw      offset  interrupt
         db      '12345678'      ; 8 character name
 req_ptr label   dword
 rp      dw      ?,?
 strategy        proc    far
         mov     cs:rp,bx
         mov     cs:rp[2],es
         ret
 strategy        endp
 interrupt       proc    far
         pusha
         push    ds
         push    es
         lds     si,req_ptr
         cmp     [si].cmd, INIT
         je      do_init
         mov     ax,ERROR + DONE
         sub     dx,dx
         jmp     outa_here
 do_init:
         call    myInit
 outa_here:
         mov     [si].stat,ax    ; return status to DOS
         mov     [si].endofs,dx  ; size to keep (0 if not)
         mov     [si].endseg,cs  ; END offset = our CS:nnnn
         pop     es
         pop     ds
         popa
         ret
 interrupt       endp
 ; my other (no-init) code... v
 ;     ... goes in here ^
 end_of_resident_code:
 myInit  proc
 ;
 ; do init...
 ;
 init_ok:
         mov     ax,DONE
         mov     dx,offset end_of_resident_code
         ret
 init_error:
         mov     ax,DONE + 8000h
         sub     dx,dx   ; 0 == don't keep
         ret
 myInit  endp
 CSEG    ends
         end
--- ifmail-tx (i386 Linux)
---------------
* Origin: jvahn@short.circuit.com (1:346/15.1@fidonet)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.