R
R
Rustam Safin2011-09-23 21:01:42
assembler
Rustam Safin, 2011-09-23 21:01:42

Timer in Assembler

Greetings.

At the university, they set a coursework, the task is as follows:

Read the current time, add a specified interval to it (for example, 5 seconds) and set an alarm for the received time.

I started writing, diligently studying codenet.ru, DOSBox and TASM. It turned out the following: pastebin.com/XxNbhBT6 In order to work with the timer, I use the 1Ah interrupt. Function 02h I read the current time, then add 5 seconds and set the timer with function 06h. This is where the main difficulty awaited me. The documentation on codenet.ru says:

06H - set the real-time clock signal. At the specified time, the user program is called on the interrupt vector INT 4aH.

Googling a little, I found out that interrupt interception is defined as follows:

lea dx, some_function
mov ah,25h
mov al,4Ah


Created a function that should output a string on a timer signal. But when the resulting exe-shnik is launched in dosbox, the following situation occurs: messages about reading the time and the timer are displayed simultaneously (that is, 5 seconds does not pass). After that the program hangs and it is necessary to kill together with dosbox'om.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2011-09-23
@OLS

Are you sure you are calling int 21h
after lea dx, some_function
mov ah,25h
mov al,4Ah ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question