Changeset 42059 in vbox for trunk/src/VBox/Devices/PC/BIOS
- Timestamp:
- Jul 9, 2012 1:33:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/support.asm
r41654 r42059 21 21 ;******************************************************************************* 22 22 public __U4D 23 public __U4M 24 ifndef VBOX_PC_BIOS 23 25 public __I4D 24 public __U4M 26 public __I4M 27 endif 25 28 public _fmemset_ 26 29 public _fmemcpy_ … … 74 77 75 78 79 ifndef VBOX_PC_BIOS 80 ;; 81 ; 32-bit signed division. 82 ; 83 ; @param dx:ax Dividend. 84 ; @param cx:bx Divisor. 85 ; @returns dx:ax Quotient. 86 ; cx:bx Reminder. 87 ; 88 __I4D: 89 pushf 90 push eax 91 push edx 92 push ecx 93 94 rol eax, 16 95 mov ax, dx 96 ror eax, 16 97 xor edx, edx 98 99 shr ecx, 16 100 mov cx, bx 101 102 idiv ecx ; eax:edx / ecx -> eax=quotient, edx=reminder. 103 104 mov bx, dx 105 pop ecx 106 shr edx, 16 107 mov cx, dx 108 109 pop edx 110 ror eax, 16 111 mov dx, ax 112 add sp, 2 113 pop ax 114 rol eax, 16 115 116 popf 117 ret 118 endif ; VBOX_PC_BIOS 119 120 76 121 ;; 77 122 ; 32-bit unsigned multiplication. … … 108 153 popf 109 154 ret 155 156 157 ifndef VBOX_PC_BIOS 158 ;; 159 ; 32-bit unsigned multiplication. 160 ; memset taking a far pointer. 161 ; 162 ; @param dx:ax Factor 1. 163 ; @param cx:bx Factor 2. 164 ; @returns dx:ax Result. 165 ; cx, es may be modified; di is preserved 166 ; 167 __I4M: 168 pushf 169 push eax 170 push edx 171 push ecx 172 push ebx 173 174 rol eax, 16 175 mov ax, dx 176 ror eax, 16 177 xor edx, edx 178 179 shr ecx, 16 180 mov cx, bx 181 182 imul ecx ; eax * ecx -> edx:eax 183 184 pop ebx 185 pop ecx 186 187 pop edx 188 ror eax, 16 189 mov dx, ax 190 add sp, 2 191 pop ax 192 rol eax, 16 193 194 popf 195 ret 196 endif ; VBOX_PC_BIOS 110 197 111 198
Note:
See TracChangeset
for help on using the changeset viewer.