X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=ROM2%2Fstart.s;h=c3f8d36f843ee6ed447d81233b4a60d5f5036ffc;hb=HEAD;hp=1520835f5808519932eab53f3a887a207b2bb535;hpb=3d8e5e4e1024a34885544acf3acec80e1b1e732b;p=uccvend-snackrom.git diff --git a/ROM2/start.s b/ROM2/start.s index 1520835..c3f8d36 100644 --- a/ROM2/start.s +++ b/ROM2/start.s @@ -2,24 +2,46 @@ .globl _start _start: -;; enable the RTI + ;; set port a to output + ldab #0xfc ; 11111000 + stab 0x1001 + + ;; start chiming + ldx #0x1000 + bset 00,x #0x10 + + ;; enable the RTI ldaa #0x40 staa 0x1024 -;; enable the ADC, and configure IRQ' for edge-sensitive operation + + ;; enable the ADC, and configure IRQ' for edge-sensitive operation ldaa #0xa0 staa 0x1039 -;; set the stack pointer - lds _stack -;; initialize initialised variables + ;; set RTI intervals, and PA3/7 DDRs + ldaa #0x81 + staa 0x1026 ;; RTI interval becomes E/2^14 = 6.6ms (or 150 Hz) + + ;; clear ADC register + clra + staa 0x1030 + + ;; set the stack pointer + lds #_stack + + ;; blank initialised variables - should match memory.x's page0 ldx #0x0000 -loop: - cpx #0x0080 - bcc out +loop1: + cpx #0x0100 + bcc out1 clr 00,x inx - bra loop -out: + bra loop1 +out1: + + ;; stop chiming + ldx #0x1000 + bclr 00,x #0x10 jsr main