1 | ; File name : main.asm
|
---|
2 | ; Project name : XTIDE Univeral BIOS Configurator v2
|
---|
3 | ; Created date : 5.10.2010
|
---|
4 | ; Last update : 19.11.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 "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 | ;--------------------------------------------------------------------
|
---|
53 | ALIGN JUMP_ALIGN
|
---|
54 | Main_Start:
|
---|
55 | CALL_DISPLAY_LIBRARY InitializeDisplayContext
|
---|
56 | CALL_DISPLAY_LIBRARY ClearScreen
|
---|
57 |
|
---|
58 | call Main_InitializeCfgVars
|
---|
59 | call MenuEvents_DisplayMenu
|
---|
60 |
|
---|
61 | ; Exit to DOS
|
---|
62 | CALL_DISPLAY_LIBRARY SynchronizeDisplayContextToHardware
|
---|
63 | mov ax, 4C00h ; Exit to DOS
|
---|
64 | int 21h
|
---|
65 |
|
---|
66 |
|
---|
67 | ;--------------------------------------------------------------------
|
---|
68 | ; Main_InitializeCfgVars
|
---|
69 | ; Parameters:
|
---|
70 | ; DS: Segment to CFGVARS
|
---|
71 | ; Returns:
|
---|
72 | ; Nothing
|
---|
73 | ; Corrupts registers:
|
---|
74 | ; AX, BX, CX, DI
|
---|
75 | ;--------------------------------------------------------------------
|
---|
76 | ALIGN JUMP_ALIGN
|
---|
77 | Main_InitializeCfgVars:
|
---|
78 | push es
|
---|
79 |
|
---|
80 | call Buffers_Clear
|
---|
81 | call EEPROM_FindXtideUniversalBiosROMtoESDI
|
---|
82 | jnc SHORT .InitializationCompleted
|
---|
83 | mov [CFGVARS.wEepromSegment], es
|
---|
84 | .InitializationCompleted:
|
---|
85 | pop es
|
---|
86 | ret
|
---|
87 |
|
---|
88 |
|
---|
89 | ; Section containing initialized data
|
---|
90 | SECTION .data
|
---|
91 |
|
---|
92 | ALIGN WORD_ALIGN
|
---|
93 | g_cfgVars:
|
---|
94 | istruc CFGVARS
|
---|
95 | at CFGVARS.pMenupage, dw g_MenupageForMainMenu
|
---|
96 | at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
|
---|
97 | at CFGVARS.wEepromSegment, dw DEFAULT_EEPROM_SEGMENT
|
---|
98 | at CFGVARS.bEepromPageSize, db DEFAULT_PAGE_SIZE
|
---|
99 | at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
|
---|
100 | iend
|
---|
101 |
|
---|
102 |
|
---|
103 | ; Section containing uninitialized data
|
---|
104 | SECTION .bss
|
---|
105 |
|
---|
106 | g_uninitialized:
|
---|
107 | resb 32768
|
---|
108 |
|
---|