| ??? 01/27/03 04:38 Read: times |
#37368 - RE: What's wrong with this C code? |
Andy:
Technically there is nothing wrong with how you wrote the first example. I tried out your sample that you said was not working and note that it is working correctly in the latest version of the Keil C51 version 7.01. Here is the resulting output file....
; test.out generated from: test.c
; COMPILER INVOKED BY:
; C:KeilC51BINc51.exe test.c DB OE
NAME TEST
?PR?_foo1?TEST SEGMENT CODE
PUBLIC _foo1
; #pragma SRC(test.out)
;
; void foo1(unsigned char count)
RSEG ?PR?_foo1?TEST
_foo1:
USING 0
; SOURCE LINE # 3
;---- Variable 'count?040' assigned to Register 'R7' ----
; {
; SOURCE LINE # 4
?C0001:
; while(count--)
; SOURCE LINE # 5
MOV R6,AR7
DEC R7
MOV A,R6
JNZ ?C0001
; {
; SOURCE LINE # 6
; }
; SOURCE LINE # 7
; }
; SOURCE LINE # 8
?C0003:
RET
; END OF _foo1
END
You have encountered one of the primary reasons that compiler vendors keep making new versions of their products. I think you need to look at first an upgrade to your compiler. Their latest version C251 is V3.51. Also you should post this issue directly to Keil so that they can get the problem fixed and get you a new version or the compiler for your project. Michael Karas |
| Topic | Author | Date |
| What's wrong with this C code? | 01/01/70 00:00 | |
| RE: What's wrong with this C code? | 01/01/70 00:00 | |
| RE: What's wrong with this C code? | 01/01/70 00:00 | |
| RE: What\'s wrong with this C code? | 01/01/70 00:00 | |
RE: What\'s wrong with this C code? | 01/01/70 00:00 |



