Back to the 2020 paper

Module 3: Instruction Set and Programming

20202m

Which among the single operand instructions complements the accumulator without affecting any of the flags?
(i) CLR
(ii) SETB
(iii) CPL
(iv) All of the above

Worked SolutionAI Assisted

Answer: (iii) CPL

Explanation: CPL A (Complement Accumulator) does A = ~A (ones complement) and affects no flags. CLR A clears A to 0 and also no flags but not complement. SETB sets a bit flag. Complement operations in 8051 (CPL A, CPL C, CPL bit) are defined to leave PSW flags unchanged (except CPL C complements Carry). For single-operand complement of accumulator without flag change, CPL A is correct.

Similar questions

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.