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