cx register in 8086

Thread Starter

cssc

Joined Oct 19, 2014
26
So you are using masm on a PC?
Is the masm actually executing the code on a chip or is it running in simulation mode?
How do you determine how long is the actual delay?
its running in simulation mode...
i am not determining the delay...and i don't even know how to do that, because i don't know the clock frequency...
what all i wanted is.,
my program should pause its execution for a notable time and again start it...
 

Thread Starter

cssc

Joined Oct 19, 2014
26
Just checked my microprocessor textbook (we did intel), CX in 8086 is 16 bits so the largest value you can load in CX is FFFFH.

I think your error is the low case h. I think your code should be:
MOV CX, 0FFFFH
i dont think that was the mistake... because i came to know that 8086 masm assembler is case insensitive
 

djsfantasi

Joined Apr 11, 2010
9,156
its running in simulation mode...
i am not determining the delay...and i don't even know how to do that, because i don't know the clock frequency...
what all i wanted is.,
my program should pause its execution for a notable time and again start it...
If you knew the clock frequency, could you calculate the delay? Add up the required clock cycle times of all instructions in the loop. Using the frequency, calculate the total time in your loop for one cycle. Divide the total desired delay time by this one cycle time, and that will be the number of times your code must loop. If it's greater than 65536, you will need nested loops.
 
Top