[A83] ugly symbols with an directory list


[Prev][Next][Index][Thread]

[A83] ugly symbols with an directory list



I have a program like below from ASMGuru. Anyway, nothing wrong with it,
except it displays a # and a ! and then the programs. How can I modify the
program in such a way that those 2 symbols are not displayd any more? I
thought to dec HL after LD HL, (PROGPTR), but that didn't work.

...standard start...

kEnter .EQU  05h			; Enter key
kQuit  .EQU  40h			; Quit key


	LD	HL, (PROGPTR)		; get offset to program/list table
	LD	A, 4			; four programs/keypress
main_loop:
	LD	(count), A		; store latest update of count

	LD	A, (HL)			; get type of data
	AND	01Fh			; mask out bits 0-4

	CP	05H			; program
	JR	Z, program
	CP	06H			; protected program
	JR	Z, program
	CP	01H			; real list
	JR	Z, list
	CP	0DH			; complex list

JR	Z, list
	JR	the_end			; unknown/end of list
program:
	DEC	HL	; move back 3 bytes to length-of-name
	DEC	HL
	DEC	HL
	CP	06h	; display '*' for protected programs
	JR	Z, protected
	LD	A, ' '
	JR	go_on
protected:
	LD	A, '*'
go_on:
	CALL	_PUTC
	LD	B, (HL)		; load length-of-string
program_loop:
	DEC	HL		; move backwards to next char
	LD	A, (HL)		; load char
   	CALL    _PUTC		; display char
	DJNZ	program_loop
	DEC	HL		; move backwards to next item

    	CALL    _NEWLINE
	LD	A, (count)	; have we displayed four programs?
	DEC	A
	JR	NZ, main_loop
key_loop:
	PUSH	HL
    	CALL    _GETKEY	; wait for key
	POP	HL
    	CP	kQuit
	JR	Z, the_end
    	CP      kEnter		; enter key?
    	JR      NZ, key_loop	; no

	LD	A, 4		; four programs/keypress
	JR	main_loop
list:
	DEC	HL		; move back 3 bytes to length-of-name
	DEC	HL
	DEC	HL
	LD	B, (HL)		; load length-of-string
list_loop:

DEC	HL		; move backwards to next char
	DJNZ	list_loop
	DEC	HL		; move backwards to next item

	LD	A, (count)	; no change really, load A
	JP	main_loop

the_end:
	RET
count:
	.DB		00h
.END





Follow-Ups: