Can somebody please explain what is occuring in each line of

Can somebody please explain what is occuring in each line of this assembly code?

MSP430 Launchpad program: Converts the hexadecimal number to binary and displays the result using LED is given below: Org oxf800 mov.w #0x5a80, &0x0120 mov.b #0x41, &0x22 mov.b #0x41, &0x21 loop: xor.b #0x41, &0x22 xnor.b #0x41, &0x21 mov.w #500000, 85 delav: dec 85 jn2 delay jmp loop org oxfffx dw oxf800

Solution

mov.w #0x5a80, &0x0120 - this moves the word content of 120 address to that of 5a80

mov.b #0x41, &0x22 - byte is moved from 22 address to 41

mov.b #0x41, &0x21 - byte is moved from 21 address to 41

loop: xor.b #0x41,0&22 - content of 22 is exored wit that of 41

xnor.b #0x41,0&21 -content of 21 is exnored wit that of 41

mov.w #50000 ,85 - 85 is moved to location

delay: dec 85 -it is decremented once

jn2 delay - jumps to delay if not 0 where its again decremented

jmp loop- jumps to loop

org 0xfffx-indicates on where to put the next piece of code/data, related to the current segment. ie in 0xfffx

dw 0xf800 - allocates 2 byte

Can somebody please explain what is occuring in each line of this assembly code? MSP430 Launchpad program: Converts the hexadecimal number to binary and display

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site