source: xtideuniversalbios/trunk/Assembly_Library/Src/Display/Display.asm@ 393

Last change on this file since 393 was 376, checked in by gregli@…, 13 years ago

WIDE checkin... Added copyright and license information to sorce files, as per the GPL instructions for usage.

File size: 4.6 KB
Line 
1; Project name : Assembly Library
2; Description : Display Library functions for CALL_DISPLAY_LIBRARY macro
3; that users should use to make library call.
4
5;
6; XTIDE Universal BIOS and Associated Tools
7; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
8;
9; This program is free software; you can redistribute it and/or modify
10; it under the terms of the GNU General Public License as published by
11; the Free Software Foundation; either version 2 of the License, or
12; (at your option) any later version.
13;
14; This program is distributed in the hope that it will be useful,
15; but WITHOUT ANY WARRANTY; without even the implied warranty of
16; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17; GNU General Public License for more details.
18; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19;
20
21; Section containing code
22SECTION .text
23
24;--------------------------------------------------------------------
25; DisplayFunctionFromDI
26; Parameters:
27; DI: Function to call (DISPLAY_LIB.functionName)
28; Others: Depends on function to call (DX cannot be parameter)
29; Returns:
30; Depends on function to call
31; Corrupts registers:
32; AX (unless used as a return register), DI
33;--------------------------------------------------------------------
34ALIGN DISPLAY_JUMP_ALIGN
35Display_FunctionFromDI:
36 push es
37 push ds
38 push dx
39
40 cld
41 LOAD_BDA_SEGMENT_TO ds, dx
42 mov dx, di
43 les di, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
44 call dx
45 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
46
47 pop dx
48 pop ds
49 pop es
50 ret
51
52;--------------------------------------------------------------------
53; Display_FormatNullTerminatedStringFromCSSI
54; Parameters:
55; Same as DisplayPrint_FormattedNullTerminatedStringFromCSSI
56; Returns:
57; Stack variables will be cleaned
58; Corrupts registers:
59; AX
60;--------------------------------------------------------------------
61ALIGN DISPLAY_JUMP_ALIGN
62Display_FormatNullTerminatedStringFromCSSI:
63 pop ax ; Discard return address to inside Display_FunctionFromDI
64 call DisplayPrint_FormattedNullTerminatedStringFromCSSI
65 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
66
67 pop dx
68 pop ds
69 pop es
70
71 pop ax ; Pop return address
72 mov sp, bp ; Clean stack variables
73 jmp ax
74
75
76 %define InitializeDisplayContext DisplayContext_Initialize
77
78%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
79 %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX
80%endif
81 %define SetCharOutputFunctionFromAXwithAttribFlagInBL DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
82 %define SetCharacterOutputParameterFromAX DisplayContext_SetCharacterOutputParameterFromAX
83 %define SetCharacterAttributeFromAL DisplayContext_SetCharacterAttributeFromAL
84 %define SetCursorShapeFromAX DisplayCursor_SetShapeFromAX
85 %define SetCursorCoordinatesFromAX DisplayCursor_SetCoordinatesFromAX
86%ifndef EXCLUDE_FROM_XTIDECFG
87 %define SetNewPageFromAL DisplayPage_SetFromAL
88%endif
89 %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware
90
91%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
92 %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX
93%endif
94 %define GetSoftwareCoordinatesToAX DisplayCursor_GetSoftwareCoordinatesToAX
95 %define GetColumnsToALandRowsToAH DisplayPage_GetColumnsToALandRowsToAH
96
97 %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI
98%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
99 %define PrintSignedWordFromAXWithBaseInBX DisplayPrint_SignedWordFromAXWithBaseInBX
100%endif
101 %define PrintWordFromAXwithBaseInBX DisplayPrint_WordFromAXWithBaseInBX
102%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
103 %define PrintQWordFromSSBPwithBaseInBX DisplayPrint_QWordFromSSBPwithBaseInBX
104%endif
105 %define PrintCharBufferFromBXSIwithLengthInCX DisplayPrint_CharacterBufferFromBXSIwithLengthInCX
106 %define PrintNullTerminatedStringFromBXSI DisplayPrint_NullTerminatedStringFromBXSI
107 %define PrintNullTerminatedStringFromCSSI DisplayPrint_NullTerminatedStringFromCSSI
108 %define PrintRepeatedCharacterFromALwithCountInCX DisplayPrint_RepeatCharacterFromALwithCountInCX
109 %define PrintCharacterFromAL DisplayPrint_CharacterFromAL
110 %define PrintNewlineCharacters DisplayPrint_Newline
111%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
112 %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
113%endif
114 %define ClearScreenWithCharInALandAttrInAH DisplayPrint_ClearScreenWithCharInALandAttributeInAH
115
Note: See TracBrowser for help on using the repository browser.