Skip to content
Question Bank (3 marks) · Q5

Q.Write ALP to load 15H into R2.

Karnataka PUCTextbookLong· 3mImportance★★★★★est
24% · 28/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]

Use the immediate MOV instruction MOV R2, #15H, framed by the ORG and END directives, to load 15H into register R2.

To place a fixed number directly into a register, the 8051 uses the immediate addressing mode. In this mode the source of the data is made part of the opcode, so the value is immediately available in the instruction itself. The mnemonic for immediate data is the pound/hash sign (#), so the immediate value must be preceded by #. Writing #15H tells the assembler that 15H (hexadecimal, equal to 21 in decimal) is a constant, not an address.

A complete assembly language program also needs directives for the assembler: ORG tells the assembler where to place the code in memory (here location 0), and END marks the end of the source code.

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.