annotate bootman/mach_coco.a @ 2510:9f83ee4bedc6

Updated
author boisy
date Tue, 06 Apr 2010 00:18:57 +0000
parents 2db06bc0742a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2163
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
1 NAM mach_coco
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
2 TTL CoCo machine routines
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
3
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
4 PSECT mach_coco,0,0,0,0,mach_init
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
5
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
6 VSECT
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
7 ENDSECT
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
8
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
9 PIA0Base equ $FF00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
10 PIA1Base equ $FF20
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
11
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
12 mach_init:
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
13 * CoCo 1/2 Initialization Code
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
14 ldx #PIA1Base PIA1
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
15 clr -3,x clear PIA0 Control Register A
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
16 clr -1,x clear PIA0 Control Register B
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
17 clr -4,x set PIA0 side A to input
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
18 ldd #$FF34
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
19 sta -2,x set PIA0 side B to output
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
20 stb -3,x enable PIA0 peripheral reg, disable PIA0
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
21 stb -1,x MPU interrupts, set CA2, CA1 to outputs
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
22 clr 1,x $FF20 = DDR, motoroff
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
23 clr 3,x $FF22 = DDR, sound disabled
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
24 deca A = $FE after deca
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
25 sta ,x bits 1-7 are outputs, bit 0 is input on PIA1 side A
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
26 lda #$F8
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
27 sta 2,x bits 0-2 are inputs, bits 3-7 are outputs on B side
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
28 stb 1,x enable peripheral registers, disable PIA1 MPU
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
29 stb 3,x interrupts and set CA2, CB2 as outputs
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
30 clr 2,x set 6847 mode to alphanumeric
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
31 ldb #$02
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
32 stb ,x make RS-232 output marking
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
33 clrb
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
34 tfr b,dp B = 0
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
35 ldb #$04
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
36 clr -2,x
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
37 bitb 2,x
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
38
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
39 lda #$37
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
40 sta PIA1Base+3
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
41
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
42 lda PIA0Base+3
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
43 ora #$01
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
44 sta PIA0Base+3
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
45
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
46 lda PIA1Base+2
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
47 anda #$07
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
48 sta PIA1Base+2
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
49
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
50 * 64K DRAM (M0=0, M1=1)
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
51 sta $FFDA RESET M0
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
52 sta $FFDD SET M1
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
53
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
54 rts
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
55
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
56 endsect