Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/27/03 07:00
Read: times


 
#37371 - RE: What's wrong with this C code?
Here're the assembler from V3.2a of the C251 compiler. I'm quite happy with the C51 product, but somewhat disappointed at the C251 product and the the way Keil charges for their upgrades. The xrl R10,R10 instruction clears count at the beginning.

Andy


; line 338: void foo(unsigned char count) {
MOV R10,R11 ; A=R11
;---- Variable 'count' assigned to Register 'R10' ----
;---- Variable 'i' assigned to Register 'WR6' ----
; line 339: int i = 10;
MOV WR6,#0AH
; line 340:
; line 341: while(count--) {
XRL R10,R10
SJMP ?C0060
?C0062:
; line 342: i *= 10;
MOV WR4,#0AH
MUL WR6,WR4
; line 343: }
?C0060:
MOV R5,R10
MOV R10,R5
DEC R10,#01H
CJNE R5,#00H,?C0062
; line 344: }
RET
ENDP
; line 345:



List of 5 messages in thread
TopicAuthorDate
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      

Back to Subject List