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

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

Changes to Assembly Library:

  • Some minor size optimizations to Display Library.
File size: 3.9 KB
RevLine 
[41]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; Section containing code
6SECTION .text
7
8;--------------------------------------------------------------------
9; DisplayFunctionFromDI
10; Parameters:
11; DI: Function to call (DISPLAY_LIB.functionName)
12; Others: Depends on function to call (DX cannot be parameter)
13; Returns:
14; Depends on function to call
15; Corrupts registers:
16; AX (unless used as a return register), DI
17;--------------------------------------------------------------------
18ALIGN JUMP_ALIGN
19Display_FunctionFromDI:
20 push es
21 push ds
22 push dx
23
24 cld
25 LOAD_BDA_SEGMENT_TO ds, dx
26 mov dx, [cs:di+.rgfnDisplayLibraryFunctions]
27 les di, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
28 call dx
29 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
30
31 pop dx
32 pop ds
33 pop es
34 ret
35
36;--------------------------------------------------------------------
37; .FormatNullTerminatedStringFromCSSI
38; Parameters:
39; Same as DisplayPrint_FormattedNullTerminatedStringFromCSSI
40; Returns:
41; Stack variables will be cleaned
42; Corrupts registers:
43; AX
44;--------------------------------------------------------------------
45ALIGN JUMP_ALIGN
46.FormatNullTerminatedStringFromCSSI:
[101]47 pop ax ; Discard return address to inside Display_FunctionFromDI
[41]48 call DisplayPrint_FormattedNullTerminatedStringFromCSSI
49 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
50
51 pop dx
52 pop ds
53 pop es
54
55 pop ax ; Pop return address
56 mov sp, bp ; Clean stack variables
57 jmp ax
58
59
60ALIGN WORD_ALIGN
61.rgfnDisplayLibraryFunctions:
62istruc DISPLAY_LIB
[44]63 at DISPLAY_LIB.InitializeDisplayContext, dw DisplayContext_Initialize
[41]64
[44]65 at DISPLAY_LIB.SetCharacterPointerFromBXAX, dw DisplayContext_SetCharacterPointerFromBXAX
[45]66 at DISPLAY_LIB.SetCharOutputFunctionFromAXwithAttribFlagInBL, dw DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
[44]67 at DISPLAY_LIB.SetCharacterOutputParameterFromAX, dw DisplayContext_SetCharacterOutputParameterFromAX
68 at DISPLAY_LIB.SetCharacterAttributeFromAL, dw DisplayContext_SetCharacterAttributeFromAL
69 at DISPLAY_LIB.SetCursorShapeFromAX, dw DisplayCursor_SetShapeFromAX
70 at DISPLAY_LIB.SetCursorCoordinatesFromAX, dw DisplayCursor_SetCoordinatesFromAX
71 at DISPLAY_LIB.SetNewPageFromAL, dw DisplayPage_SetFromAL
72 at DISPLAY_LIB.SynchronizeDisplayContextToHardware, dw DisplayContext_SynchronizeToHardware
[41]73
[44]74 at DISPLAY_LIB.GetCharacterPointerToBXAX, dw DisplayContext_GetCharacterPointerToBXAX
75 at DISPLAY_LIB.GetSoftwareCoordinatesToAX, dw DisplayCursor_GetSoftwareCoordinatesToAX
76 at DISPLAY_LIB.GetColumnsToALandRowsToAH, dw DisplayPage_GetColumnsToALandRowsToAH
[41]77
[44]78 at DISPLAY_LIB.FormatNullTerminatedStringFromCSSI, dw .FormatNullTerminatedStringFromCSSI
79 at DISPLAY_LIB.PrintSignedWordFromAXWithBaseInBX, dw DisplayPrint_SignedWordFromAXWithBaseInBX
80 at DISPLAY_LIB.PrintWordFromAXwithBaseInBX, dw DisplayPrint_WordFromAXWithBaseInBX
81 at DISPLAY_LIB.PrintCharBufferFromBXSIwithLengthInCX, dw DisplayPrint_CharacterBufferFromBXSIwithLengthInCX
82 at DISPLAY_LIB.PrintNullTerminatedStringFromBXSI, dw DisplayPrint_NullTerminatedStringFromBXSI
83 at DISPLAY_LIB.PrintNullTerminatedStringFromCSSI, dw DisplayPrint_NullTerminatedStringFromCSSI
84 at DISPLAY_LIB.PrintRepeatedCharacterFromALwithCountInCX, dw DisplayPrint_RepeatCharacterFromALwithCountInCX
85 at DISPLAY_LIB.PrintCharacterFromAL, dw DisplayPrint_CharacterFromAL
86 at DISPLAY_LIB.PrintNewlineCharacters, dw DisplayPrint_Newline
87 at DISPLAY_LIB.ClearAreaWithHeightInAHandWidthInAL, dw DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
[67]88 at DISPLAY_LIB.ClearScreenWithCharInALandAttrInAH, dw DisplayPrint_ClearScreenWithCharInALandAttributeInAH
[41]89iend
Note: See TracBrowser for help on using the repository browser.