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

Last change on this file since 71 was 68, checked in by Tomi Tilli, 14 years ago

Changes to Configurator v2:

  • Finally ready for testing.
File size: 3.2 KB
Line 
1; File name : main.asm
2; Project name : XTIDE Univeral BIOS Configurator v2
3; Created date : 5.10.2010
4; Last update : 7.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
19SECTION .text
20
21
22; Program first instruction.
23ORG 100h ; Code starts at offset 100h (DOS .COM)
24Start:
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;--------------------------------------------------------------------
54ALIGN JUMP_ALIGN
55Main_Start:
56 mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
57 call InitializeScreenWithBackgroudCharAndAttrInAX
58
59 call Main_InitializeCfgVars
60 call MenuEvents_DisplayMenu
61 mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
62 call InitializeScreenWithBackgroudCharAndAttrInAX
63
64 ; Exit to DOS
65 mov ax, 4C00h ; Exit to DOS
66 int 21h
67
68
69;--------------------------------------------------------------------
70; InitializeScreenWithBackgroudCharAndAttrInAX
71; Parameters:
72; AL: Background character
73; AH: Background attribute
74; Returns:
75; Nothing
76; Corrupts registers:
77; AX, DX, DI
78;--------------------------------------------------------------------
79ALIGN JUMP_ALIGN
80InitializeScreenWithBackgroudCharAndAttrInAX:
81 xchg dx, ax
82 CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc
83 xchg ax, dx
84 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
85 ret
86
87
88;--------------------------------------------------------------------
89; Main_InitializeCfgVars
90; Parameters:
91; DS: Segment to CFGVARS
92; Returns:
93; Nothing
94; Corrupts registers:
95; AX, BX, CX, DI
96;--------------------------------------------------------------------
97ALIGN JUMP_ALIGN
98Main_InitializeCfgVars:
99 push es
100
101 call Buffers_Clear
102 call EEPROM_FindXtideUniversalBiosROMtoESDI
103 jnc SHORT .InitializationCompleted
104 mov [CFGVARS.wEepromSegment], es
105.InitializationCompleted:
106 pop es
107 ret
108
109
110; Section containing initialized data
111SECTION .data
112
113ALIGN WORD_ALIGN
114g_cfgVars:
115istruc CFGVARS
116 at CFGVARS.pMenupage, dw g_MenupageForMainMenu
117 at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
118 at CFGVARS.wEepromSegment, dw DEFAULT_EEPROM_SEGMENT
119 at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE
120 at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE
121 at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
122iend
123
124
125; Section containing uninitialized data
126SECTION .bss
Note: See TracBrowser for help on using the repository browser.