User Tools

Site Tools


notes:comporg:spring2024: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:spring2024:projects:dapx [2024/03/24 19:39] – [Debug Registers] wgates1notes:comporg:spring2024:projects:dapx [2024/03/24 19:49] (current) – [Debug Registers] wgates1
Line 435: Line 435:
  
 ===Printing registers=== ===Printing registers===
 +
 +===Debugging our debugregs Subroutine===
 +Trying to get your debugregs to have the correct output is challenging, but by far the best way to see if you have the correct output is by tossing in some random values into each register that you display to see if you have the correct output. Here is an example of that.
 +
 +<code asm>
 +mov R0, 0x00000000
 +mov R1, 0x00000001
 +mov R2, 0x00000002
 +mov R3, 0x00000003
 +mov R4, 0x00000004
 +mov R5, 0x00000005
 +</code>
 +
 +You repeat this above process for registers from 0 to 13. It is important to note that you do this right before you call the subroutine so the values that you just put in don't get wiped out from your previous ASM code. 
 +
 +
 +
 ===Calling debugregs=== ===Calling debugregs===
 As we have worked on these dap projects, the process of calling such debug subroutines has become simpler. With dap0, we had to have the following in our program:  As we have worked on these dap projects, the process of calling such debug subroutines has become simpler. With dap0, we had to have the following in our program: 
-<code C>+<code asm>
        mov  TMP, R8        mov  TMP, R8
        push TMP        push TMP
-        
        mov  TMP, 100        mov  TMP, 100
        push TMP        push TMP
-        
        mov  TMP, 200        mov  TMP, 200
        push TMP        push TMP
-        
        call          _debug        call          _debug
  </code>  </code>
 +Then later after the hlt, you'll always have the %include "debug.s" for all the dap projects.
 +
 +Concerning dap2, we have drastically simplified the process of debugging. All that is need is just one line, Not accounting for the include line. Put the following to use your debug registers subroutine:
  
 +<code asm>
 +call _debugregs
 +</code>
notes/comporg/spring2024/projects/dapx.1711323576.txt.gz · Last modified: 2024/03/24 19:39 by wgates1