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

assembly from C

hello everyone,
i have a doubt regarding conversion from C to assembly when using the disassembly window in keil uv3. now int x; converts to MOV x(0x05),0x00; in assembly language. i dont know what the notation x(0x05) means. ideally it should be mov r0,0x00; mov r1,0x00; since i need to allot 16 bits. kindly help me out here.

Parents
  • Most assembler programmers makes use of labels - it's not good to use numeric values for addresses when writing code. What if you want to switch address? Add a variable? Remove a variable?

    So if humans normally names the addresses used - why shouldn't the compiler be good enough to do the same when it generates assembler output?

    Programming isn't about using the fewest numbers of characters in the source code. It's about writing the most human-readable and understandable code that still performs well.

    If I do write assembler code, and need a 16-bit variable on an 8-bit processor, I would use "var", "var+1" to access the two memory cells. The only trick remaining then is to make it clear if the variable is stored big-endian eller little-endian.

Reply
  • Most assembler programmers makes use of labels - it's not good to use numeric values for addresses when writing code. What if you want to switch address? Add a variable? Remove a variable?

    So if humans normally names the addresses used - why shouldn't the compiler be good enough to do the same when it generates assembler output?

    Programming isn't about using the fewest numbers of characters in the source code. It's about writing the most human-readable and understandable code that still performs well.

    If I do write assembler code, and need a 16-bit variable on an 8-bit processor, I would use "var", "var+1" to access the two memory cells. The only trick remaining then is to make it clear if the variable is stored big-endian eller little-endian.

Children
No data