Changeset 105 in xtideuniversalbios for trunk/Assembly_Library/Src/Util
- Timestamp:
- Feb 17, 2011, 2:52:42 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library/Src/Util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Util/Memory.asm
r103 r105 66 66 push di 67 67 push ax 68 Registers_CopySSBPtoESDI68 call Registers_CopySSBPtoESDI 69 69 call Memory_ZeroESDIwithSizeInCX 70 70 pop ax -
trunk/Assembly_Library/Src/Util/Registers.asm
r103 r105 1 1 ; Project name : Assembly Library 2 2 ; Description : Functions for register operations. 3 4 ;--------------------------------------------------------------------5 ; NORMALIZE_FAR_POINTER6 ; Parameters:7 ; %1:%2: Far pointer to normalize8 ; %3: Scratch register9 ; %4: Scratch register10 ; Returns:11 ; %1:%2: Normalized far pointer12 ; Corrupts registers:13 ; %3, %414 ;--------------------------------------------------------------------15 %macro NORMALIZE_FAR_POINTER 416 mov %4, %2 ; Copy offset to scratch reg17 and %2, BYTE 0Fh ; Clear offset bits 15...418 eSHR_IM %4, 4 ; Divide offset by 1619 mov %3, %1 ; Copy segment to scratch reg20 add %3, %4 ; Add shifted offset to segment21 mov %1, %3 ; Set normalized segment22 %endmacro23 3 24 4 25 5 ; Section containing code 26 6 SECTION .text 27 28 ;--------------------------------------------------------------------29 ; Registers_NormalizeDSSI30 ; Registers_NormalizeESDI31 ; Parameters32 ; DS:SI or ES:DI: Ptr to normalize33 ; Returns:34 ; DS:SI or ES:DI: Normalized pointer35 ; Corrupts registers:36 ; Nothing37 ;--------------------------------------------------------------------38 ALIGN JUMP_ALIGN39 Registers_NormalizeDSSI:40 push dx41 push ax42 NORMALIZE_FAR_POINTER ds, si, ax, dx43 pop ax44 pop dx45 ret46 47 ALIGN JUMP_ALIGN48 Registers_NormalizeESDI:49 push dx50 push ax51 NORMALIZE_FAR_POINTER es, di, ax, dx52 pop ax53 pop dx54 ret55 56 7 57 8 ;-------------------------------------------------------------------- … … 76 27 ;-------------------------------------------------------------------- 77 28 ; Registers_CopySSBPtoESDI 78 ; Registers_CopySSBPtoDSSI 79 ; Registers_CopyDSSItoESDI 80 ; Registers_CopyESDItoDSSI 29 ; Registers_CopySSBPtoDSSI (uncommented to save bytes) 30 ; Registers_CopyDSSItoESDI (uncommented to save bytes) 31 ; Registers_CopyESDItoDSSI (uncommented to save bytes) 81 32 ; Parameters 82 33 ; Nothing … … 86 37 ; Nothing 87 38 ;-------------------------------------------------------------------- 88 %macro Registers_CopySSBPtoESDI 0 89 push ss 90 pop es 91 mov di, bp 92 %endmacro 39 ALIGN JUMP_ALIGN 40 Registers_CopySSBPtoESDI: 41 COPY_SSBP_TO_ESDI 42 ret 93 43 94 %macro Registers_CopySSBPtoDSSI 0 95 push ss 96 pop ds 97 mov si, bp 98 %endmacro 44 ;ALIGN JUMP_ALIGN 45 ;Registers_CopySSBPtoDSSI: 46 ; COPY_SSBP_TO_DSSI 47 ; ret 99 48 100 %macro Registers_CopyDSSItoESDI 0 101 push ds 102 pop es 103 mov di, si 104 %endmacro 49 ;ALIGN JUMP_ALIGN 50 ;Registers_CopyDSSItoESDI: 51 ; COPY_DSSI_TO_ESDI 52 ; ret 105 53 106 %macro Registers_CopyESDItoDSSI 0 107 push es 108 pop ds 109 mov si, di 110 %endmacro 54 ;ALIGN JUMP_ALIGN 55 ;Registers_CopyESDItoDSSI: 56 ; COPY_ESDI_to_DSSI 57 ; ret 111 58 112 59 113 60 ;-------------------------------------------------------------------- 114 ; Registers_SetZFifNullPointerInDSSI 61 ; Registers_SetZFifNullPointerInDSSI (uncommented to save bytes) 115 62 ; Parameters 116 63 ; DS:SI: Far pointer … … 120 67 ; Nothing 121 68 ;-------------------------------------------------------------------- 122 ALIGN JUMP_ALIGN123 Registers_SetZFifNullPointerInDSSI:124 push ax125 mov ax, ds126 or ax, si127 pop ax128 ret69 ;ALIGN JUMP_ALIGN 70 ;Registers_SetZFifNullPointerInDSSI: 71 ; push ax 72 ; mov ax, ds 73 ; or ax, si 74 ; pop ax 75 ; ret
Note:
See TracChangeset
for help on using the changeset viewer.