[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 |
---|
| 6 | SECTION .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 | ;-------------------------------------------------------------------- |
---|
| 18 | ALIGN JUMP_ALIGN |
---|
| 19 | Display_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 | ;-------------------------------------------------------------------- |
---|
| 45 | ALIGN 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 | |
---|
| 60 | ALIGN WORD_ALIGN |
---|
| 61 | .rgfnDisplayLibraryFunctions: |
---|
| 62 | istruc DISPLAY_LIB |
---|
[44] | 63 | at DISPLAY_LIB.InitializeDisplayContext, dw DisplayContext_Initialize |
---|
[41] | 64 | |
---|
[133] | 65 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS |
---|
[44] | 66 | at DISPLAY_LIB.SetCharacterPointerFromBXAX, dw DisplayContext_SetCharacterPointerFromBXAX |
---|
[133] | 67 | %endif |
---|
[45] | 68 | at DISPLAY_LIB.SetCharOutputFunctionFromAXwithAttribFlagInBL, dw DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL |
---|
[44] | 69 | at DISPLAY_LIB.SetCharacterOutputParameterFromAX, dw DisplayContext_SetCharacterOutputParameterFromAX |
---|
| 70 | at DISPLAY_LIB.SetCharacterAttributeFromAL, dw DisplayContext_SetCharacterAttributeFromAL |
---|
| 71 | at DISPLAY_LIB.SetCursorShapeFromAX, dw DisplayCursor_SetShapeFromAX |
---|
| 72 | at DISPLAY_LIB.SetCursorCoordinatesFromAX, dw DisplayCursor_SetCoordinatesFromAX |
---|
| 73 | at DISPLAY_LIB.SetNewPageFromAL, dw DisplayPage_SetFromAL |
---|
| 74 | at DISPLAY_LIB.SynchronizeDisplayContextToHardware, dw DisplayContext_SynchronizeToHardware |
---|
[41] | 75 | |
---|
[133] | 76 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS |
---|
[44] | 77 | at DISPLAY_LIB.GetCharacterPointerToBXAX, dw DisplayContext_GetCharacterPointerToBXAX |
---|
[133] | 78 | %endif |
---|
[44] | 79 | at DISPLAY_LIB.GetSoftwareCoordinatesToAX, dw DisplayCursor_GetSoftwareCoordinatesToAX |
---|
| 80 | at DISPLAY_LIB.GetColumnsToALandRowsToAH, dw DisplayPage_GetColumnsToALandRowsToAH |
---|
[41] | 81 | |
---|
[44] | 82 | at DISPLAY_LIB.FormatNullTerminatedStringFromCSSI, dw .FormatNullTerminatedStringFromCSSI |
---|
| 83 | at DISPLAY_LIB.PrintSignedWordFromAXWithBaseInBX, dw DisplayPrint_SignedWordFromAXWithBaseInBX |
---|
| 84 | at DISPLAY_LIB.PrintWordFromAXwithBaseInBX, dw DisplayPrint_WordFromAXWithBaseInBX |
---|
| 85 | at DISPLAY_LIB.PrintCharBufferFromBXSIwithLengthInCX, dw DisplayPrint_CharacterBufferFromBXSIwithLengthInCX |
---|
| 86 | at DISPLAY_LIB.PrintNullTerminatedStringFromBXSI, dw DisplayPrint_NullTerminatedStringFromBXSI |
---|
| 87 | at DISPLAY_LIB.PrintNullTerminatedStringFromCSSI, dw DisplayPrint_NullTerminatedStringFromCSSI |
---|
| 88 | at DISPLAY_LIB.PrintRepeatedCharacterFromALwithCountInCX, dw DisplayPrint_RepeatCharacterFromALwithCountInCX |
---|
| 89 | at DISPLAY_LIB.PrintCharacterFromAL, dw DisplayPrint_CharacterFromAL |
---|
| 90 | at DISPLAY_LIB.PrintNewlineCharacters, dw DisplayPrint_Newline |
---|
| 91 | at DISPLAY_LIB.ClearAreaWithHeightInAHandWidthInAL, dw DisplayPrint_ClearAreaWithHeightInAHandWidthInAL |
---|
[67] | 92 | at DISPLAY_LIB.ClearScreenWithCharInALandAttrInAH, dw DisplayPrint_ClearScreenWithCharInALandAttributeInAH |
---|
[41] | 93 | iend |
---|