1 | ; File name : main.asm
|
---|
2 | ; Project name : XTIDE Univeral BIOS Configurator v2
|
---|
3 | ; Created date : 5.10.2010
|
---|
4 | ; Last update : 3.12.2010
|
---|
5 | ; Author : Tomi Tilli
|
---|
6 | ; Description : Program start and exit.
|
---|
7 |
|
---|
8 | ; Include .inc files
|
---|
9 | %define INCLUDE_MENU_DIALOGS
|
---|
10 | %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first!
|
---|
11 | %include "Romvars.inc" ; XTIDE Universal BIOS variables
|
---|
12 |
|
---|
13 | %include "MenuCfg.inc"
|
---|
14 | %include "MenuStructs.inc"
|
---|
15 | %include "Variables.inc"
|
---|
16 |
|
---|
17 |
|
---|
18 | ; Section containing code
|
---|
19 | SECTION .text
|
---|
20 |
|
---|
21 |
|
---|
22 | ; Program first instruction.
|
---|
23 | ORG 100h ; Code starts at offset 100h (DOS .COM)
|
---|
24 | Start:
|
---|
25 | jmp Main_Start
|
---|
26 |
|
---|
27 | ; Include library sources
|
---|
28 | %include "AssemblyLibrary.asm"
|
---|
29 |
|
---|
30 | ; Include sources for this program
|
---|
31 | %include "BiosFile.asm"
|
---|
32 | %include "Buffers.asm"
|
---|
33 | %include "Dialogs.asm"
|
---|
34 | %include "EEPROM.asm"
|
---|
35 | %include "Flash.asm"
|
---|
36 | %include "MenuEvents.asm"
|
---|
37 | %include "Menuitem.asm"
|
---|
38 | %include "MenuitemPrint.asm"
|
---|
39 | %include "Menupage.asm"
|
---|
40 | %include "Strings.asm"
|
---|
41 |
|
---|
42 | %include "BootMenuSettingsMenu.asm"
|
---|
43 | %include "ConfigurationMenu.asm"
|
---|
44 | %include "FlashMenu.asm"
|
---|
45 | %include "IdeControllerMenu.asm"
|
---|
46 | %include "MainMenu.asm"
|
---|
47 | %include "MasterSlaveMenu.asm"
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 | ;--------------------------------------------------------------------
|
---|
52 | ; Program start
|
---|
53 | ;--------------------------------------------------------------------
|
---|
54 | ALIGN JUMP_ALIGN
|
---|
55 | Main_Start:
|
---|
56 | CALL_DISPLAY_LIBRARY InitializeDisplayContext
|
---|
57 | CALL_DISPLAY_LIBRARY ClearScreen
|
---|
58 |
|
---|
59 | call Main_InitializeCfgVars
|
---|
60 | call MenuEvents_DisplayMenu
|
---|
61 |
|
---|
62 | ; Exit to DOS
|
---|
63 | CALL_DISPLAY_LIBRARY SynchronizeDisplayContextToHardware
|
---|
64 | mov ax, 4C00h ; Exit to DOS
|
---|
65 | int 21h
|
---|
66 |
|
---|
67 |
|
---|
68 | ;--------------------------------------------------------------------
|
---|
69 | ; Main_InitializeCfgVars
|
---|
70 | ; Parameters:
|
---|
71 | ; DS: Segment to CFGVARS
|
---|
72 | ; Returns:
|
---|
73 | ; Nothing
|
---|
74 | ; Corrupts registers:
|
---|
75 | ; AX, BX, CX, DI
|
---|
76 | ;--------------------------------------------------------------------
|
---|
77 | ALIGN JUMP_ALIGN
|
---|
78 | Main_InitializeCfgVars:
|
---|
79 | push es
|
---|
80 |
|
---|
81 | call Buffers_Clear
|
---|
82 | call EEPROM_FindXtideUniversalBiosROMtoESDI
|
---|
83 | jnc SHORT .InitializationCompleted
|
---|
84 | mov [CFGVARS.wEepromSegment], es
|
---|
85 | .InitializationCompleted:
|
---|
86 | pop es
|
---|
87 | ret
|
---|
88 |
|
---|
89 |
|
---|
90 | ; Section containing initialized data
|
---|
91 | SECTION .data
|
---|
92 |
|
---|
93 | ALIGN WORD_ALIGN
|
---|
94 | g_cfgVars:
|
---|
95 | istruc CFGVARS
|
---|
96 | at CFGVARS.pMenupage, dw g_MenupageForMainMenu
|
---|
97 | at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
|
---|
98 | at CFGVARS.wEepromSegment, dw DEFAULT_EEPROM_SEGMENT
|
---|
99 | at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE
|
---|
100 | at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE
|
---|
101 | at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
|
---|
102 | iend
|
---|
103 |
|
---|
104 |
|
---|
105 | ; Section containing uninitialized data
|
---|
106 | SECTION .bss
|
---|