I can't come up with an example right now, but there's a translated yellow-cover book, I think it's called something like Detailed Explanation of IBM PC Assembly Language, and it has quite a few examples like that!
Actually, writing drivers is just about hiding individuality and providing application programs with a unified interface for using peripherals!
Its most basic operation is just operating the I/O interface, and C language has that kind of thing too, much easier to use than assembly!
I recommend you go have a look at this place, but the difficulty level here is a bit higher!
http://www.driverdevelop.com/ gets hacked a lot, so don't blame me if you can't get on, hehe
Actually, my keyboard program is already very close to a driver program, hehe!
临河居士
http://www.xygod.pc5.org