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

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

Initial commit (Work in progress).

File size: 2.5 KB
Line 
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
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 "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;--------------------------------------------------------------------
51ALIGN JUMP_ALIGN
52Main_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;--------------------------------------------------------------------
74ALIGN JUMP_ALIGN
75Main_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
88SECTION .data
89
90ALIGN WORD_ALIGN
91g_cfgVars:
92istruc 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
98iend
99
100
101; Section containing uninitialized data
102SECTION .bss
103
104g_uninitialized:
105 resb 32768
106
Note: See TracBrowser for help on using the repository browser.