Changeset 16 for trunk/src/os2ahci/init.asm
- Timestamp:
- Sep 17, 2010, 11:45:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/init.asm
r14 r16 17 17 PUBLIC _engine_hook ; engine trigger context hook 18 18 PUBLIC _dev_hdr ; device driver header 19 PUBLIC __I4M ; 32bit signed multiply routine 20 PUBLIC __U4M ; 32bit unsigned multiply routine 21 PUBLIC __U4D ; 32bit unsigned divide routine 22 PUBLIC __I4D ; 32bit signed multiply routine 19 23 PUBLIC _end_of_data ; end of all data (label) 20 24 PUBLIC _end_of_code ; end of all code (label) 21 25 22 26 ; ---------------------------------------------------------------------------- 23 27 ; Device Driver Header … … 327 331 _engine_hook ENDP 328 332 333 334 ; Unsigned long divide routine; 335 ; taken from OS/2 Uniaud project, original author: Timur Tabi 336 __U4D proc near 337 shl edx,10h ;; Load dx:ax into eax 338 mov dx,ax 339 mov eax,edx 340 xor edx,edx ;; Zero extend eax into edx 341 shl ecx,10h ;; Load cx:bx into ecx 342 mov cx,bx 343 div ecx ;; Divide eax/ecx into eax 344 mov ecx,edx ;; Load edx into cx:bx 345 shr ecx,10h 346 mov bx,dx 347 mov edx,eax ;; Load eax into dx:ax 348 shr edx,10h 349 ret 350 __U4D endp 351 352 ; Long multiply routine; 353 ; taken from OS/2 Uniaud project, original author: Timur Tabi 354 __U4M proc near 355 shl edx,10h ;; Load dx:ax into eax 356 mov dx,ax 357 mov eax,edx 358 mov dx,cx ;; Load cx:bx into edx 359 shl edx,10h 360 mov dx,bx 361 mul edx ;; Multiply eax*edx into edx:eax 362 mov edx,eax ;; Load eax into dx:ax 363 shr edx,10h 364 ret 365 __U4M endp 366 367 __I4M proc near 368 shl edx,10h ;; Load dx:ax into eax 369 mov dx,ax 370 mov eax,edx 371 mov dx,cx ;; Load cx:bx into edx 372 shl edx,10h 373 mov dx,bx 374 mul edx ;; Multiply eax*edx into edx:eax 375 mov edx,eax ;; Load eax into dx:ax 376 shr edx,10h 377 ret 378 __I4M endp 379 380 381 ; Signed long divide routine; 382 ; taken from OS/2 Uniaud project, original author: Timur Tabi 383 __I4D proc near 384 shl edx,10h ;; Load dx:ax into eax 385 mov dx,ax 386 mov eax,edx 387 cdq ;; Sign extend eax into edx 388 shl ecx,10h ;; Load cx:bx into ecx 389 mov cx,bx 390 idiv ecx ;; Divide eax/ecx into eax 391 mov ecx,edx ;; Load edx into cx:bx 392 shr ecx,10h 393 mov bx,dx 394 mov edx,eax ;; Load eax into dx:ax 395 shr edx,10h 396 ret 397 __I4D endp 398 329 399 .286 330 400
Note:
See TracChangeset
for help on using the changeset viewer.