Debugging

z80 » Intermediate

Break Points

#define BREAK	call _getkey / call _clrScrn / jp _JForceCmdNoChar
_JForceCmdNoChar	=$409c	;exit to ti-os even
				; if we still have some
				; pushes/pops on the
				; stack
				;restore stack
				;don't print "Done"
#include "ti86asm.inc"
.org _asm_exec_ram
	call _clrScrn
	call _FlushAllMenus	;get rid of all active menus
	call routine_being_tested
	jp _clrScrn		;clear screen and ret

routine_being_tested:
	call get_keypress_input	;get key input [up] [right]...
	call move_player	;move player sprite
	BREAK			;pause for key press
				; and exit no matter what
				; so we can see how things
				; are up to this point
	jp animate_monsters	;update and move all
				; "monsters" in game
.end


More from z80 » Intermediate
All the Flags // Debugging // Down-Left Bug // _GetKey Codes // Logical Operators // Memory, ROM, RAM, and Safe Areas // Miscellaneous Instructions // PC and SP // Random Numbers // TI's ROM Calls // Restart Commands // Simulated 16-bit Addition // The Stack // Tables and Arrays // Text Display // Variables