Quantcast
Channel: Question and Answer » assembly
Viewing all articles
Browse latest Browse all 23

Using djnz to make a loop in 8051 assembly language [closed]

$
0
0

To program 8051 using djnz loop I know that if we give r0 a number the loop will be executed accordingly. For example:

Mov r0,#50
Back: instructions
Djnz r0,back

The loop will be executed 50 times.

But if I want to place djnz in the beginning should I initialize r0 as 51 to make the loop instructions skipped 50 times?

For example:

Ex: djnz r0, skip
instructions 
Skip: end

I want to pass the instructions 50 times for an interrupt ISR. So can you tell me which number I should use?


Viewing all articles
Browse latest Browse all 23

Trending Articles