Ignore:
Timestamp:
Sep 17, 2010, 11:45:29 AM (15 years ago)
Author:
markus
Message:

Changed wmakefile to use link.exe and alp.exe (Assembler) from DDK, now it compiles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/init.asm

    r14 r16  
    1717                PUBLIC  _engine_hook         ; engine trigger context hook
    1818                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
    1923                PUBLIC  _end_of_data         ; end of all data (label)
    2024                PUBLIC  _end_of_code         ; end of all code (label)
    21 
     25       
    2226; ----------------------------------------------------------------------------
    2327; Device Driver Header
     
    327331_engine_hook    ENDP
    328332
     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       
    329399                .286
    330400
Note: See TracChangeset for help on using the changeset viewer.