Compile an assembly program with gcc- In makefile.
Use the debugger to step through a program- Run the program in GDB using
gdb <executable file>
, thenstart
, thensi
to make individual steps through the program.
- Run the program in GDB using
Use the debugger to look at the contents of registers- When running the program in GDB, use the command
info registers
ori r
for the shorthand version. Additionally, to view specific registers, the registers can be appended to the end of the command. For example, to view registersr0
andr4
, use the commandi r r0 r4
.
- When running the program in GDB, use the command
Use the debugger to look at the contents of memory- When running the program in GDB, use the command
x <address here>
. For example, to view the memory at the address0x8000
, we can use the commandx *0x8000
. If a register is storing an address, we can usex $r<number>
to view the memory at the address in the register. If registerr0
is holding the address0x8000
, using the commandx $r0
performs the same action as the previous example. Different amounts of data can be displayed in different forms by appending/<number><type>
to thex
command.
- When running the program in GDB, use the command
Set a breakpoint in the debugger- When running the program in GDB, using the command
b <address here>
will set a breakpoint on that address. The commandb *0x8000
will set a breakpoint on address0x8000
. Additionally, labels can be used in place of addresses to make testing easier.
- When running the program in GDB, using the command
Output text to the console using printf- Under the
interact
label ind_prof.s
.
- Under the
Output non-text data to the console as text using printf- Under the
interact
label ind_prof.s
.
- Under the
Get input from the console using scanf- Under the
interact
label ind_prof.s
.
- Under the
Execute a system call- In root folder in
utilities.s
under theprintString
label.
- In root folder in
Create static data in memory- At the top of
d_prof.s
.
- At the top of
Create a global variable- At the top of
d_prof.s
.
- At the top of
Create a local variable on the stack- In the math section of
d_prof.s
.
- In the math section of
Do simple math (add, subtract, multiply, divide)- In the math section of
d_prof.s
.
- In the math section of
Create a loop- In
c-tasks
folder inpro.s
under thewhile
andfor
labels.
- In
Create an if statement- In
c-tasks
folder inpro.s
under thecheckAge
label.
- In
Create a function- In
c-tasks
folder inpro.s
under thePromptAge
label.
- In
Write a program that compiles with as/ld, without C libs- In
https://github.com/joshbackstein/cuddly-spoon/blob/master/makefile
.
- In
Create a struct- At the top of
pro.s
.
- At the top of
Create a while loop- In
pro.s
under thewhile
label.
- In
Create a for loop- In
pro.s
under thefor
label.
- In
Create an if/else statement- In
pro.s
under thewhile
label.
- In
Create an if/elseif/else statement- In
pro.s
under thecheckAge
label.
- In
Create a function that returns some value- In
pro.s
under thePromptAge
label.
- In
Create a function that takes an argument by value- In
pro.s
under theStoreAgeInStruct
label.
- In
Create a function that takes an argument by reference- In
pro.s
under theStoreAgeInStruct
label.
- In
Cast from byte to short- In
cast.s
under theCastByteToShort
label.
- In
Cast from short to int- In
cast.s
under theCastShortToInt
label.
- In
Do simple math with bytes- In
cast.s
under theByteMath
label.
- In
Do simple math with shorts- In
cast.s
under theShortMath
label.
- In
Do simple math with long (64-bit) integers- In
longmath.s
.
- In
Allocate heap memory using malloc- In
malloc.s
.
- In
Create a function that takes more than 4 arguments- In
addSixNumbers.s
and root folder inutilities.s
under theaddSixNumbers
label.
- In
Create a function with floating point arguments- In
https://github.com/joshbackstein/cuddly-spoon/blob/master/pixelConvert.s
under thegetLuminance
label.
- In
Use a system call to output data to the console- In root folder in
utilities.s
under theprintString
label.
- In root folder in
Use a system call to get input from the console- In
https://github.com/joshbackstein/cuddly-spoon/blob/master/cs.s
under theGetFilename
label.
- In
Write a simple program using only Thumb2 instructions- In
thumb.s
.
- In
Create a while loop using Thumb2 instructions- In
thumb.s
.
- In
Create a for loop using Thumb2 instructions- In
thumb.s
.
- In
Create an if/else statement using Thumb2 instructions- In
thumb.s
.
- In
Cast from int to long- In
intToLong.s
.
- In
Create and traverse an array- In
array.s
.
- In
Write the following utility functions (without C libs)Return whether an int is a power of 2 or not- In
powerOfTwo.s
and root folder inutilities.s
under thepowerOfTwo
label.
- In
Use a system call to output text to console- In root folder in
utilities.s
under theprintString
label.
- In root folder in
Use a system call to output an integer to console- In root folder in
utilities.s
under theprintUInt
label.
- In root folder in
Allocate heap memory using the brk system call- In root folder in
utilities.s
under thebrk
label.
- In root folder in
Allocate heap memory using the mmap system call- In
https://github.com/joshbackstein/cuddly-spoon/blob/master/cs.s
under theMapFileToMemory
label.
- In
Use system calls to output data to a file- In
https://github.com/joshbackstein/cuddly-spoon/blob/master/cs.s
under theWriteChangesToFile
label.
- In
Use system calls to get input from a file- In
https://github.com/joshbackstein/cuddly-spoon/blob/master/cs.s
under theMapFileToMemory
label.
- In
- Create a simple object using a struct and a set of functions
- Create an object type that inherits from the first
- Solve the vector code optimization problem
Optimize the power of 2 test function- In
b-tasks
folder inpowerOfTwo.s
and root folder inutilities.s
under thepowerOfTwo
label.
- In
- Create a select block
- Do something with GPIO pins (LED for example)
- Boot Pi into your own kernel that does something