Results 1 to 5 of 5

Thread: Sound in assembly

  1. #1
    Join Date
    Apr 2011
    Location
    La La Land
    Beans
    223

    Sound in assembly

    I've read many articles and forum threads on making noise through the speaker using assembly. None of them have been in intel x86 though. Is there a way to do this using intel x86? If so, I would like to know how. Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    Canada, Montreal QC
    Beans
    1,809
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Sound in assembly

    I don't know if this helps, but see if you can use the "\a" ASCII character.
    I remember that it made a beep when it was sent on stdout. It may not work on all platforms though.
    This works on my Arch install:
    Code:
    #include <stdio.h>
    
    int main()
    {
        printf("\a");
    }
    Last edited by cgroza; September 7th, 2011 at 09:57 PM.
    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
    Freedom is measured in Stallmans.
    Projects: gEcrit

  3. #3
    Join Date
    Mar 2010
    Location
    South Africa
    Beans
    347
    Distro
    Ubuntu

    Re: Sound in assembly

    Quote Originally Posted by CoffeeRain View Post
    I've read many articles and forum threads on making noise through the speaker using assembly. None of them have been in intel x86 though. Is there a way to do this using intel x86? If so, I would like to know how. Thanks.
    Post the AT&T syntax for it and I'll see if i can find intel alternative.
    Registered Linux user: #543082
    Registered Ubuntu user: #34219
    http://dvisagie.com/


  4. #4
    Join Date
    Apr 2011
    Location
    La La Land
    Beans
    223

    Re: Sound in assembly


  5. #5
    Join Date
    May 2007
    Beans
    245
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Sound in assembly

    Quote Originally Posted by CoffeeRain View Post
    That code will not work on any modern Operating System ( Protected-Mode prevents user-land code from directly accessing the hardware http://en.wikipedia.org/wiki/Protected_mode ).

    The easiest approach is to use the sound functions from 'libsdl':
    http://wiki.libsdl.org/moin.cgi/CategoryAudio

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •