binary - Assembly instruction to machine code -


i'm trying convert movff 0x10, 0x15 machine code. microcontroller microchip pic 18f1220. reference manual says:

movff fs,fd 

encoding:
1st word: 1100 ffff ffff ffffs
2nd word: 1111 ffff ffff ffffd

the solution is:

1100 0000 0010 0000 1111 0000 0010 0101 

but solution i'm getting is

0x10 = 0001 0000 0x15 = 0001 0101 1100 0000 0001 0000 1111 0000 0001 0101 

can please explain me how right answer?

thank you

everything ok.

movff 2 words instruction (each word 16 bits long).

movff instruction word starts bits b'1100' , follow 12 bits source byte address in case 0x10. after instruction follow 'destination instruction word' starts b'1111' , follow 12 bits destination byte address in case 0x15.

if jump (branch) 'destination instruction' nop should performed.

on way possible address 4096 bytes of ram under pic18 (what mean whole ram).

edit: added simple test case output file pic18f1220:

---  c:\work\test\test.asm  ----------------------------------------------                                                   1:        org 0                                                   2:     fs equ  0x10                                                   3:     fd equ  0x15    000    c010     movff 0x10, 0x15               4:        movff   fs, fd    002    f015     nop    004    c010     movff 0x10, 0x15               5:        movff   0x10, 0x15    006    f015     nop 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -