打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
ASM源码:最简洁完整的DOS设备驱动程序

cseg segment
assume  cs:cseg,ds:cseg,es:cseg
  org 0
hander dd  -1
attrib dw 8000h
struct dw offset strutegy
inter  dw offset interrupt
namee  db 'simple  '
rh_off dw 0
rh_seg dw 0
mseg   db 07h,'my drive is installed!'
       db 0dh,0ah,07h,'$'
comdtab dw init

strutegy  proc far
     mov cs:rh_off,bx
     mov cs:rh_seg,es
     ret
strutegy endp

interrupt proc far
    push ds
    push es
    push ax
    push bx
    push dx
    push di
    les bx, dword ptr cs:rh_off
    mov al,es:[bx+2]
    cmp  al,0
    jnz exit2
    shl al,1
    lea di,comdtab
    xor ah,ah
    mov di,ax
    call word ptr [di+comdtab]
    jmp exit1
exit2:mov  word ptr es:[bx+3],8003h
exit1:mov  word ptr es:[bx+3],100h
    pop di
    pop dx
    pop bx
    pop ax
    pop es
    pop ds
 ret
interrupt endp

init proc near
    lea dx,mseg
    mov ah,9
    int 21h
    mov word ptr es:[bx+0eh],offset init
    mov es:[bx+10h],cs
    xor ax,ax
    ret
init endp
cseg ends
   end

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
NT,2000,XP 的 CDROM 引导扇区代码分析
看雪学院
汇编(十四)——串操作类指令练习
汇编语言学习笔记(【汇编语言】小甲鱼零基础汇编)
来看看雷军 1994 年写的代码,经典老古董
第11章 保护模式下的程序设计简介
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服