-
Notifications
You must be signed in to change notification settings - Fork 5
/
xex.a65
61 lines (53 loc) · 896 Bytes
/
xex.a65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
processor 6502
;
; Generate ROM files for direct use
; Build with dasm -f2 and then run toxex.py
;
; COPYCHUNK SRC,DST,ENDDST
MAC COPYCHUNK
; copy RAM to ROM
LDY #<{1}
STY SRCVEC
LDY #<{2}
STY DSTVEC
LDA #>{1}
STA SRCVEC+1
LDA #>{2}
STA DSTVEC+1
.LOOP
LDA (SRCVEC),Y
STA (DSTVEC),Y
INY
BNE .LOOP
INC SRCVEC+1
INC DSTVEC+1
LDA DSTVEC+1
CMP #>{3}
BNE .LOOP
ENDM
PORTB = $D301 ; memory control
NMIEN = $D40E ; NMI control
; zero-page vectors for copying
SRCVEC = $80
DSTVEC = $82
org $3500
BASICSRC
incbin "rom.a000"
KERNALSRC
incbin "rom.d800"
BASICDST equ $A000
KERNALDST equ $D800
INIT
; disable all NMIs
LDA #0
STA NMIEN
SEI
LDA PORTB
AND #$7C ; preserve 130XE memory bank
ORA #$82 ; disable OS and BASIC ROM and also self-test
STA PORTB
COPYCHUNK BASICSRC,BASICDST,$C000
COPYCHUNK KERNALSRC,KERNALDST,$0000
JMP ($FFFC)
org $02e0
.word INIT