Instruction PC LDAA #53 LDAB #SEB LDAB # 1 0 ADDA #$1 ADDA #1 ABA LDD #$1000 LDD
ID: 3746619 • Letter: I
Question
Instruction PC LDAA #53 LDAB #SEB LDAB # 1 0 ADDA #$1 ADDA #1 ABA LDD #$1000 LDD #65535 ADDD #1 Make sure you understand what each instruction does and why the values in the registers are they are. If you like, close the debugger window, change some of the values in the program, and repeat the assembling and simulating process. Answer the following questions: How many bits wide is register D? How is it related to the other registers? What is the meaning of the number in the PC register? What do you expect the first value here to be?Explanation / Answer
; Load values into registers: LDAA #%11111111 LDAA #$3 LDAB #$EB LDAB #10 ;
Add some values: ADDA #$1 ADDA #1 ABA ;
Use register D :LDD #$1000 LDD #65535 ADDD #1
Note:#$ Immediate value, in hex #% Immediate value, in binary # Immediate value, in decimal
The wide of D Register is 2 power 5
In this program, we are loading values into registers A, B, and D (more on the D register later) and adding values. The # symbol indicates an immediate value; it tells the CodeWarrior assembler to use the number itself as the value, not as an address pointing to the value. The other symbols indicate the base of the number, allowing you to enter numbers in hex, binary, or decimal.