
	org 49152		; B must have any n*4, only preset register from startaddress in RAM!

; Due to looping and test on D ANY value is allowed to start
start	dec d			; test next Y-coordinate
xloop	ld c,13			; set 13 stars to print
	jr z,start		; test end of line and end of screen
	ld  a,d
	sub 5			; shift 5 positions for test
	cp c			; test display
	jr nc,xloop+1		; only display when C is larger

d2 	ld a,22			; print a star and rotate display
	rst 16
	ld a,d			; AT D,18-C;"*"
	rst 16
	ld a,18			; mirror X-coordinates
	sub c
	ld c,d			; swap X and Y coordinates
	ld d,a			; after 4 swaps values back to start
	rst 16
	ld a,"*"
	rst 16			; the "*"
	djnz d2			; slow loop, but shorter
	jr xloop+1		; after display opcode 13 is executed (DEC C)

; coordinates swap table
; start	X	Y
; swap1	Y	18-X
; swap2	18-X	18-Y
; swap3	18-Y	18-(18-X) = X
; swap4	X	18-(18-Y) = Y		