Manual - Lab 2
Manual - Lab 2
Lab 2 Manual
1. Equipment
2. Learning Objective
This lab provides exercises that would allow the student to be familiar with the Instruction Set
Architecture of the MSP430. Exercises will cover topics in number representation, memory
storage organisation, machine code and the status flags of the MSP430 CPU.
IMPORTANT
This lab has been intentionally designed to increase the amount of independent
actions/thought required as the tasks progresses. Thus, step-by-step instructions will become
less detailed as the tasks progresses.
3. References
For this lab, you will require the following documents that can be downloaded from the
ICT1003 LMS website under the Content Browser Resources/Reference Manuals tab:
i) MSP430 Quick Reference Guide
ii) MSP430 Instruction Set Summary
The above documents will provide a good overview on the various assembly instructions
supported by the MSP430 and their machine code representation. You will also require the
question sheet from Tutorial 2 and your solutions to these questions as reference.
This lab session will be conducted over 2 hours. It assumes that you have already
successfully completed Lab 1.
For this lab, students should ideally explore independently but may also interact with their
fellow classmates to explore and have fun together.
Page 1 of 6
ICT1003 (Lab2) V1.1, Steven Wong, 2016
THERE IS A QUIZ for this lab. This 10-min lab quiz that will be
conducted 15-mins before the lab session ends.
The exercises in this lab session can be divided into the following parts:
(a) Number representation in the MSP430
(b) Data storage and memory organisation
(c) Machine code translation
(d) CPU status flags
5. The Exercises
Page 2 of 6
ICT1003 (Lab2) V1.1, Steven Wong, 2016
Click on “Core Registers” to view the contents of R0 – R15 (remember that R0 =PC,
etc)
TASK 2
Single step through the programme and validate your answers
obtained in Section 5.1.2.
If you got some answers wrong, figure out why.
Figure 5.1.3a
Figure 5.1.3b
Page 3 of 6
ICT1003 (Lab2) V1.1, Steven Wong, 2016
5.2. Data Storage and memory organisation
Address Contents
mov.b #01h, &2400h H’002405
mov.b #0Ah, &2401h H’002404
mov.w #1234h, &2402h H’002403
H’002402
mov.w #5678h, &2403h
H’002401
mov.w #9ABCh, &2404h
H’002400
TASK 4
Validate your memory-map in Section 5.2.2 using code composer!!!
Search for
address 0x2400
Figure 5.2.3a
Page 4 of 6
ICT1003 (Lab2) V1.1, Steven Wong, 2016
5.3. Machine Code Translation
Figure 5.3.2a
TASK 6
Validate your answers obtained in Section 5.3.1.
Page 5 of 6
ICT1003 (Lab2) V1.1, Steven Wong, 2016
5.4. CPU status flags
Figure 5.4.1
TASK 7
Validate your answers for Tutorial 2 Question Q1a – Q1h
TASK 8
Page 6 of 6
ICT1003 (Lab2) V1.1, Steven Wong, 2016