Changeset 66 in xtideuniversalbios for trunk/Assembly_Library/Src/Util
- Timestamp:
- Dec 6, 2010, 7:09:51 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Util/Registers.asm
r64 r66 2 2 ; Project name : Assembly Library 3 3 ; Created date : 24.10.2010 4 ; Last update : 24.10.20104 ; Last update : 6.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for register operations. 7 7 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 8 29 ; Section containing code 9 30 SECTION .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 ;-------------------------------------------------------------------- 42 ALIGN JUMP_ALIGN 43 Registers_NormalizeDSSI: 44 push dx 45 push ax 46 NORMALIZE_FAR_POINTER ds, si, ax, dx 47 pop ax 48 pop dx 49 ret 50 51 ALIGN JUMP_ALIGN 52 Registers_NormalizeESDI: 53 push dx 54 push ax 55 NORMALIZE_FAR_POINTER es, di, ax, dx 56 pop ax 57 pop dx 58 ret 59 10 60 11 61 ;-------------------------------------------------------------------- … … 85 135 pop ax 86 136 ret 87 88 89 ALIGN JUMP_ALIGN90 Registers_SetCFifCXisZero:91
Note:
See TracChangeset
for help on using the changeset viewer.