What is that row like? 这一排开关像什么?
A building's breaker box gives each room its own switch. This row does the same, one slot per job. 楼道里的配电箱,一格开关管一个房间。芯片上这一排也一样,一格管一件事。
It's like…就像……
A dorm's breaker box: a row of small switches, one per room. If one room is dark, you flip that room's slot. 宿舍楼的配电箱:一排小开关,一格只管一个房间。谁的灯不亮,就拨谁那一格。
Which bit drives which pin? 哪一位管哪根引脚?
Bit numbers run right to left; the rightmost slot is bit 0, the ones place. Bit 5 drives pin 5. 位号从右往左数,最右边那一格是第 0 位,也就是个位。第 5 位管的就是 5 号引脚。
Changing one bit takes three steps 只改一位,要走三步
Read the current value 读出当前值
Change only my bit 只改我要的那一位
Write the whole row back 整排写回去
Why not just write one number? 为什么不能直接写一个数?
Writing one number flips all 32 switches at once. Slots other code depends on quietly go back to listening. 直接写一个数,等于把 32 个开关一起拨。别人正在用的那几格,会被你顺手关掉。