Buggy inline assembler

Walter Bright newshound at digitalmars.com
Fri Aug 18 12:59:05 PDT 2006


Heinz wrote:
> Hi everyone, i've seen many bugs with the inline assembler in D. I've tried
> many functions that work with other assemblers, simple functions such as print
> to screen (i've seen D users complaining about this too).
> I'm writing a block of code to make some sound through the pc speaker. It
> compiles fine but at runtime i get a Win32 Exception.

The problem has nothing to do with the inline assembler. You can use 
OBJ2ASM to verify that the correct instructions are generated. The 
problem is that executing IN and OUT instructions under Win32 will 
generated an operating system exception.

To print to screen, use the Win32 Console API functions. I don't 
remember what the Win32 sound API is, but that has to be used to 
generate sound.



More information about the Digitalmars-d-bugs mailing list