Skip to content
Solved Examples · Example 4

Q.Write a program to add two 8-bit numbers. The numbers are 1FH and 5EH

Karnataka PUCTextbookNumericImportance★★★★★est
17% · 19/115 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

[!TLDR]

Load 1FH into A and add 5EH; the accumulator then holds their sum, 7DH.

Concept - 8-bit addition on the 8051. All addition must involve the accumulator: the instruction form is ADD A, source, which computes A = A + source. The source may be a register, immediate data or a memory operand, but the destination is always A.

Program:

MOV A, #1FH   ; load 1FH into A
ADD A, #5EH   ; add 5EH to A

Working:

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.