_asmentry:

vic_border	= $d020
vic_bg0		= $d021
vic_ctrl1	= $d011
vic_raster	= $d012
vic_ctrl2	= $d016
vic_addr	= $d018

.code

loop1:
	lda	vic_ctrl1
	bpl	loop1

	ldx	scrx
	dex
	bpl	@ok

	lda	vic_addr
	eor	#16
	sta	vic_addr
	ldx	#7

@ok:	stx	scrx
	lda	vic_ctrl2
	and	#$f8
	ora	scrx
	sta	vic_ctrl2

loop2:
	lda	vic_ctrl1
	bmi	loop2

	jmp	loop1
	rts

scrx:	.byte	7

.export _asmentry
