This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What does "CLR 0xF8.4" mean ?

Dear all,
I have one question about below de-assembly result...

C:0x0CE7    C2FC    CLR    0xF8.4


I guess machine code "C2" means instruction "CLR",then what does 0xF8.4 mean ?

What I know is: if we see

C:0x0CE7    C23B    CLR    bVarA(0x27.3)


then we can get:
1. C2 means instruction CLR
2. 3B => 0x3B = 59d. 59d/8 = 7...3 Thus according to 8051 spec this means we try to clear bit variable located at 0x27h bit3
[REF] "In fact, the 128 bit variables occupy the 16 bytes of Internal RAM from 20h through 2Fh"(see www.8052.com/tutmemor.phtml Memory)

if we use 0xFC then we got: 0xFC = 252d. 252/8 = 0x1F...4 Thus I guess we try to clear bit variable loated at 0x3F bit4 !

But bit-addressable memory occupy 0x20~0x2F and thus I am confused that what does 0xF8.4 mean ?

Thanks in advance...

  • your clearing bit 4 in SFR register 0xF8

    Always yo're freind.

    Zeusti.

  • bit area 0x00 - 0x7F is mapped to address bytes 0x20 - 0x2F (16bytes x 8bits/byte = 128bits)
    bit area 0x80 - 0xFF is mapped to address byte SFRs at direct addresses
    0x80, 0x88, 0x90, 0x98, 0xA0, 0xA8, 0xB0, 0xB8, 0xC0, 0xC8, 0xD0, 0xD8, 0xE0, 0xE8, 0xF0, 0xF8
    for the so-called bit addressable SFRs. In this region the high order 5 bits point to the specific SFR and the lower 3 bits selects the specific bit in that register.

    eg:
    bit 0x20 is located at address byte 0x20 bit no 0 or 0x20.0
    bit 0x21 is located at address byte 0x20 bit no 1 or 0x20.1

    SFR region bit addressable registers
    bit 0x80 is located at address byte 0x80 bit no 0 or 0x80.0 or P0.0
    bit 0x81 is located at address byte 0x80 bit no 1 or 0x80.1 or P0.1

    this is just bit math on the 8051 acrhitecture.

    So the assembly code
    CLR 0xF8.4
    means to clear the bit in SFR region at 0xF8 byte address bit no 4 or 0xF8.4 (=0xFC)