Changeset 101 in xtideuniversalbios for trunk/Assembly_Library/Src/Display/DisplayCursor.asm


Ignore:
Timestamp:
Jan 31, 2011, 7:03:22 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Some minor size optimizations to Display Library.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Display/DisplayCursor.asm

    r41 r101  
    1 ; File name     :   DisplayCursor.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   26.6.2010
    4 ; Last update   :   15.7.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Functions for managing display cursor.
    73
     
    3935DisplayCursor_SetCoordinatesFromAX:
    4036    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
    4343    mov     [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], ax
    4444    xchg    di, ax
    45     ret
    46 
    47 ;--------------------------------------------------------------------
    48 ; .ConvertOffsetToAXfromCoordinatesInDX
    49 ;   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 page
    55 ;   Corrupts registers:
    56 ;       Nothing
    57 ;--------------------------------------------------------------------
    58 ALIGN JUMP_ALIGN
    59 .ConvertOffsetToAXfromCoordinatesInDX:
    60     mov     ax, [VIDEO_BDA.wColumns]        ; Column count, 40 or 80
    61     mul     dh                              ; AX = Column count * row index
    62     add     al, dl                          ; Add column offset
    63     adc     ah, 0
    64     shl     ax, 1                           ; Convert to WORD offset
    6545    ret
    6646
     
    145125    int     BIOS_VIDEO_INTERRUPT_10h
    146126    pop     cx
    147 ALIGN JUMP_ALIGN, ret
    148127.Return:
    149128    ret
     
    175154;       AX, DX
    176155;--------------------------------------------------------------------
    177 ;ALIGN JUMP_ALIGN
    178156.SetHardwareCursorCoordinatesFromAX:
    179157    push    bx
Note: See TracChangeset for help on using the changeset viewer.