flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > PC speaker...? |
Author |
|
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...
|
|||
20 Sep 2004, 00:16 |
|
Keoro 20 Sep 2004, 00:45
A COM that uses no DOS-specific interrupts or functions
|
|||
20 Sep 2004, 00:45 |
|
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. |
|||
20 Sep 2004, 09:24 |
|
neonz 26 Sep 2004, 13:19
COM files have ORG 100h, I think you need flat binary file not a COM.
|
|||
26 Sep 2004, 13:19 |
|
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!
|
|||
27 Sep 2004, 12:48 |
|
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. |
|||
27 Sep 2004, 17:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.