Changeset 101 in xtideuniversalbios for trunk/Assembly_Library/Src/Display/DisplayCursor.asm
- Timestamp:
- Jan 31, 2011, 7:03:22 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.