Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Assembler Code Deciphering (beginner)

Status
Not open for further replies.
XORwf is one way of toggling certain bits when the word used has any bit that is set to toggle the subject bits..
IOW
XXXX XXXX
0000 1111
the result will be the LSB gets toggled in the upper subject word.
The next instruction is skipped if the result of the XOR word is zero.
A way of testing a register for a certain value.
Max.
 
Last edited:
Welcome to ETO.

Your code will be easier to read if you use code tags to post it like this: [code=asm] place code here [/code]

As for the code itself, you are moving the value 100 to a counter and decrementing that each loop until it equals X (max value 30). If not equal to counter, you delay 100 us, decrease counter, and loop. When equal to X, you set an LED then continue looping until counter =0 and skip to something else.

One concern, assuming that interpretation is correct, is that 100x 100 us + a few instruction cycles = 10 ms + a little. I don't think you will see anything change. At least, the flask will be quick.

John
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top