the inline assembler

pragma pragma_member at pathlink.com
Tue Jun 27 19:37:45 PDT 2006


In article <e7ske2$g67$1 at digitaldaemon.com>, llee says...
>
>In article <e7sivt$emq$1 at digitaldaemon.com>, dennis luehring says...
>>
>>llee schrieb:
>>> In article <e7sa56$3qb$1 at digitaldaemon.com>, Frits van Bommel says...
>>>> lee wrote:
>>>>> I'm trying to call dos interrupts using the inline assembler.
>>>>> Unfortunately I keep getting the following message during compilation:
>>>>> end of instruction
>>>>> The code I used is listed below. Any help is welcome.
>>>>> asm
>>>>> {
>>>>> mov AH, interrupt_code ;
>>>>> int 21H                ;
>>>>> ..
>>>>> }
>>>>> where interrupt_code is of type long. 
>>>> I don't believe '21H' is a valid integer in D.
>>>> This should compile:
>>>>
>>>> void main()
>>>> {
>>>>     long interrupt_code;
>>>>     asm
>>>>     {
>>>>         mov AH, interrupt_code ;
>>>>         int 0x21               ;
>>>>     }
>>>> }
>>>>
>>> The same error results.
>>
>>long interrupt_code is much larger than the 8bit ah register
>>
>>btw: what are you doing? plain old dos 21h is decprecated since win95
>>most 16bit interrupt (int 0x10h, int 0x13...) procs don't work under win32
>>
>>what do you want from dos? what are you trying todo?
>>
>>ciao dennis
>I'm trying to read keyboard events through dos services.
>If it's possible to access these services on the win32 platform let me know.

Wow*. 

Dennis is right, using interrupts from user-land is *way* beyond depricated by
this point.  Under Windows, your only real alternative is to use the Win32 API.

You're going to want to google around some for this.  Its a little more involved
than I found a decent thread on another site that was started by someone who had
a similar question:

http://www.gidforums.com/t-2092.html

MSDN (http://msdn.microsoft.com) has some more info on the Win32 API, but its
pretty useless unless you already have an idea of what to look for.  Still, its
worth searching there for a good tutorial or two. 

* - Amazingly enough, I still have a softcover copy of Ralph Brown's Interrupt
List on my bookshelf. (2nd Ed. Copyright 1994)

- EricAnderton at yahoo



More information about the Digitalmars-d mailing list