Clear
| Instruction | CLR A |
|---|---|
| Function | Clear Accumulator |
| Bytes | 1 |
| Cycles | 1 |
| Encoding | 1 1 1 0 0 1 0 0 |
| Operation | A = 0 |
| Description | CLR A clears the Accumulator (all bits set to 0). |
| Flags Affected | C AC F0 RS1 RS0 OV P |
| Example | The Accumulator contains 5CH (01011100B). The following instruction, CLR A leaves the Accumulator set to 00H (00000000B). |
| Bytes: Number of bytes required to encode the instruction. Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051. Encoding: Lists the byte encoding for the instruction. Operation: Lists, step-by-step, the operations performed by the instruction. Flags Affected: are highlighted in Bold | |
| Instruction | CLR bit |
|---|---|
| Function | Clear bit |
| Bytes | 2 |
| Cycles | 1 |
| Encoding | 1 1 0 0 0 0 1 0 bit_address |
| Operation | (bit) = 0 |
| Description | CLR bit clears the indicated bit (reset to 0). No other flags are affected. CLR can operate on the carry flag or any directly addressable bit. |
| Flags Affected | C AC F0 RS1 RS0 OV P |
| Example | Port 1 has previously been written with 5DH (01011101B). The following instruction, CLR P1.2 leaves the port set to 59H (01011001B). CLR 01h |
| Bytes: Number of bytes required to encode the instruction. Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051. Encoding: Lists the byte encoding for the instruction. Operation: Lists, step-by-step, the operations performed by the instruction. Flags Affected: are highlighted in Bold | |
| Instruction | CLR C |
|---|---|
| Bytes | 1 |
| Cycles | 1 |
| Encoding | 1 1 0 0 0 0 1 1 |
| Operation | C = 0 |
| Flags Affected | C AC F0 RS1 RS0 OV P |
| Example | CLR C |
| Bytes: Number of bytes required to encode the instruction. Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051. Encoding: Lists the byte encoding for the instruction. Operation: Lists, step-by-step, the operations performed by the instruction. Flags Affected: are highlighted in Bold | |
Related topics:
8051 Logical Operation Instructions | 8051 ANL Instruction | 8051 ORL Instruction | 8051 XRL Instruction | 8051 CPL Instruction | 8051 RL Instruction | 8051 RR Instruction | 8051 RLC Instruction | 8051 RRC Instruction | 8051 SWAP Instruction
List of topics: 8051
The 8051 CLR instruction illustrates how simple assembly instructions perform essential operations at the register and bit levels. The example shows how CLR A resets every bit in the accumulator to zero, while CLR bit clears a specified bit without affecting other bits. The comparison of instruction bytes, execution cycles, encoding, and affected flags is useful for understanding how 8051 instructions are represented and executed.
ReplyDeleteExploring IEEE Projects for ECE can help students apply microcontroller concepts such as register manipulation, bit-level operations, and instruction execution to embedded systems projects. These fundamentals are important when developing low-level control logic and interfacing with hardware.
Students can also explore Domains in ECE Engineering to identify application areas where microcontroller programming and digital electronics concepts are useful. Practising individual instructions and observing their effects on registers and flags provides a solid foundation for understanding more complex assembly programs.
ReplyDelete