 **************************************************************************
;
; Filename : DEBUG.ASM
; --------------------
;
; (c) 1993 by Thomas Lehmann
;
;
; Jackophone V5.00
;
;
; Debugger Funktionen
;
;
;**************************************************************************

MODUL_START	set	*	; Größe des Moduls berechnen



; =========================================================================
;
; Funktion	: Speicher Dump auf Console ausgeben
;
; Eingang	: Accu == Anzahl Zeichen im Cmd-Buffer
;
; Ausgang	: -------
;
; Register	: 
;
; (c) by Thomas Lehmann April 1993
;
; =========================================================================

dump_out	ldx #$10	Anzahl Zeilen
	cmp #3		wurde Adr. eingegeben
	bcc dump_line	nein

	lda cmd_buff+3	high Adr. aus Cmd. Buffer ermitteln
	and #$0f
	tay
	lda cmd_buff+2
	and #$0f
	jsr merge_val
	sta dump_adr+1

	lda cmd_buff+5	low Adr. aus Cmd. Buffer ermitteln
	and #$0f
	tay
	lda cmd_buff+4
	and #$0f
	jsr merge_val
	sta dump_adr


dump_line	jsr con_newline	Dump Adresse ausgeben
	lda dump_adr+1
	jsr con_puthex
	lda dump_adr
	jsr con_puthex
	jsr con_space
	jsr con_space


	ldy #0
dump_loop	lda (dump_adr),y	Hex Dump
	jsr con_puthex
	jsr con_space
	iny
	cpy #$10
	bcc dump_loop

	jsr con_space
	jsr con_space
	ldy #0
dump_loop1	lda (dump_adr),y	ASCII Dump 
	cmp #32
	bcc wrong
	cmp #$80
	bcc ok

wrong	lda #"."

ok	jsr con_putch
	iny
	cpy #$10
	bcc dump_loop1

	?add16 dump_adr,$10
	dex		; alle Zeilen ausgegeben ?
	bne dump_line	nein, weiter ausgeben

	rts




; --------------------------------------------------------------------------

HLP	set	*
_DEBUG	equ	HLP-MODUL_START		; Größe des Moduls


