[57] | 1 | ; File name : main.asm
|
---|
| 2 | ; Project name : XTIDE Univeral BIOS Configurator v2
|
---|
| 3 | ; Created date : 5.10.2010
|
---|
[68] | 4 | ; Last update : 7.12.2010
|
---|
[57] | 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"
|
---|
[65] | 35 | %include "Flash.asm"
|
---|
[57] | 36 | %include "MenuEvents.asm"
|
---|
| 37 | %include "Menuitem.asm"
|
---|
| 38 | %include "MenuitemPrint.asm"
|
---|
| 39 | %include "Menupage.asm"
|
---|
| 40 | %include "Strings.asm"
|
---|
| 41 |
|
---|
[59] | 42 | %include "BootMenuSettingsMenu.asm"
|
---|
[57] | 43 | %include "ConfigurationMenu.asm"
|
---|
[59] | 44 | %include "FlashMenu.asm"
|
---|
[57] | 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:
|
---|
[68] | 56 | mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
|
---|
| 57 | call InitializeScreenWithBackgroudCharAndAttrInAX
|
---|
[57] | 58 |
|
---|
| 59 | call Main_InitializeCfgVars
|
---|
| 60 | call MenuEvents_DisplayMenu
|
---|
[68] | 61 | mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
|
---|
| 62 | call InitializeScreenWithBackgroudCharAndAttrInAX
|
---|
[57] | 63 |
|
---|
| 64 | ; Exit to DOS
|
---|
| 65 | mov ax, 4C00h ; Exit to DOS
|
---|
| 66 | int 21h
|
---|
| 67 |
|
---|
| 68 |
|
---|
| 69 | ;--------------------------------------------------------------------
|
---|
[68] | 70 | ; InitializeScreenWithBackgroudCharAndAttrInAX
|
---|
| 71 | ; Parameters:
|
---|
| 72 | ; AL: Background character
|
---|
| 73 | ; AH: Background attribute
|
---|
| 74 | ; Returns:
|
---|
| 75 | ; Nothing
|
---|
| 76 | ; Corrupts registers:
|
---|
| 77 | ; AX, DX, DI
|
---|
| 78 | ;--------------------------------------------------------------------
|
---|
| 79 | ALIGN JUMP_ALIGN
|
---|
| 80 | InitializeScreenWithBackgroudCharAndAttrInAX:
|
---|
| 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 | ;--------------------------------------------------------------------
|
---|
[57] | 89 | ; Main_InitializeCfgVars
|
---|
| 90 | ; Parameters:
|
---|
| 91 | ; DS: Segment to CFGVARS
|
---|
| 92 | ; Returns:
|
---|
| 93 | ; Nothing
|
---|
| 94 | ; Corrupts registers:
|
---|
| 95 | ; AX, BX, CX, DI
|
---|
| 96 | ;--------------------------------------------------------------------
|
---|
| 97 | ALIGN JUMP_ALIGN
|
---|
| 98 | Main_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
|
---|
| 111 | SECTION .data
|
---|
| 112 |
|
---|
| 113 | ALIGN WORD_ALIGN
|
---|
| 114 | g_cfgVars:
|
---|
| 115 | istruc CFGVARS
|
---|
[59] | 116 | at CFGVARS.pMenupage, dw g_MenupageForMainMenu
|
---|
| 117 | at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
|
---|
| 118 | at CFGVARS.wEepromSegment, dw DEFAULT_EEPROM_SEGMENT
|
---|
[63] | 119 | at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE
|
---|
[65] | 120 | at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE
|
---|
[59] | 121 | at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
|
---|
[57] | 122 | iend
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 | ; Section containing uninitialized data
|
---|
| 126 | SECTION .bss
|
---|