 | Discussion Forum |  |
|
|
IS THIS A BUG? :-(Next Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Youth Jack Posted 28-Sep-2001 16:20 GMT Toolset C51 |  IS THIS A BUG? :-( Youth Jack Hi, all
I found there is likely a bug in keil c51's compiler(V6.0 DEMO Version)
When compile and link the following program lines:
#include <absacc.h> #include <reg52.h>
#define ADDR201 XBYTE[0x8000] bdata unsigned char D201; sbit green = D201^2; void main(void) { while(1) { green = 1; ADDR201 = D201; green = 0; green = 1; ADDR201 = D201; } }
the result was:
RSEG ?PR?main?TMAIN main: ; SOURCE LINE # 8 ; { ; SOURCE LINE # 9 ?C0001: ; while(1) ; SOURCE LINE # 10 ; { ; SOURCE LINE # 11 ; green = 1; ; SOURCE LINE # 12 SETB green ; ADDR201 = D201; ; SOURCE LINE # 13 MOV DPTR,#08000H MOV A,D201 MOVX @DPTR,A ; green = 0; ; SOURCE LINE # 14 CLR green ; green = 1; ; SOURCE LINE # 15 SETB green ; ADDR201 = D201; ; SOURCE LINE # 16 MOVX @DPTR,A ; } ; SOURCE LINE # 17 SJMP ?C0001 ; END OF main END
there was an obvious error in the assembly code for source line # 16 ! there should be another line: MOV A,D201 before the line: MOVX @DPTR,A
Is it a bug?
| | Read-Only Author Keil - Test registierung Support Posted 11-Oct-2001 06:29 GMT Toolset C51 |  RE: IS THIS A BUG? :-( Keil - Test registierung Support You need to define the variable using the volatile keyword as explained in:
http://www.keil.com/support/docs/1863.htm | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|