Question: 2. Hand assemble the following program: You must indicate the low and high byte at each program memory location using the correct endianess: .ORG 0
2. Hand assemble the following program: You must indicate the low and high byte at each program memory location using the correct endianess:
.ORG 0 ;burn into ROM starting at 0
LDI ZL, lo8(MYDATA<<1) ;R30 = 00 low-byte addr
LDI ZH, hi8(MYDATA<<1) ;R31 = 0A, high-byte addr
LDI XL, lo8(0x140) ;R26 = 40, low-byte RAM address
LDI XH, hi8(0x140) ;R27 = 1, high-byte RAM address
AGAIN:
LPM R16, Z+ ;read the table, then increment Z
CPI R16,0 ;compare R16 with 0
BREQ END ;exit if end of string
ST X+, R16 ;store R16 in RAM and inc X
RJMP AGAIN
END: RJMP END
.ORG 0x500 ;data burned starting at 0x500
MYDATA: .byte "The Promise of World Peace",0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
