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

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

Small changes. 1) Changes biosdrvs.com to output CR+LF instead of LF+CR, consistent with DOS/Windows, but I did not update the Assembly Library as this would break the Configurator; 2) Put a C/C++ section in Version.inc for the serial server; 3) Configurator defaults the EEPROM address after scanning for a EEPROM in memory (as it does for loading the BIOS from ROM); 4) Added a command to the Configurator main menu to save chages to the file from which it was loaded (if it was loaded form a file), which is symmetric with the Load command and more discoverable than exiting DOS and then being prompted (which is still there too, if changes are unsaved).

File size: 3.1 KB
Line 
1; Project name : XTIDE Univeral BIOS Configurator v2
2; Description : Program start and exit.
3
4; Include .inc files
5
6%define INCLUDE_MENU_DIALOGS
7%define INCLUDE_SERIAL_LIBRARY
8
9%include "AssemblyLibrary.inc" ; Assembly Library. Must be included first!
10%include "Romvars.inc" ; XTIDE Universal BIOS variables
11
12%include "MenuCfg.inc"
13%include "MenuStructs.inc"
14%include "Variables.inc"
15
16
17; Section containing code
18SECTION .text
19
20
21; Program first instruction.
22ORG 100h ; Code starts at offset 100h (DOS .COM)
23Start:
24 jmp Main_Start
25
26; Include library sources
27%include "AssemblyLibrary.asm"
28
29; Include sources for this program
30%include "BiosFile.asm"
31%include "Buffers.asm"
32%include "Dialogs.asm"
33%include "EEPROM.asm"
34%include "Flash.asm"
35%include "MenuEvents.asm"
36%include "Menuitem.asm"
37%include "MenuitemPrint.asm"
38%include "Menupage.asm"
39%include "Strings.asm"
40
41%include "BootMenuSettingsMenu.asm"
42%include "ConfigurationMenu.asm"
43%include "FlashMenu.asm"
44%include "IdeControllerMenu.asm"
45%include "MainMenu.asm"
46%include "MasterSlaveMenu.asm"
47
48
49
50;--------------------------------------------------------------------
51; Program start
52;--------------------------------------------------------------------
53ALIGN JUMP_ALIGN
54Main_Start:
55 mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
56 call InitializeScreenWithBackgroudCharAndAttrInAX
57
58 call Main_InitializeCfgVars
59 call MenuEvents_DisplayMenu
60 mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
61 call InitializeScreenWithBackgroudCharAndAttrInAX
62
63 ; Exit to DOS
64 mov ax, 4C00h ; Exit to DOS
65 int 21h
66
67
68;--------------------------------------------------------------------
69; InitializeScreenWithBackgroudCharAndAttrInAX
70; Parameters:
71; AL: Background character
72; AH: Background attribute
73; Returns:
74; Nothing
75; Corrupts registers:
76; AX, DX, DI
77;--------------------------------------------------------------------
78ALIGN JUMP_ALIGN
79InitializeScreenWithBackgroudCharAndAttrInAX:
80 xchg dx, ax
81 CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc
82 xchg ax, dx
83 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
84 ret
85
86
87;--------------------------------------------------------------------
88; Main_InitializeCfgVars
89; Parameters:
90; DS: Segment to CFGVARS
91; Returns:
92; Nothing
93; Corrupts registers:
94; AX, BX, CX, DI
95;--------------------------------------------------------------------
96ALIGN JUMP_ALIGN
97Main_InitializeCfgVars:
98 push es
99
100 call Buffers_Clear
101 call EEPROM_FindXtideUniversalBiosROMtoESDI
102 jnc SHORT .InitializationCompleted
103 mov [CFGVARS.wEepromSegment], es
104.InitializationCompleted:
105 pop es
106 ret
107
108
109; Section containing initialized data
110SECTION .data
111
112ALIGN WORD_ALIGN
113g_cfgVars:
114istruc CFGVARS
115 at CFGVARS.pMenupage, dw g_MenupageForMainMenu
116 at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
117 at CFGVARS.wEepromSegment, dw 0
118 at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE
119 at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE
120 at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
121iend
122
123
124; Section containing uninitialized data
125SECTION .bss
Note: See TracBrowser for help on using the repository browser.