source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm@ 378

Last change on this file since 378 was 376, checked in by gregli@…, 13 years ago

WIDE checkin... Added copyright and license information to sorce files, as per the GPL instructions for usage.

File size: 3.8 KB
Line 
1; Project name : XTIDE Univeral BIOS Configurator v2
2; Description : Program start and exit.
3
4;
5; XTIDE Universal BIOS and Associated Tools
6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
7;
8; This program is free software; you can redistribute it and/or modify
9; it under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2 of the License, or
11; (at your option) any later version.
12;
13; This program is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16; GNU General Public License for more details.
17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18;
19
20; Include .inc files
21
22%define INCLUDE_MENU_DIALOGS
23%define INCLUDE_SERIAL_LIBRARY
24
25%include "AssemblyLibrary.inc" ; Assembly Library. Must be included first!
26%include "Romvars.inc" ; XTIDE Universal BIOS variables
27
28%include "MenuCfg.inc"
29%include "MenuStructs.inc"
30%include "Variables.inc"
31
32
33; Section containing code
34SECTION .text
35
36
37; Program first instruction.
38ORG 100h ; Code starts at offset 100h (DOS .COM)
39Start:
40 jmp Main_Start
41
42; Include library sources
43%include "AssemblyLibrary.asm"
44
45; Include sources for this program
46%include "BiosFile.asm"
47%include "Buffers.asm"
48%include "Dialogs.asm"
49%include "EEPROM.asm"
50%include "Flash.asm"
51%include "MenuEvents.asm"
52%include "Menuitem.asm"
53%include "MenuitemPrint.asm"
54%include "Menupage.asm"
55%include "Strings.asm"
56
57%include "BootMenuSettingsMenu.asm"
58%include "ConfigurationMenu.asm"
59%include "FlashMenu.asm"
60%include "IdeControllerMenu.asm"
61%include "MainMenu.asm"
62%include "MasterSlaveMenu.asm"
63
64
65
66;--------------------------------------------------------------------
67; Program start
68;--------------------------------------------------------------------
69ALIGN JUMP_ALIGN
70Main_Start:
71 mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
72 call InitializeScreenWithBackgroudCharAndAttrInAX
73
74 call Main_InitializeCfgVars
75 call MenuEvents_DisplayMenu
76 mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
77 call InitializeScreenWithBackgroudCharAndAttrInAX
78
79 ; Exit to DOS
80 mov ax, 4C00h ; Exit to DOS
81 int 21h
82
83
84;--------------------------------------------------------------------
85; InitializeScreenWithBackgroudCharAndAttrInAX
86; Parameters:
87; AL: Background character
88; AH: Background attribute
89; Returns:
90; Nothing
91; Corrupts registers:
92; AX, DX, DI
93;--------------------------------------------------------------------
94ALIGN JUMP_ALIGN
95InitializeScreenWithBackgroudCharAndAttrInAX:
96 xchg dx, ax
97 CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc
98 xchg ax, dx
99 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
100 ret
101
102
103;--------------------------------------------------------------------
104; Main_InitializeCfgVars
105; Parameters:
106; DS: Segment to CFGVARS
107; Returns:
108; Nothing
109; Corrupts registers:
110; AX, BX, CX, DI
111;--------------------------------------------------------------------
112ALIGN JUMP_ALIGN
113Main_InitializeCfgVars:
114 push es
115
116 call Buffers_Clear
117 call EEPROM_FindXtideUniversalBiosROMtoESDI
118 jnc SHORT .InitializationCompleted
119 mov [CFGVARS.wEepromSegment], es
120.InitializationCompleted:
121 pop es
122 ret
123
124
125; Section containing initialized data
126SECTION .data
127
128ALIGN WORD_ALIGN
129g_cfgVars:
130istruc CFGVARS
131 at CFGVARS.pMenupage, dw g_MenupageForMainMenu
132 at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
133 at CFGVARS.wEepromSegment, dw 0
134 at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE
135 at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE
136 at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
137iend
138
139
140; Section containing uninitialized data
141SECTION .bss
Note: See TracBrowser for help on using the repository browser.