1

Given the following memory contents

Address    | Contents
08A        | 010FA210FB
08B        | 010FA0F08D
08C        | 020FA210FB

The assembly code is:

Assembly Code

My question is, how are the contents translated into the assembly code. What separates the opcode from the operands in the memory contents here?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 1
    I'm not familiar with ias, but normally the opcode is the first byte of each instruction. The CPU (and disassembler software) know not to try to interpret the rest of the bytes of an instruction as opcodes, because they know how long an instruction is. – Peter Cordes Sep 21 '16 at 02:16
  • 1
    You need to read up on assemblers. In the days of IAS, they were called auto-coders. – Mick Sep 21 '16 at 02:21

2 Answers2

2

The instructions are stored two at a time in blocks of 10 bytes. The first two bytes of each set of five are the opcode in hex; so for example on the first set of contents, 010FA and 210FB correspond to 2 different instructions. The first two bytes in binary are the opcode, so for the first instruction, 00000001 corresponds to LOAD, and then it loads the hex value from the rest of the instruction, in this case 0FA.

Sam B
  • 21
  • 2
0

A visual aid to Sam B's answer

The instructions are stored two at a time in blocks of 10 bytes. The first two bytes of each set of five are the opcode in hex; IAS Memory Format

IAS Instruction Set table IAS Instruction Set

Reference: Computer Organization and Architecture 10th edition (William Stallings)

Noman
  • 124
  • 2
  • 9