This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:comporg:spring2025:projects:dapx [2025/03/09 15:42] – [debugmemory function] tkastne1 | notes:comporg:spring2025:projects:dapx [2025/03/20 03:15] (current) – [Debug Registers] tkastne1 | ||
---|---|---|---|
Line 135: | Line 135: | ||
< | < | ||
- | mov | + | mov |
- | | + | and |
</ | </ | ||
Line 144: | Line 144: | ||
< | < | ||
- | mov | + | mov |
- | | + | imul R2, |
- | mov | + | mov |
- | | + | shl |
- | and | + | and |
</ | </ | ||
====Shifting==== | ====Shifting==== | ||
Line 228: | Line 228: | ||
======Debug Registers====== | ======Debug Registers====== | ||
- | ===Printing out R:=== | + | ===Printing out R#:=== |
+ | The simplest way to print out the register label would be to separate the singe and double digit registers into to groups | ||
+ | |||
+ | For registers 0-9 we print ' | ||
+ | |||
+ | For registers 10-13 we print ' | ||
===Printing registers=== | ===Printing registers=== | ||
+ | |||
+ | Since we want to preserve all of the register values, we push them onto the stack at the start | ||
+ | |||
+ | Using this we can get the value for each register to print out | ||
+ | |||
+ | Assuming we push the register 0-13 directly after saving the base pointer we can do the following to get R0: | ||
+ | |||
+ | < | ||
+ | mov | ||
+ | push R0 | ||
+ | mov | ||
+ | push R0 | ||
+ | mov | ||
+ | push R0 | ||
+ | call _debug | ||
+ | </ | ||
+ | |||
+ | This process can be repeated for all registers | ||
===Debugging our debugregs Subroutine=== | ===Debugging our debugregs Subroutine=== |