User Tools

Site Tools


notes:comporg:spring2025:projects:dapx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:comporg:spring2025:projects:dapx [2025/03/09 15:44] – [Masking] Made asm code format consistent tkastne1notes:comporg:spring2025:projects:dapx [2025/03/20 03:15] (current) – [Debug Registers] tkastne1
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 'R' then the register number then ':' 
 + 
 +For registers 10-13 we print 'R' & '1' then the register number minus 10 then ':'
  
 ===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:
 +
 +<code>
 +mov   R0,   [BP - 1] ; Get the value of R0
 +push  R0
 +mov   R0,  Xpos
 +push  R0
 +mov   R0,  Ypos
 +push  R0
 +call  _debug         ; Print out the value of R0 wherever we want
 +</code>
 +
 +This process can be repeated for all registers
  
 ===Debugging our debugregs Subroutine=== ===Debugging our debugregs Subroutine===
notes/comporg/spring2025/projects/dapx.1741535057.txt.gz · Last modified: 2025/03/09 15:44 by tkastne1