0
LXI H  ; "Load HL with 4000H"
MVI M  ; "Store 32H in memory location pointed by HL register pair (4000H)"
HLT    ; "Terminate program execution"

Its an 8085 microprocessor code, intended to store 8 data in memory.

However when I run the code, I come across a Error.

Error : line 1 : Opcode needs an User Argument. (this is the assembler message).

Can someone show me the mistake I am making and help me through.

I am using GNUSim8085.

Pragyaditya Das
  • 1,648
  • 6
  • 25
  • 44

1 Answers1

2

You should typically start by consulting an instruction set reference when you get such errors. Searching for "8085 LXI" yielded:

Load register pair immediate
LXI Reg. pair, 16-bit data The instruction loads 16-bit data in the register pair designated in the operand.
Example: LXI H, 2034H or LXI H, XYZ

So based on your comment "; "Load HL with 4000H" I'm guessing that you meant to write:

LXI H, 4000H
Michael
  • 57,169
  • 9
  • 80
  • 125