This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How Keil asemble the "MOV r9,#0"instruction?Thanks a lot.

why the instruction "MOV r9,#0" is understood by Keil as "MOV Rw,#data4",that is, its machine language is transfered as "E0 #n",which is only 2 bytes;yet I get the machine language "E6 RR ####" anciently,which is 4 bytes,that is,it was thought be "MOV reg,#data16" ,why? thank you!
wangwei

Parents
  • EXPLAIN ABOVE QUESTION BUT NOT ANSWER

    In the "MOV" instruction serial, there 2 instructions as follow:
    Mnemonic Format Bytes

    MOV Rwn, #data4 E0 #n 2
    MOV reg, #data16 E6 RR ## ## 4

    In detail, Rw means Word GPR (R0, R1, …, R15);
    reg means SFR/ESFR or GPR.
    Now, I have a instruction line as follow:
    mov r0, #0Bh
    I hope the "#0Bh" is "#data16" type, but not the "#data4" type.
    The problem is that how I can make the KEIL understand my purpose; so, after building, KEIL give me the machine code "E6 F9 0B 00", NOT the "E0 B9".

    THANKS FOR ANY HELP

Reply
  • EXPLAIN ABOVE QUESTION BUT NOT ANSWER

    In the "MOV" instruction serial, there 2 instructions as follow:
    Mnemonic Format Bytes

    MOV Rwn, #data4 E0 #n 2
    MOV reg, #data16 E6 RR ## ## 4

    In detail, Rw means Word GPR (R0, R1, …, R15);
    reg means SFR/ESFR or GPR.
    Now, I have a instruction line as follow:
    mov r0, #0Bh
    I hope the "#0Bh" is "#data16" type, but not the "#data4" type.
    The problem is that how I can make the KEIL understand my purpose; so, after building, KEIL give me the machine code "E6 F9 0B 00", NOT the "E0 B9".

    THANKS FOR ANY HELP

Children
No data