• 2022-05-28
    下列程序段中,当P1=0xfd时,P2=()#include<;reg51.h>;char state;state=P1; // 读入P1口的状态,送入statestate=state&0x03; // 屏蔽P1口的高6位switch (state) // 判P1口低2位开关状态{ case 0: P2=0x01;// P1.1、P1.0=00,点亮P2.0脚LEDcase 1: P2=0x02;// P1.1、P1.0=01,点亮P2.1脚LEDcase 2: P2=0x04; break;// P1.1、P1.0=10,点亮P2.2脚LEDcase 3: P2=0x08; break;// P1.1、P1.0=11,点亮P2.3脚LED}
    A: 0x01
    B: 0x02
    C: 0x04
    D: 0x08