Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Q1. A. In the following questions, tell what register and/or memory location cha

ID: 2248240 • Letter: Q

Question

Q1.

A. In the following questions, tell what register and/or memory location changes, and what the new value will be. Assume the following initial register values for all questions: A=$10, B=$12, X=$2345, Y=$4567

1) ldaa #$13

2) staa 9000

B. What is the addressing mode of an instruction that contains a constant data number within the instruction code?

C. Does the ABA instruction alter the number in the B accumulator? Please refer to the instruction set table.

D. What is the addressing mode of an instruction that does not form a memory address?

Explanation / Answer

1)LDAA #13 would load a 13 decimal (13 decimal= C hex) into register A.

LDAA Load Accumulator A

=>>>> LDAA #$13 (The “$” indicates that the 13 is a hexadecimal number.)

STAA $900 stores the A register to the memory location $009000

Store Accumulator A

B)

The CONST qualifier will place variables into flash program memory. If the keyword CONST is used before the identifier, the identifier is treated as a constant. These constants need to be initialized and cannot be changed at run-time.

The ROM qualifier puts data into flash program memory with 3 bytes per instruction space. The address used for ROM data is a true byte address not a physical address. The & operator can be used on ROM variables even though the address is logical not physical. Physical memory space is how the data is laid out on the memory in hardware, and may be spaced apart. This is in contrast to logical, or virtual memory, which is how the software views the memory.

The syntax is: const type name[size] = {values} Here's an example storing a list of numbers from 1 to 10 in program memory:

C)

ABA adds accumulator B to accumulator A i.e. A + B A

The following command "ABA" adds the contents of accumulator A to the contents of accumulator B and stores the result back in accumulator A.

D)

Immediate Addressing

No memory reference to fetch data

An immediate operand has a constant value or an expression. When an instruction with two operands uses immediate addressing, the first operand may be a register or memory location, and the second operand is an immediate constant. The first operand defines the length of the data.