Question: I have to modify the below MASM611 program, tone25.asm, so that the 0.25-second 1 KHz tone plays five times, once each second. I am to

I have to modify the below MASM611 program, tone25.asm, so that the 0.25-second 1 KHz tone plays five times, once each second. I am to use DOS INT 21H Function 2CH (Get Time) to read the system clock, then look for the seconds value to change which when it does, a 0.25-second tone should play. Then the program should ask that the system clock be watched again, waiting for the seconds to change again. This should be done five times.

This is the program I have written so far however, I am stuck on getting the .25 second 1 KHz tone to play five times, once each second. Could you please help me to correct this incomplete MASM program so that it will play the .25 second tone five times?

Tone25.asm:

;Program TONE25.ASM: Generate a 1 KHz tone on the PC speaker for 5 seconds.

;

.MODEL SMALL

.DATA

;Note: The inner and outer loop count values are adjusted to get the .25 second tone.

;This program was run on a 2.5 GHz machine.

OUTER DW 40 ;outer loop count

INNER DW 500 ;inner loop count

.CODE

.STARTUP

CALL SPKRON ;turn speaker on

MOV CX,1190 ;divisor for 1 KHz tone

INT 21H ;DOS call get time

CALL LDTIMER ;set speaker frequency

CALL DELAY ;wait for chosen duration

CALL SPKROFF ;turn speaker off

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!