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

8051 disassembly

Hello! in Keil,when i write *(unsigned char*)R1=0x30;
in lst file, Keil use R0. I want R0 don't change or
I want Keil use R1 no R0. Can who help me?

Parents
  • As Per said, when converting (or "refactoring") any code from one form to any other, your goal is to understand the essence of what the original was trying to achieve, and then express that "functionality" in the new form.

    As Erik & Laramy Pete suggested, drawing flowcharts of the original can be a good way to gain the understanding of what the original was doing.

    If you don't like flowcharts, use something else!
    (I have done it by writing pseudo-code alongside the original assembler).

    But one thing is certain: simply trying to duplicate each line of assembler in 'C' is pointless and not going to work!!

Reply
  • As Per said, when converting (or "refactoring") any code from one form to any other, your goal is to understand the essence of what the original was trying to achieve, and then express that "functionality" in the new form.

    As Erik & Laramy Pete suggested, drawing flowcharts of the original can be a good way to gain the understanding of what the original was doing.

    If you don't like flowcharts, use something else!
    (I have done it by writing pseudo-code alongside the original assembler).

    But one thing is certain: simply trying to duplicate each line of assembler in 'C' is pointless and not going to work!!

Children