User Tools

Site Tools


notes:comporg:spring2025:projects:dapx

This is an old revision of the document!


DAPX

stack operations

PUSH

POP

referencing relative to SP/BP

Preserving our Registers

Preserving our Textures

bitwise operations

OR

AND

NOT

NAND

NOR

XOR

XNOR

SHIFT

Shift Right

Shift Left

pseudocode

debug

SET DATA
SET X
SET Y
SET POSITION TO LEFTMOST NIBBLE
UNTIL WE HAVE DISPLAYED ALL NIBBLES:
    OBTAIN NIBBLE AT POSITION
	SHOULD NIBBLE BE GREATER THAN OR EQUAL TO TEN:
	    ADD SEVEN TO ITS VALUE
	ADD FORTY EIGHT TO ITS VALUE
	DISPLAY NIBBLE AT X, Y
	INCREMENT X ACCORDINGLY
	ADJUST POSITION TO NEXT NIBBLE TO THE RIGHT
REPEAT

In your code you will want to put

%include "debug.s"

at the very end of your code. THIS IS VERY IMPORTANT. If you include debug.s at the top of your code, the hexadecimal values may print but the remainder of the program in which you called __debug may not function as expected.

debug function

Formatting

Beyond getting your values to be displayed you also need to include “0x” to signify that the number you are displaying in hexadecimal. It is important to know that the 0 and x have a number assigned to them in ASCII code which are as follows:

ASCII code for 0 --> decimal 48, hexadecimal 0x30
ASCII code for x --> 120
ASCII code for [ --> 92
ASCII code for ] --> 93
ASCII code for : --> 58

Knowing this, we can now select where we want to display these values by simply calling the following:

    mov R0, 48 ; ASCII code for 0 is moved into RO
    out  GPU_SelectedRegion, R0 ; Selecting region
    out  GPU_DrawingPointX, R2  ; Providing X axis location
    out  GPU_DrawingPointY, R3  ; Providing Y axis location
    out  GPU_Command, GPUCommand_DrawRegion ; Displaying
    iadd R2, 9 ; Spacing logic

Getting your value

Masking

Shifting

To ASCII

debugmemory function

Displaying

debugregister function

dapX imagery

dap0

dap1

Debug Registers

Printing out R:

Printing registers

Debugging our debugregs Subroutine

Calling debugregs

notes/comporg/spring2025/projects/dapx.1740675135.txt.gz · Last modified: 2025/02/27 16:52 by wedge