- #1
JJBladester
Gold Member
- 286
- 2
Homework Statement
How many NOP instructions are run in the nested loop below?
OUTER DW 4000 ;outer loop count
INNER DW 62000 ;inner loop count
MOV DX,OUTER
WAIT1: MOV CX,INNER
WAIT2:
NOP
NOP
NOP
NOP
LOOP WAIT2
DEC DX
JNZ WAIT1
RET
DELAY ENDP
The Attempt at a Solution
I am creating a delay loop for use with an 8253 timer which is used to create a tone on a PC's internal speaker. The program is written in assembly. I am having a hard time figuring out how many times NOP executes in the code above.
I believe it is inner + outer = (4)(62000) + (4)(4000) = 264,000.
Any insight would be appreciated.