digitalmars.D - the inline assembler
- lee (11/11) Jun 27 2006 I'm trying to call dos interrupts using the inline assembler.
- Frits van Bommel (12/23) Jun 27 2006 I don't believe '21H' is a valid integer in D.
- llee (2/25) Jun 27 2006 The same error results.
- dennis luehring (6/33) Jun 27 2006 long interrupt_code is much larger than the 8bit ah register
- llee (3/36) Jun 27 2006 I'm trying to read keyboard events through dos services.
- dennis luehring (11/13) Jun 27 2006 me > know.
- llee (2/15) Jun 27 2006 it's a console app.
- Andrew Fedoniouk (2/3) Jun 27 2006 import std.c.stdio;
- pragma (14/55) Jun 27 2006 Wow*.
- Walter Bright (3/5) Jun 29 2006 What you're looking for are the windows console API functions. Download
- Walter Bright (3/17) Jun 29 2006 I tried it, and it compiles correctly. However, it won't run because
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.
Jun 27 2006
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 ; } }
Jun 27 2006
In article <e7sa56$3qb$1 digitaldaemon.com>, Frits van Bommel says...lee wrote:The same error results.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 ; } }
Jun 27 2006
llee schrieb:In article <e7sa56$3qb$1 digitaldaemon.com>, Frits van Bommel says...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 dennislee wrote:The same error results.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 ; } }
Jun 27 2006
In article <e7sivt$emq$1 digitaldaemon.com>, dennis luehring says...llee schrieb: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.In article <e7sa56$3qb$1 digitaldaemon.com>, Frits van Bommel says...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 dennislee wrote:The same error results.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 ; } }
Jun 27 2006
llee schrieb:I'm trying to read keyboard events through dos services. If it's possible to access these services on the win32 platform letme > know. why do try to use dos interrupts - what speaks against phobos functions? (i think) you can only use dos services (realmode emulation on top of win-api) within an real 16bit dos programm - and the D compiler/linker doesn't produce such exes pure win32 programs (dmd compiled ones) cannot call dos interrupts neither can read ports or something like that from which type of program you are trying to receive keystrokes? window or console program? ciao dennis
Jun 27 2006
In article <e7slui$hsv$1 digitaldaemon.com>, dennis luehring says...llee schrieb:it's a console app.I'm trying to read keyboard events through dos services. If it's possible to access these services on the win32 platform letme > know. why do try to use dos interrupts - what speaks against phobos functions? (i think) you can only use dos services (realmode emulation on top of win-api) within an real 16bit dos programm - and the D compiler/linker doesn't produce such exes pure win32 programs (dmd compiled ones) cannot call dos interrupts neither can read ports or something like that from which type of program you are trying to receive keystrokes? window or console program? ciao dennis
Jun 27 2006
it's a console app.import std.c.stdio; int c = getchar();
Jun 27 2006
In article <e7ske2$g67$1 digitaldaemon.com>, llee says...In article <e7sivt$emq$1 digitaldaemon.com>, dennis luehring says...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 yahoollee schrieb: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.In article <e7sa56$3qb$1 digitaldaemon.com>, Frits van Bommel says...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 dennislee wrote:The same error results.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 ; } }
Jun 27 2006
llee wrote: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.What you're looking for are the windows console API functions. Download microemacs from www.digitalmars.com for example code.
Jun 29 2006
llee wrote:In article <e7sa56$3qb$1 digitaldaemon.com>, Frits van Bommel says...I tried it, and it compiles correctly. However, it won't run because Win32 programs cannot execute interrupt instructions.This should compile: void main() { long interrupt_code; asm { mov AH, interrupt_code ; int 0x21 ; } }The same error results.
Jun 29 2006