Changeset 66 in xtideuniversalbios for trunk/Assembly_Library/Src/Util


Ignore:
Timestamp:
Dec 6, 2010, 7:09:51 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Added File Library functions for reading and writing more than 64kbytes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Util/Registers.asm

    r64 r66  
    22; Project name  :   Assembly Library
    33; Created date  :   24.10.2010
    4 ; Last update   :   24.10.2010
     4; Last update   :   6.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for register operations.
    77
     8;--------------------------------------------------------------------
     9; NORMALIZE_FAR_POINTER
     10;   Parameters:
     11;       %1:%2:      Far pointer to normalize
     12;       %3:         Scratch register
     13;       %4:         Scratch register
     14;   Returns:
     15;       %1:%2:      Normalized far pointer
     16;   Corrupts registers:
     17;       %3, %4
     18;--------------------------------------------------------------------
     19%macro NORMALIZE_FAR_POINTER 4
     20    mov     %4, %2              ; Copy offset to scratch reg
     21    and     %2, BYTE 0Fh        ; Clear offset bits 15...4
     22    eSHR_IM %4, 4               ; Divide offset by 16
     23    mov     %3, %1              ; Copy segment to scratch reg
     24    add     %3, %4              ; Add shifted offset to segment
     25    mov     %1, %3              ; Set normalized segment
     26%endmacro
     27
     28
    829; Section containing code
    930SECTION .text
     31
     32;--------------------------------------------------------------------
     33; Registers_NormalizeDSSI
     34; Registers_NormalizeESDI
     35;   Parameters
     36;       DS:SI or ES:DI: Ptr to normalize
     37;   Returns:
     38;       DS:SI or ES:DI: Normalized pointer
     39;   Corrupts registers:
     40;       Nothing
     41;--------------------------------------------------------------------
     42ALIGN JUMP_ALIGN
     43Registers_NormalizeDSSI:
     44    push    dx
     45    push    ax
     46    NORMALIZE_FAR_POINTER ds, si, ax, dx
     47    pop     ax
     48    pop     dx
     49    ret
     50
     51ALIGN JUMP_ALIGN
     52Registers_NormalizeESDI:
     53    push    dx
     54    push    ax
     55    NORMALIZE_FAR_POINTER es, di, ax, dx
     56    pop     ax
     57    pop     dx
     58    ret
     59
    1060
    1161;--------------------------------------------------------------------
     
    85135    pop     ax
    86136    ret
    87 
    88    
    89 ALIGN JUMP_ALIGN
    90 Registers_SetCFifCXisZero:
    91    
Note: See TracChangeset for help on using the changeset viewer.