Changeset 101 in xtideuniversalbios for trunk/Assembly_Library
- Timestamp:
- Jan 31, 2011, 7:03:22 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library/Src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/AssemblyLibrary.asm
r85 r101 12 12 %include "DisplayContext.asm" 13 13 %include "DisplayCursor.asm" 14 %include "DisplayFormat.asm"15 14 %include "DisplayPage.asm" 16 15 %include "DisplayPrint.asm" 16 %include "DisplayFormat.asm" 17 17 %endif 18 18 -
trunk/Assembly_Library/Src/Display/CgaSnow.asm
r52 r101 1 ; File name : CgaSnow.asm2 1 ; Project name : Assembly Library 3 ; Created date : 8.10.20104 ; Last update : 12.10.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for preventing CGA snow. 7 3 -
trunk/Assembly_Library/Src/Display/Display.asm
r67 r101 1 ; File name : Display.asm2 1 ; Project name : Assembly Library 3 ; Created date : 2.7.20104 ; Last update : 7.12.20105 ; Author : Tomi Tilli6 2 ; Description : Display Library functions for CALL_DISPLAY_LIBRARY macro 7 3 ; that users should use to make library call. … … 49 45 ALIGN JUMP_ALIGN 50 46 .FormatNullTerminatedStringFromCSSI: 51 pop ax ; Discard return address to inside Display FunctionFromDI47 pop ax ; Discard return address to inside Display_FunctionFromDI 52 48 call DisplayPrint_FormattedNullTerminatedStringFromCSSI 53 49 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di -
trunk/Assembly_Library/Src/Display/DisplayCharOut.asm
r55 r101 1 ; File name : DisplayCharOut.asm2 1 ; Project name : Assembly Library 3 ; Created date : 26.6.20104 ; Last update : 24.10.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for outputting characters to video memory. 7 3 ; These functions are meant to be called by Display_CharacterFromAL … … 54 50 call DisplayCursor_SynchronizeCoordinatesToHardware 55 51 pop ax 56 call .OutputCharacterWithBIOS57 call DisplayCursor_GetHardwareCoordinatesToAX58 jmp DisplayCursor_SetCoordinatesFromAX59 52 60 ;-------------------------------------------------------------------- 61 ; .OutputCharacterWithBIOS 62 ; Parameters: 63 ; AL: Character to output 64 ; DS: BDA segment 65 ; Returns: 66 ; Nothing 67 ; Corrupts registers: 68 ; AX 69 ;-------------------------------------------------------------------- 70 ALIGN JUMP_ALIGN 71 .OutputCharacterWithBIOS: 53 ; Output character with BIOS 72 54 push bx 73 55 mov ah, TELETYPE_OUTPUT … … 75 57 int BIOS_VIDEO_INTERRUPT_10h 76 58 pop bx 77 ret 59 60 call DisplayCursor_GetHardwareCoordinatesToAX 61 jmp DisplayCursor_SetCoordinatesFromAX 78 62 79 63 -
trunk/Assembly_Library/Src/Display/DisplayContext.asm
r52 r101 1 ; File name : DisplayContext.asm2 1 ; Project name : Assembly Library 3 ; Created date : 25.6.20104 ; Last update : 11.10.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for managing display context. 7 3 … … 20 16 ALIGN JUMP_ALIGN 21 17 DisplayContext_Initialize: 22 call .DetectAndSetDisplaySegment ; and .InitializeFlags23 18 mov WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut], DEFAULT_CHARACTER_OUTPUT 24 19 mov WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCursorShape], CURSOR_NORMAL 25 20 mov BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute], SCREEN_BACKGROUND_ATTRIBUTE 26 xor ax, ax 27 call DisplayCursor_SetCoordinatesFromAX 28 jmp DisplayContext_SynchronizeToHardware 21 ; Fall to .DetectAndSetDisplaySegment 29 22 30 23 ;-------------------------------------------------------------------- … … 40 33 mov ax, COLOR_TEXT_SEGMENT 41 34 cmp BYTE [VIDEO_BDA.bMode], MDA_TEXT_MODE 42 jne SHORT .StoreSegmentToDisplayContext 43 mov ax, MONO_TEXT_SEGMENT 44 .StoreSegmentToDisplayContext: 35 eCMOVE ah, MONO_TEXT_SEGMENT >> 8 45 36 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition+2], ax 46 ; Fall to InitializeFlags37 ; Fall to .InitializeFlags 47 38 48 39 ;-------------------------------------------------------------------- … … 62 53 .DoNotSetCgaFlag: 63 54 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], dl 64 ret 55 ; Fall to .InitializeCursor 56 57 ;-------------------------------------------------------------------- 58 ; .InitializeCursor 59 ; Parameters: 60 ; DS: BDA segment (zero) 61 ; Returns: 62 ; Nothing 63 ; Corrupts registers: 64 ; AX, DX 65 ;-------------------------------------------------------------------- 66 .InitializeCursor: 67 xor ax, ax 68 call DisplayCursor_SetCoordinatesFromAX 69 ; Fall to DisplayContext_SynchronizeToHardware 70 71 ;-------------------------------------------------------------------- 72 ; DisplayContext_SynchronizeToHardware 73 ; Parameters: 74 ; DS: BDA segment (zero) 75 ; Returns: 76 ; Nothing 77 ; Corrupts registers: 78 ; AX, DX 79 ;-------------------------------------------------------------------- 80 ALIGN JUMP_ALIGN 81 DisplayContext_SynchronizeToHardware: 82 call DisplayPage_SynchronizeToHardware 83 call DisplayCursor_SynchronizeShapeToHardware 84 jmp DisplayCursor_SynchronizeCoordinatesToHardware 65 85 66 86 … … 145 165 pop ds 146 166 ret 147 148 149 ;--------------------------------------------------------------------150 ; DisplayContext_SynchronizeToHardware151 ; Parameters:152 ; DS: BDA segment (zero)153 ; Returns:154 ; Nothing155 ; Corrupts registers:156 ; AX, DX157 ;--------------------------------------------------------------------158 ALIGN JUMP_ALIGN159 DisplayContext_SynchronizeToHardware:160 call DisplayPage_SynchronizeToHardware161 call DisplayCursor_SynchronizeShapeToHardware162 jmp DisplayCursor_SynchronizeCoordinatesToHardware163 167 164 168 -
trunk/Assembly_Library/Src/Display/DisplayCursor.asm
r41 r101 1 ; File name : DisplayCursor.asm2 1 ; Project name : Assembly Library 3 ; Created date : 26.6.20104 ; Last update : 15.7.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for managing display cursor. 7 3 … … 39 35 DisplayCursor_SetCoordinatesFromAX: 40 36 xchg dx, ax 41 call .ConvertOffsetToAXfromCoordinatesInDX 42 add ax, [VIDEO_BDA.wPageOffset] ; AX = Video RAM offset 37 mov ax, [VIDEO_BDA.wColumns] ; Column count, 40 or 80 38 mul dh ; AX = Column count * row index 39 xor dh, dh 40 add ax, dx ; Add column offset 41 shl ax, 1 ; Convert to WORD offset 42 add ax, [VIDEO_BDA.wPageOffset] ; AX = Video RAM offset 43 43 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], ax 44 44 xchg di, ax 45 ret46 47 ;--------------------------------------------------------------------48 ; .ConvertOffsetToAXfromCoordinatesInDX49 ; Parameters:50 ; DL: Cursor column (X-coordinate)51 ; DH: Cursor row (Y-coordinate)52 ; DS: BDA segment (zero)53 ; Returns:54 ; AX: Offset to cursor location in selected page55 ; Corrupts registers:56 ; Nothing57 ;--------------------------------------------------------------------58 ALIGN JUMP_ALIGN59 .ConvertOffsetToAXfromCoordinatesInDX:60 mov ax, [VIDEO_BDA.wColumns] ; Column count, 40 or 8061 mul dh ; AX = Column count * row index62 add al, dl ; Add column offset63 adc ah, 064 shl ax, 1 ; Convert to WORD offset65 45 ret 66 46 … … 145 125 int BIOS_VIDEO_INTERRUPT_10h 146 126 pop cx 147 ALIGN JUMP_ALIGN, ret148 127 .Return: 149 128 ret … … 175 154 ; AX, DX 176 155 ;-------------------------------------------------------------------- 177 ;ALIGN JUMP_ALIGN178 156 .SetHardwareCursorCoordinatesFromAX: 179 157 push bx -
trunk/Assembly_Library/Src/Display/DisplayFormat.asm
r48 r101 1 ; File name : DisplayFormat.asm2 1 ; Project name : Assembly Library 3 ; Created date : 29.6.20104 ; Last update : 8.10.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for displaying formatted strings. 7 3 … … 25 21 DisplayFormat_ParseCharacters: 26 22 call ReadCharacterAndTestForNull 27 jz SHORT .QuitCharacterParsing23 jz SHORT ReturnFromFormat 28 24 29 25 ePUSH_T cx, DisplayFormat_ParseCharacters ; Return address 30 26 xor cx, cx ; Initial placeholder size 31 27 cmp al, '%' ; Format specifier? 32 je SHORT ParseFormatSpecifier 33 jmp DisplayPrint_CharacterFromAL 34 35 ALIGN JUMP_ALIGN 36 .QuitCharacterParsing: 37 ret 38 28 jne SHORT DisplayPrint_CharacterFromAL 29 ; Fall to ParseFormatSpecifier 39 30 40 31 ;-------------------------------------------------------------------- … … 53 44 ; AX, BX, CX, DX 54 45 ;-------------------------------------------------------------------- 55 ALIGN JUMP_ALIGN56 46 ParseFormatSpecifier: 57 47 call ReadCharacterAndTestForNull 58 48 call Char_IsDecimalDigitInAL 59 jc SHORT .ParsePlaceholderSizeDigitFromALtoCX49 jc SHORT ParsePlaceholderSizeDigitFromALtoCX 60 50 call GetFormatSpecifierParserToAX 61 51 call ax ; Parser function … … 64 54 test cx, cx 65 55 jnz SHORT PrependOrAppendSpaces 66 ret 67 68 ;-------------------------------------------------------------------- 69 ; .ParsePlaceholderSizeDigitFromALtoCX 56 ReturnFromFormat: 57 ret 58 59 ;-------------------------------------------------------------------- 60 ; ParsePlaceholderSizeDigitFromALtoCX 70 61 ; Parameters: 71 62 ; AL: Digit character from format string … … 79 70 ;-------------------------------------------------------------------- 80 71 ALIGN JUMP_ALIGN 81 .ParsePlaceholderSizeDigitFromALtoCX:72 ParsePlaceholderSizeDigitFromALtoCX: 82 73 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di 83 74 sub al, '0' ; Digit '0'...'9' to integer 0...9 -
trunk/Assembly_Library/Src/Display/DisplayPage.asm
r41 r101 1 ; File name : DisplayPage.asm2 1 ; Project name : Assembly Library 3 ; Created date : 26.6.20104 ; Last update : 3.7.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for managing display page. 7 3 … … 63 59 mov ah, SELECT_ACTIVE_DISPLAY_PAGE 64 60 int BIOS_VIDEO_INTERRUPT_10h 65 ALIGN JUMP_ALIGN, ret66 61 .Return: 67 62 ret -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r67 r101 1 ; File name : Display.asm2 1 ; Project name : Assembly Library 3 ; Created date : 26.6.20104 ; Last update : 7.12.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for display output. 7 3
Note:
See TracChangeset
for help on using the changeset viewer.