First page Back Continue Last page Overview Graphics
Laboratory 2.1 : Part 3
Backup the new ALD.s and name it ALDMod1.s
Modifying program ALDMod1.s so that it calculates the sum of the contents of the initialized bytes (var1, var2 and var3). Give the variables initial values of $11, $3c, and $2a. Use the assembler directive dc.b to reserve each of these locations. Store the sum in memory location result. Use the ds.b directive to reserve an uninitialized byte-sized location for the result.
Replace ALD.o with ALDMod1.o in linker command file (68HCLKF.LKF)
Again place a NOP instruction as the last executable statement so you can clearly see where the program ends when debugging.
Assemble and then step through the program using the Zap debugger. What is the sum of the values of the three variables in hexadecimal? ______ Verify that the answer is properly stored by examining the contents of memory location result after running the program. Double click on a variable and select Monitor to monitor the contents of variables.