uVision3 Bug?

Hello,
why is the simple code below assembled wrong?
The disassembly copies the same value from the same memory location 0x06 to tp(n). (MOV @R0,0x06)

Thanks for Help
Christian Tauschek

MY WRITTEN CODE:
unsigned char tp[20];
for (n = 19; n > 0 ; n--) { tp[n] = tp[n-1]; }

__________________________________________
WRONG DISASSEMBLY:

46: for (n = 19; n > 0 ; n--) {
C:0x08CA 7F13 MOV R7,#0x13
47: tp[n] = tp[n-1];
C:0x08CC 7421 MOV A,#0x21
C:0x08CE 2F ADD A,R7
C:0x08CF F8 MOV R0,A
C:0x08D0 E6 MOV A,@R0
C:0x08D1 FE MOV R6,A
C:0x08D2 7422 MOV A,#tp(0x22)
C:0x08D4 2F ADD A,R7
C:0x08D5 F8 MOV R0,A
C:0x08D6 A606 MOV @R0,0x06
48: }
C:0x08D8 DFF2 DJNZ R7,C:08CC
__________________________________________

MY uVISION3:
IDE-Version:
µVision3 V3.80
Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2009

License Information:
Christian Tauschek
Tauschek
LIC=----

Tool Version Numbers:
Toolchain: PK51 Prof. Develpers Kit Version: 8.18
Toolchain Path: C:\Keil\C51\BIN\
C Compiler: C51.Exe V8.18
Assembler: A51.Exe V8.01
Linker/Locator: BL51.Exe V6.20
Librarian: LIB51.Exe V4.24
Hex Converter: OH51.Exe V2.6
CPU DLL: S8051.DLL V3.65
Dialog DLL: DP51.DLL V2.54

Parents
  • "why is the simple code below assembled wrong?"

    What have you done to prove that it is wrong?

    "The disassembly copies the same value from the same memory location 0x06 to tp(n). (MOV @R0,0x06)"

    0x06 is the direct address of R6. There is no MOV @Ri,Rn instruction, but there is a MOV @Ri,direct instruction.

Reply
  • "why is the simple code below assembled wrong?"

    What have you done to prove that it is wrong?

    "The disassembly copies the same value from the same memory location 0x06 to tp(n). (MOV @R0,0x06)"

    0x06 is the direct address of R6. There is no MOV @Ri,Rn instruction, but there is a MOV @Ri,direct instruction.

Children
More questions in this forum