We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I am looking for a way to write some C51 functions to set or clear bits stored in the 8051 external data memory. For example, the following code was done in the 8051 assembly language:
;******************************* SYSTEM_TROUBLE1 XDATA 1000H AC_FAIL ACC.0 LOW_BAT ACC.1 . . SYSTEM_TROUBLE2 XDATA 1001H TELCO1_FAIL ACC.0 TELCO2_FAIL ACC.1 . . ;******************************* . . MOV DPTR, #SYSTEM_TROUBLE1 MOVX A, @DPTR SETB AC_FAIL MOVX @DPTR . .
Opps, sorry, I picked the wrong flag to test. You are correct, bit fields are inefficient. Uhhhh. You only tested one case of bit-fields -- a 1-bit bit-field. I would make more tests before making such a broad, sweeping statement. Anyway, what is so inefficient about the code that was generated? Jon