Annotation of src/whasm.asm, revision 1.1

1.1     ! root        1: ;/***************************************************************************
        !             2: ; *   TEKASM.ASM  - assembly code for Tekwar game                           *
        !             3: ; *                                                                         *
        !             4: ; *                                                      3/29/95 Jeff S.    *
        !             5: ; ***************************************************************************/
        !             6:                                         
        !             7: ; WATCOM C/C++ Assembler (WASM.EXE) Template.
        !             8: ; Written by Keith Harrison CIS:100431,1675 16th Nov 1994.
        !             9: 
        !            10:                                  
        !            11:                  .586p     ; 386, 486, Pentium
        !            12: 
        !            13:                  ; Declare non-parameter registers that you alter as
        !            14:                  ; a #pragma in the C++ file.
        !            15: 
        !            16:                  ASSUME  CS:_TEXT
        !            17:                  ASSUME  DS:_DATA
        !            18: 
        !            19: 
        !            20: _DATA           SEGMENT 'DATA' USE32
        !            21: 
        !            22: return_code     dd      0
        !            23: integer_data    dd      0
        !            24: 
        !            25: _DATA           ENDS
        !            26: 
        !            27: 
        !            28: _TEXT           SEGMENT PUBLIC 'CODE' USE32
        !            29: 
        !            30: ;
        !            31: ; (template to follow)
        !            32: ;
        !            33: ;     On entry: eax = pointer to integer number,
        !            34: ;               ebx = value to store at address eax.
        !            35: ;
        !            36: ;asm_main_       PROC    NEAR
        !            37: ;                
        !            38: ;                call    protected_code  ; Call your own code...
        !            39: ;                cld                     ; Direction bit must be clear on exit.
        !            40: ;                mov     eax, [return_code]; EAX = return value (if required).
        !            41: ;                ret
        !            42: ;
        !            43: ;asm_main_       ENDP
        !            44: 
        !            45:                                         PUBLIC  asmwaitvrt_      ; Note underscore AFTER function name.
        !            46: 
        !            47: asmwaitvrt_     PROC    NEAR
        !            48:                                         
        !            49: @@wait:
        !            50:                                         xor     edx,edx
        !            51:                                         xor     eax,eax
        !            52:                                         xor dx, 0x03DA
        !            53: 
        !            54:                                         ; ecx loaded via param
        !            55: 
        !            56:                                         ; wait for a display signal to make sure the raster isn't 
        !            57:                                         ; in the middle of a sync
        !            58: @@waitnosync:
        !            59:                        in al,dx
        !            60:                          test   al,8
        !            61:                          jnz @@waitnosync
        !            62: 
        !            63: @@waitsync:
        !            64:                        in al,dx
        !            65:                          test   al,8
        !            66:                          jz  @@waitsync
        !            67: 
        !            68:                          loop   @@waitnosync
        !            69: 
        !            70:                                         cld                      ; Direction bit must be clear on exit.
        !            71:                                         ret
        !            72: 
        !            73: asmwaitvrt_     ENDP
        !            74: 
        !            75:                                         PUBLIC  asmsetpalette_ 
        !            76: 
        !            77: asmsetpalette_  PROC    NEAR
        !            78:                                         
        !            79:                                         ; pal ptr passed in esi
        !            80:                                         xor     eax, eax
        !            81:                          mov edx,0x000003C8   ; PEL_WRITE_ADR
        !            82:                          out dx,al
        !            83:                          mov edx,0x000003C9   ; PEL_DATA
        !            84: 
        !            85:                                         mov  cx,256
        !            86: @@setloop:
        !            87:                        lodsb
        !            88:                          out dx,al
        !            89:                        lodsb
        !            90:                        out   dx,al
        !            91:                        lodsb
        !            92:                        out   dx,al
        !            93:                        loop  @@setloop
        !            94: 
        !            95:                                         cld      
        !            96:                                         ret
        !            97: 
        !            98: asmsetpalette_  ENDP
        !            99: 
        !           100: _TEXT           ENDS
        !           101: 
        !           102:                                         END

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.