1

The problem statement is :

Load a data byte A2H in memory location 8150H and 76H in the accumulator. Add the contents of the memory location to the contents of the accumulator.

The opcode statement that I used for execution of the problem in the 8085 micro processor based microcomputer kit, is :

  • 3E:76:26:81:2E:50:36:A2:86:CF

which is :

  • MVI A,76H
  • MVI H,81H
  • MVI L,50H
  • MVI M,A2H
  • ADD M
  • RST 1

what's wrong in the problem statement? while examining the accumulator, after executing, it isn't showing the desired result.

Arkistarvh Kltzuonstev
  • 6,824
  • 7
  • 26
  • 56
  • 2
    Questions seeking debugging help ("why isn't this code working?") must include the **desired behavior**, a **specific** problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a [mcve]. – too honest for this site Aug 27 '15 at 15:46
  • I never worked with 8085, but from a brief google you will need a `#` in front of immediate operands. Such as `MVI M, #A2H` and the preceding ones. Operands without the `#` are usually treated as memory addresses. Even so, some assemblers require a `0` (or other mark) in front of a hex value to distinguish it from a *label*. For example is `A2H` a value or a label? The value `0A2H` is a value, as labels may not start with a numeric character. – Weather Vane Aug 27 '15 at 23:59

1 Answers1

0

Pretty much a shot in the dark, but you could try this. Two alterations. Immediate values need a #, and hexadecimal values beginning with a letter need a 0 prefix to distinguish from labels.

MVI A,#76H
MVI H,#81H
MVI L,#50H
MVI M,#0A2H
ADD M
RST 1
Weather Vane
  • 33,872
  • 7
  • 36
  • 56