flat assembler
Message board for the users of flat assembler.

Index > OS Construction > PC speaker...?

Author
Thread Post new topic Reply to topic
Keoro



Joined: 28 May 2004
Posts: 4
Keoro 20 Sep 2004, 00:16
I need a bootable COM that prints a custom message to the screen and plays Beethoven's Fur Elise on the PC speaker...
Post 20 Sep 2004, 00:16
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 20 Sep 2004, 00:38
Keoro wrote:
I need a bootable COM that prints a custom message to the screen and plays Beethoven's Fur Elise on the PC speaker...


Bootable COM ? Smile
what do you mean by that?

MATRIX
Post 20 Sep 2004, 00:38
View user's profile Send private message Visit poster's website Reply with quote
Keoro



Joined: 28 May 2004
Posts: 4
Keoro 20 Sep 2004, 00:45
A COM that uses no DOS-specific interrupts or functions
Post 20 Sep 2004, 00:45
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 20 Sep 2004, 09:24
This is the same as pascal's, sound, delay, nosound, it use's no dos calls, look on the web, for " Beethoven's Fur Elise" for pascal or c,and convert it
Code:
org 100hxor ah,ahint 16hcall Beep1xor ah,ahint 16hcall Beep2xor ah,ahint 16hint 0x20Beep1:MOV     [Hz],100hCALL    SoundCALL    DeLayCALL    NOSOUNDRET;------------------------------------------------------------------------------------------------; Beep tone 2;------------------------------------------------------------------------------------------------Beep2:MOV     [Hz],150hCALL    SoundCALL    DeLayCALL    NOSOUNDRET;------------------------------------------------------------------------------------------------; Sound;------------------------------------------------------------------------------------------------Sound:MOV BX,[Hz]                       ;ThisMOV AX,34DDHMOV DX,0012HCMP DX,BXJNC DONE1 DIV BXMOV BX,AX IN AL,61HTEST AL,3 JNZ A99OR  AL,3 OUT 61H,ALMOV AL,0B6H OUT 43H,AL A99:MOV AL,BL OUT 42H,ALMOV AL,BH OUT 42H,ALDONE1: RET ;------------------------------------------------------------------------------------------------; Delays;------------------------------------------------------------------------------------------------ DeLay:MOV  CX, [MilliS] JCXZ A2A1: CALL DeLaYoneMSLOOP A1 A2: RET ;------------------------------------------------------------------------------------------------;Delay;------------------------------------------------------------------------------------------------ DeLaYoneMS: PUSH CX                          ; Save CXMOV  CX, [OneMS]                 ; Loop count into CX B1:LOOP B1                          ; Wait one millisecond POP  CX                          ; Restore CXRET ;------------------------------------------------------------------------------------------------; Turn sound off ;------------------------------------------------------------------------------------------------ NOSOUND:IN  AL,61h AND AL,11111100bOUT 61h,AL RET Hz     DW ?MilliS DW 200OneMS  DW 40000    



PS: you must have seen, the movie The Web.

\\\\||////
(@@)
ASHLEY4.
Post 20 Sep 2004, 09:24
View user's profile Send private message Reply with quote
neonz



Joined: 02 Aug 2003
Posts: 62
Location: Latvia
neonz 26 Sep 2004, 13:19
COM files have ORG 100h, I think you need flat binary file not a COM. Smile
Post 26 Sep 2004, 13:19
View user's profile Send private message Visit poster's website Reply with quote
joachim_neu



Joined: 22 Dec 2003
Posts: 139
joachim_neu 27 Sep 2004, 12:48
oh, thanks! may I use the code for an tutorial about pc-speakers, i'm writing at the moment in german? maybe I'll translate it in English!
Post 27 Sep 2004, 12:48
View user's profile Send private message Visit poster's website Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 27 Sep 2004, 17:58
Yes, you can do, with it any thing you like, if you do a English translation of your tut, let me know , i may put it on my web site.

\\\\||////
(@@)
ASHLEY4.
Post 27 Sep 2004, 17:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.