Friday, March 12, 2010

Don't run this program

Hi guys,
I just testing out the bell sound.
trying to figure out how to do major project 1.
So I took this program out of the lecture notes.
Modify it a little...
Apparently the loop is a little screwed up.
Don't try this program...really...the loop isn't really working.
If you can fix it then its cool.

DATA segment
Msg db “to stop this annoying sound press any key $”
DATA ends

;stack segment
stk segment stack
db 128 DUP(?)
tos label word
stk ends
;

code segment
assume cs:code, ss:stk
start:
Mov ah, 09
Mov dx, offset Msg ; this is to display the message using int 21h (09)
Int 21h
AGAIN: mov ah,02
mov dl,07 ; bell character is 07 loaded to register dl for using int 21h
int 21h
mov ah,01 ; checking a key press
int 16h
JZ AGAIN ; if no key is pressed keep looping and create that annoying sound!
mov ah,4ch ; exit to DOS prompt;
int 21h
code ends
end start

Then I thought...screw the loop I only wanted to hear the bell.
So I removed the loop and the program only produces the bell sound.

It beep thrice...rather annoying.
Anyway, still trying to figure out the musical notes.
I think need to attach a WAV or MP3 folder...just thinking man...

No comments:

Post a Comment