Your main problem in writing such an API is speed. Sure, you could write your own basic api for graphics in assembly, just as if you were writing some ModeX stuff in Dos.
However, DirectX accesses the graphics card directly in order to achieve hardware acceleration. This therefore means it knows how a vast and diverse range of graphics cards work and function in order to cater for each user's individual system.
Without hardware acceleration in your API, you'll be stuck with just copying system memory buffers to the graphics memory each frame. There is only so much speed you can get out of this, even in the finest tuned assembly. DirectX has this implemented for older cards where hardware acceleration is unavailable/limited.
You could quite probably improve on DirectX's software emulation of hardware acceleration, however, if you were interested in some direct manipulation of pixels etc. for alpha blending or the like. But then you may as well use DirectX as a base anyway for the initial setup of your app (setting screen res etc.), all of which would be quite a feat to program in itself.
Writing your own such API as DirectX would take a lifetime, as well as a large budget to purchase all your test hardware. However, for purely learning purposes I guess you could find some documentation on your current graphics card and play about with some of its functions in assembly. I'm not sure how feasible getting, or implementing, this information would be though.
Trust me, leave it to Microsoft

--
Russ
Edited by - rah on July 30, 2001 8:02:45 PM