Код:
;
; Multicolor test program
;
.psect 1000
start:
mov #1330,@#177664
mov #14100,@#177716
jsr pc,fill
; set up CPU timer
mov #177706,r5
mov #177777,(r5)+
mov #22,@#177712
; set up 50Hz timer
mov #timer,@#100
mov #340,@#102
; prepare palette value
clr r3
mov #177662,r4
mov r3,@r4
; prepare compare counter
mov #177776,r0
wait
multic:
wait
collin:
cmp @r5,r0
bhi .-2
mov r3,@r4
add #400,r3
bic #170377,r3
sub #4,r0
cmp #176776,r0
bne collin
clr r3
mov #177776,r0
br multic
halt ; for 11M monitor
;fill screen with test patterns
fill:
mov #40000,r1
mov #20,r2
fill1:
mov #200,r0
fill2:
bit r2,r0
bne fill3
movb #125,(r1)+
movb #252,(r1)+
movb #377,(r1)+
br fill4
fill3:
clrb (r1)+
clrb (r1)+
clrb (r1)+
fill4:
add #75,r1
sob r0,fill2
sub #17775,r1
asr r2
bne fill1
mov #200,r2
fill5:
mov #10,r0
mov #52525,(r1)+
sob r0,.-4
mov #10,r0
mov #125252,(r1)+
sob r0,.-4
mov #10,r0
mov #177777,(r1)+
sob r0,.-4
mov r1,(r1)+
add #16,r1
sob r2,fill5
sub #20,r1
mov #10000,r2
mov -17760(r1),(r1)+
sob r2,.-4
rts pc
; timer interrupt handler
timer:
mov #22,@#177712 ;restart timer
rti
.end