跳转到内容

Signetics 2650 & 2636 编程/教程代码 - 入门

100% developed
来自维基教科书,开放世界中的开放书籍

教程代码 - 入门

[编辑 | 编辑源代码]

这是教程入门的代码

reset_vector:
        bcta,un	reset
interrupt_vector:
        retc,un	        ;just in case an interrupt occurs before we disable them
reset:	
        lodi,r0 $20	;initialise program status word, just to be sure!
        lpsu            ;inhibit interrupts, stack pointer=0
        lpsl            ;register bank 0, without carry, arithmetic compare

        eorz	r0
        stra,r0	effects   ;initialise the 74LS378
	
        bsta,un InitPVI   ;initialise video chip

endless:
        bctr,un endless   

;===================================================================
; subroutine - initialise PVI
InitPVI:
        eorz	r0		;r0 = 0
        lodi,r3	$CA		;set 1F00-1FC9 to 00 (most of PVI)
loop1:			        ;sets all colours to black, turns off sound, score 1 field at top.
        stra,r0	shape1,r3-
        brnr,r3	loop1


        lodi,r3 $0E
loopIS:			;load sprite shape and coords
        loda,r0 one,r3-
        stra,r0 shape1,r3
        brnr,r3 loopIS
        lodi,r0 $17
        stra,r0 colours12 
        retc,un

	
one:			
        db	$FF
        db	$81
        db	$81
        db	$81
        db	$81
        db	$81
        db	$81
        db	$81
        db	$81
        db	$FF
        db	100	;hc
        db	100	;hcb
        db	100	;vc
        db	200	;voff


华夏公益教科书