(8051) Check if a single bit is set

前端 未结 2 411
时光取名叫无心
时光取名叫无心 2021-01-23 04:14

I\'m writing a program for a 8051 microcontroller. In the first part of the program I do some calculations and based on the result, I either light the LED or not (using CL

2条回答
  •  情深已故
    2021-01-23 05:11

    Some of the special function registers are also bit addressable. I believe its all the ones ending in 0 or 8. Don't have a reference in front of me but you can do something like setb r0.1. That way if you need the carry for something you dont have to worry about pushing it and using up space on your stack.

提交回复
热议问题