-
Notifications
You must be signed in to change notification settings - Fork 3
/
xtramtest.asm
120 lines (89 loc) · 3.71 KB
/
xtramtest.asm
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
; --- refresh time delay ---
%define REFRESH_DELAY 5
; ************************************************************************************************
%include "defines.inc"
[map all xtramtest.map]
; START equ 0E000h
; RESET equ 0FFF0h
; BASESEG equ 0F000h
; section .romdata start=START align=1
; section .lib follows=.romdata align=1
; section .text follows=.lib align=1
; section .resetvec start=RESET align=1
START equ 00000h
RESET equ 01FF0h
BASESEG equ 0FE00h
section .text start=START align=1
section .lib follows=.text align=1
section .romdata follows=.lib align=1
section .resetvec start=RESET align=1
; .rwdata section in the unused portion of MDA/CGA video RAM, starting at 4000 DECIMAL - 96 bytes.
; variables at the bottom, stack at the top.
section .rwdata start=rwdata_base align=1 nobits
rwdata_start:
; %define num_segments 8
%define first_segment 0
%define num_segments 40
%define bytes_per_segment 0x4000
; ---------------------------------------------------------------------------
section .rwdata ; MARK: __ .rwdata __
; ---------------------------------------------------------------------------
;Variables stored in unused MDA/CGA video RAM, or 4 KB at A0000.
; ---------------------------------------------------------------------------
pass_count dw ? ; The number of passes completed. Incremented by 1 each time a pass is completed.
do_not_use equ rwdata_base+38 ; Do not use this location. It caused a problem if a Mini G7 video card was used.
; ---------------------------------------------------------------------------
section .romdata ; MARK: __ .romdata __
; title_attr equ 1Fh
title_attr equ 0Fh
; title_attr equ 71h
subtitle_attr equ 07h
byline_attr equ 02h
%defstr VERSION_STRING VERSION
title_text: ; attr, x, y, text, 0 (terminate with 0 for attr)
db title_attr, 1, 1
title_only: db "XTRAMTEST ", 0
db subtitle_attr, 11, 1
db VERSION_STRING, " (", __DATE__, ")", 0
db title_attr, 54, 1, "github.com/ki3v/xtramtest", 0
db byline_attr, 0, 3, "by Dave Giller - with Adrian Black - https://youtube.com/@AdriansDigitalBasement", 0
db 0
; ---------------------------------------------------------------------------
section .lib ; MARK: __ .lib __
; ---------------------------------------------------------------------------
; procedures to include in the ROM
; %include "delay.asm"
%include "screen.asm"
%include "ram_common.asm"
%include "ram_marchu_nostack.asm"
; ---------------------------------------------------------------------------
section .text ; MARK: __ .text __
; ---------------------------------------------------------------------------
%include "option_rom.asm"
; ************************************************************************************************
; Initialization modules
%include "010_cold_boot.inc"
%include "030_video.inc"
xtramtest_start:
%include "050_beep.inc"
%include "060_vram.inc"
call scr_clear
call draw_screen
; Disable maskable interrupts, and set the direction flag to increment.
cli
cld
xtramtest_loop:
add word [ss:pass_count], 1 ; Increment the pass count.
%include "ram_marchu.asm"
%include "ram_ganssle.asm"
jmp xtramtest_loop
;------------------------------------------------------------------------------
; Power-On Entry Point
;------------------------------------------------------------------------------
section .resetvec ; MARK: __ .resetvec __
; ---------------------------------------------------------------------------
PowerOn: jmp BASESEG:cold_boot ; CS will be 0F000h
S_FFF5: db __DATE__ ; Assembled date (YYYY-MM-DD)
db 0 ; space for checksum byte
section .rwdata
rwdata_end: