J
J
Jesoxxx2020-06-03 12:36:00
assembler
Jesoxxx, 2020-06-03 12:36:00

How to determine offset in Assembler?

The command CMP R5, 1000 is given, which is recorded in the memory cell at address 500.
1000 is the address (A), but only relative. The number system is octal. What is the offset (X).
Processor K1801VM2.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2020-06-03
@jcmvbkbc

1000 is an address (A), but only relative. What is the offset (X).

Based on this microprocessor's instruction table and example #6 on page 10, the offset must be equal to the difference between the target address and the address of the next instruction. Those. X = 1000 - 504, depending on your number system. 504 because 2 bytes are occupied by the command (which will look like 020567) and another 2 bytes are the index word, i.e. x.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question