;:sys36864
	;.opt oo
vic	= $d000
screen	= vic+33
frame	= vic+32
raster	= vic+18
irr	= vic+25
imr	= vic+26
zeile1	= 251
zeile2	= 252
farbe1	= 1
farbe2	= 0
irqvek	= $314
irqalt	= $ea31
control	= vic+17
cia	= $dc0d
irqend	= $ea81
getkey	= 65508
up	= "\x91"
down	= "\x11"
weg	= "\x1d"
hin	= "\x9d"
ende	= 13
breit	= 253
	*= 49152
	sei
	lda #8
	sta breit
	lda #100
	sta zeile1
	sta raster
	jsr calc
	lda control
	and #%01111111
	sta control
	lda #%10000001
	sta imr
	lda #<testirq
	ldy #>testirq
	sta irqvek
	sty irqvek+1
	cli
	jmp goon
testirq	lda irr
	sta irr
	bmi ok
	lda cia
	cli
	jmp irqalt
ok	lda raster
	cmp zeile2
	bcs second
	ldy zeile2
	lda #farbe1
back	sty raster
	sta screen
	sta frame
	jmp irqend
second	ldy zeile1
	lda #farbe2
	clc
	bcc back
goon	jsr getkey
	cmp #ende
	bne noend
	sei
	lda #0
	sta imr
	lda #<irqalt
	ldy #>irqalt
	sta irqvek
	sty irqvek+1
	cli
	lda #farbe2
	sta frame
	sta screen
	rts
noend	cmp #up
	bne noup
	ldx zeile1
	beq go
uptmp	dec zeile1
set	jsr calc
go	jmp goon
calc	lda zeile1
	clc 
	 adc breit
	sta zeile2
	rts
noup	cmp #down
	bne nodown
	ldx zeile2
	inx
	beq go
downtmp	inc zeile1
	jmp set
nodown	cmp #weg
	bne noweg
	lda zeile1
	beq go
	ldx zeile2
	inx
	beq go
	ldx breit
	cpx #253
	bcs go
	inc breit
	inc breit
	jmp uptmp
noweg	cmp #hin
	bne go
	ldx breit
	cpx #3
	bcc go
	dec breit
	dec breit
	jmp downtmp
