| ??? 12/17/03 11:32 Read: times |
#60820 - RE: Asm variables from C keil Responding to: ???'s previous message |
I will have no part of helping to solve a problem in code that is written as so much garbage. The small sample below shows a small part of what I am talking about....
JB sacvar5_6,FLHMD
MOV A,t_12
ANL A,#0FH
ANL t_15+8,#0F0H
ORL t_15+8,A
FLHMD:
...garbage code is that written with meaningless variable names, strange offsets to variable names, magic constants that mean nothing, and no comments. You can go back and tell your powers to be the same thing!! Garbage belongs in the dump pile, not to be held up as so much of a monument to finality. If you want an example of some code that is written better then a peek at this:
CJNE A, #SENT_STR, CARD_RD6 ; is it the start sentinel?
;
MOV R1, #0 ; set counter for the digit number
CALL PUT_DIG ; store the start sentinel as first digit
INC R1 ; bump up the digit number
;
MOV R2, B ; set R2 to number of digits to fetch
DEC R2
CARD_RD5_LP:
CALL GET_CODE_F ; get next code to A
JNB P, CARD_RD6 ; check the parity and if bad try rev reading
ANL A, #00FH ; mask the code
CJNE A, #SENT_END, CARD_RD5C ; code is not the end code
;
CJNE R2, #2, $+3 ; if remaining digit count is >= 2 then trim
JC CARD_RD5C ; if came too close to end so use residual count
MOV R2, #2 ; trim total count of digits to 2 more
;
CARD_RD5C:
CALL PUT_DIG ; store the digit in the list
Michael Karas |
| Topic | Author | Date |
| Asm variables from C keil | 01/01/70 00:00 | |
| Answer already on Keil forum | 01/01/70 00:00 | |
| RE: Answer already on Keil forum | 01/01/70 00:00 | |
| RE: Asm variables from C keil | 01/01/70 00:00 | |
| Cross-posting | 01/01/70 00:00 | |
| RE: Asm variables from C keil | 01/01/70 00:00 | |
| RE: Asm variables from C keil | 01/01/70 00:00 | |
| RE: Asm variables from C keil | 01/01/70 00:00 | |
| RE: Asm variables from C keil | 01/01/70 00:00 | |
| RE: Asm variables from C keil | 01/01/70 00:00 | |
| RE: Asm variables from C keil | 01/01/70 00:00 | |
| RTFM! | 01/01/70 00:00 | |
| RE: RTFM! | 01/01/70 00:00 | |
| RE: RTFM! | 01/01/70 00:00 | |
| RE: RTFM! | 01/01/70 00:00 | |
Dont do it! | 01/01/70 00:00 | |
| RE: Asm variables from C keil off topic | 01/01/70 00:00 | |
| RE: Asm variables from C keil off topic | 01/01/70 00:00 |



