Changeset 592 in xtideuniversalbios for trunk/Assembly_Library/Inc/Math.inc
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/Math.inc
r589 r592 23 23 jb %%Return ; If so, return 24 24 mov %1, %2 ; Copy %2 to %1 25 ALIGN JUMP_ALIGN26 25 %%Return: 27 26 %endmacro … … 31 30 jl %%Return ; If so, return 32 31 mov %1, %2 ; Copy %2 to %1 33 ALIGN JUMP_ALIGN34 32 %%Return: 35 33 %endmacro … … 51 49 ja %%Return ; If so, return 52 50 mov %1, %2 ; Copy %2 to %1 53 ALIGN JUMP_ALIGN54 51 %%Return: 55 52 %endmacro … … 59 56 jg %%Return ; If so, return 60 57 mov %1, %2 ; Copy %2 to %1 61 ALIGN JUMP_ALIGN62 58 %%Return: 63 59 %endmacro … … 67 63 ; SHL_DXAX 68 64 ; Parameters: 69 ; %1: Number of bits to shift 65 ; %1: Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value. 70 66 ; Returns: 71 67 ; DX:AX Shifted value … … 74 70 ;-------------------------------------------------------------------- 75 71 %macro SHL_DXAX 1 72 %ifdef USE_386 76 73 %ifnidni %1, cx 74 ; %1 is CL or an immediate 75 shld dx, ax, %1 76 shl ax, %1 77 %else 78 ; %1 is CX 79 shld dx, ax, cl 80 shl ax, cl 81 %endif 82 %else 83 %ifidni %1, cl 84 ; %1 is CL 85 xor ch, ch 86 %elifnidni %1, cx 87 ; %1 is an immediate 77 88 mov cx, %1 78 89 %endif … … 82 93 eRCL_IM dx, 1 83 94 loop .ShiftNextBit 95 %endif 84 96 %endmacro 85 97 … … 88 100 ; SHR_DXAX 89 101 ; Parameters: 90 ; %1: Number of bits to shift 102 ; %1: Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value. 91 103 ; Returns: 92 104 ; DX:AX Shifted value … … 95 107 ;-------------------------------------------------------------------- 96 108 %macro SHR_DXAX 1 109 %ifdef USE_386 97 110 %ifnidni %1, cx 111 ; %1 is CL or an immediate 112 shrd ax, dx, %1 113 shr dx, %1 114 %else 115 ; %1 is CX 116 shrd ax, dx, cl 117 shr dx, cl 118 %endif 119 %else 120 %ifidni %1, cl 121 ; %1 is CL 122 xor ch, ch 123 %elifnidni %1, cx 124 ; %1 is an immediate 98 125 mov cx, %1 99 126 %endif … … 103 130 rcr ax, 1 104 131 loop .ShiftNextBit 132 %endif 105 133 %endmacro 106 134
Note:
See TracChangeset
for help on using the changeset viewer.