sábado, 3 de febrero de 2018




MOVW and MOVT


Dr. C. A. Hernandez-Gutierrez


--------------------------------------------
if you want to load a 32 bits value you should to write MOVW followed by MOVT. Where MOVT is move TOP.

MOVW writes the less significant 16 bits of a register.
for example :
MOVW R0, #0xAAAA
it means that R0 = 0x0000AAAA
MOVT means MOV TOP 
for example:
MOVT R0, 0xFFFF
it means that R0 = FFFF0000

Finally, we share an example:


--------------------------------------------

main
  MOV R3,#0
  MOVW R3, #0xABCD  ;MOV Wide
  MOVT R3, #0xFFFF  ;MOV TOP
  B main  ;JUMP to main address

  END
--------------------------------------------
After the program finish R3 is going to be:
R3 = 0xFFFFABCD


--------------------------------------------

No hay comentarios.:

Publicar un comentario

BTFSS INSTRUCTION  IN ASSEMBLER FOR PIC18F In this sample, we show that how to use a switch input to make an action. Remember that I...