MYPORT EQU 0x200000 MOV R0,#2_01010000 ;R0=0x50 (01010000 in binary) LDR R1,=MYPORT ;R1 = port address OVER LDRB R2,[R1] ;get a byte from PORT and place it in R2 TST R2,R0 ;are bits 4 and 6 LOW? BNE OVER ;keep checking ADD R4,R4,#1