Changeset 149 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Apr 29, 2011, 6:58:11 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Added pointer normalization functions
Location:
trunk/Assembly_Library
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Registers.inc

    r146 r149  
    8888
    8989;--------------------------------------------------------------------
     90; This macro must be the first thing to call on Interrupt Service Routine.
     91; Extra words will be initialized to zero.
     92;
     93; SAVE_AND_GET_INTPACK_WITH_EXTRA_WORDS_TO_SSBP
     94;   Parameters
     95;       %1:     Number of extra words to reserve before INTPACK
     96;   Returns:
     97;       SS:BP:  Points to INTPACK
     98;   Corrupts registers:
     99;       Nothing
     100;--------------------------------------------------------------------
     101%macro SAVE_AND_GET_INTPACK_WITH_EXTRA_WORDS_TO_SSBP 1
     102    ePUSHA
     103    push    ds
     104    push    es
     105%ifdef USE_386
     106    push    fs
     107    push    gs
     108%endif
     109    xor     bp, bp
     110    times %1 push bp        ; Initialize to zero
     111    mov     bp, sp
     112%endmacro
     113
     114;--------------------------------------------------------------------
     115; This macro must be the last thing to call on Interrupt Service Routine.
     116;
     117; RESTORE_INTPACK_WITH_EXTRA_WORDS_FROM_SSBP
     118;   Parameters
     119;       %1:     Number of extra words in INTPACK
     120;       SS:BP:  Ptr to INTPACK
     121;   Returns:
     122;       All Registers will be loaded from INTPACK
     123;--------------------------------------------------------------------
     124%macro RESTORE_INTPACK_WITH_EXTRA_WORDS_FROM_SSBP 1
     125    add     sp, BYTE (%1)*2
     126%ifdef USE_386
     127    pop     gs
     128    pop     fs
     129%endif
     130    pop     es
     131    pop     ds
     132    ePOPA
     133    iret
     134%endmacro
     135
     136
     137;--------------------------------------------------------------------
    90138; NORMALIZE_FAR_POINTER
    91139;   Parameters:
  • trunk/Assembly_Library/Src/Util/Registers.asm

    r131 r149  
    6161
    6262;--------------------------------------------------------------------
     63; Registers_NormalizeESSI
     64; Registers_NormalizeESDI
     65;   Parameters
     66;       DS:SI or ES:DI: Ptr to normalize
     67;   Returns:
     68;       DS:SI or ES:DI: Normalized pointer
     69;   Corrupts registers:
     70;       AX, CX
     71;--------------------------------------------------------------------
     72ALIGN JUMP_ALIGN
     73Registers_NormalizeESSI:
     74    NORMALIZE_FAR_POINTER es, si, ax, cx
     75    ret
     76
     77ALIGN JUMP_ALIGN
     78Registers_NormalizeESDI:
     79    NORMALIZE_FAR_POINTER es, di, ax, cx
     80    ret
     81
     82
     83;--------------------------------------------------------------------
    6384; Registers_SetZFifNullPointerInDSSI (commented to save bytes)
    6485;   Parameters
  • trunk/Assembly_Library/makefile

    r145 r149  
    1919
    2020# Assembly source code file (*.asm):
    21 #SRC_ASM = Src/LibraryTests.asm
    22 SRC_ASM = Src/LibSizeCheck.asm
     21SRC_ASM = Src/LibraryTests.asm
     22#SRC_ASM = Src/LibSizeCheck.asm
    2323
    2424# Program executable file name without extension:
Note: See TracChangeset for help on using the changeset viewer.