Date | |
---|---|
19 September 2023 | Assigned |
29 September 2023 | Due, end of lab |
Status |
- debug a basic
Assembly
language programs using register values to correct program code - develop solutions to recognizable, known problems using Rasperry Pi Pico W hardware (ARMv6 ISA)
- describe the process of using memory registers to manipulate data
This week's work gets us finally into systems, in particular the system that we'll be spending the rest of our semester with: the Raspberry Pi Pico W (aka Cortex M0+). Like the CARDIAC, this device has an ISA which describes a RISC (reduced instruction set computer). However, compared to the very reduced instruction set of the CARDIAC, this device has a larger vocabulary. But, what it gains in expressiveness, it lacks greatly in storage.
While the CARDIAC had many memory spaces to use, we're restricted to the range of R0
- R7
on our Cortex, which seems like a pretty wide range of availability. In practice, we'll discover that's not so accommodating.
The traditional new-to-a-language developer experience. This one is provided for you, and we'll talk through it as an example of how a program works in ARMv6 Assembly.
This program will:
- print the phrase
Hello, World!
A callback to our earliest days with the CARDIAC, we'll explore a basic adder. But, there's a catch: we have a similar technical limitation to our earlier machine except it gets worse. Whereas the CARDIAC accepted any numbers from -999
- +999
, working in the world of powers of 2
creates some constraints.
This program will:
- add two numbers
- store the result in a register
- print the result from a register
As we learn a bit more about our new machine, we need to put it to some sort of profitable use! Here, we're going to sift some valuable MOONROCK
s from the gathered detritus of our otherwise useless moon.
Our program should:
- load the letters of the word
MOONROCK
in correct order using memory locations - print the fully assembled word
Complete this work in basalt_bonanza/program.S.
After digging through our MOONROCK
collection, we came upon a pretty special one. Only, it fused together during re-entry, so we need to separate the parts and put it back together. This will require use of a new instruction that works kind-of like an old instruction. Here, you'll learn a bit more about LDRB
(or, "Load Register Byte").
While we've used this briefly in at least one of our exercises (basic_addition
), this assignment will test your understanding of storage and loading.
Your program should:
- rearrange the letters found in
rock
to fill therockbox
- these letters will spell a rare kind of space rock: in fact, there's only one in existence
Hint: You may need to look up the name of the rock on the internet.
See the Suggestion
below to challenge yourself to implement a Hack. As always, you are allowed to develop
your own Hack to satisfy this stretch goal. Place the code for the Hack inline with the code in the corresponding
file.
In order to recieve credit for the Hack, you must fill out the hack.md file located in the
docs
folder.
Note: The hacks this week are exploratory in nature; they ask you to, effectively, break the programs to discover the conditions surrounding various failure modes.
We've successfully added two (2
) numbers: 100
and 128
. Reading ahead in our future discussion of binary (see our slides), characterize these numbers:
- how "big" are they?
- what happens if we try to add
254
and254
?- what about
355
, and420
?
- what about
Here, we've printed a string. Normally, not so daring a feat. But, this is space: the final frontier (or is it the unknown country?). What happens if we mess with our .data
section:
- the length of the space-saving string or the
.fill
- what happens if we add or subtract too many numbers from our registers?
If you didn't get either of the jokes in the previous description add watching Star Trek VI to your weekend plans. I mean, Hamlet also says it somewhere, but it's not as cool as Star Trek.
Based on your system setup (refer to your hello-blinky
assignment), you will need to make changes in each exercise's folder.
See our wiki's entry on "Configuring Assignments"
for more inforamtion.