The first thing you need to do is to turn on both breakpoints and debug messages inside of NO$GMB. To do this, open NO$GMB (a game does not need to be loaded) and then select Options in the top bar, then select Debug eXception Setup option. You will see the below window (mostly grayed out). Just select the following checkboxes to turn enable them:

  1. Enable User Settings
  2. Halt on 40h (ld b, b) (inside of “Source Code Breakpoints” area)
  3. Write to Message Window (inside of “Debug Messages 52h (ld d, d)” area)

NO$GMB debug messages and breakpoints settings window

Below is the MACRO for the RGBDS assembler for being able to print debug messages to teh NO$GMB Game Boy emulator/debugger.

; Prints a message to the no$gmb / bgb debugger
; Accepts a string as input, see emulator doc for support
	ld  d, d
	jr .end\@
	DB $64, $64, $00, $00
	DB \1

Below is an example of how you can print a message and then trigger a breakpoint after the message prints.

DBGMSG "This will print to a debug window"
ld b, b			; Triggers a breakpoint