⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 api1.asm

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 ASM
📖 第 1 页 / 共 5 页
字号:
        push    bx
        push    cx
        push    dx
        push    di
        push    es
        mov     dx,winhan+2[bp]
        load_dptr es,di,buffer[bp]

        mov     ax,beep[bp]             ; get beep flag
        and     ax,1
        shl     ax,1                    ; make room for button info
        shl     ax,1
        mov     bx,buttons[bp]          ; get button info
        and     bx,3
        or      ax,bx                   ; OR in beep flag
        ror     ax,1                    ; rotate to top of word
        ror     ax,1
        ror     ax,1

        mov     bx,lbuffer[bp]
        and     bx,1fffh
        or      bx,ax
        mov     cl,rows[bp]
        mov     ch,cols[bp]
        @call   disperor
        mov     ax,bx
        pop     es
        pop     di
        pop     dx
        pop     cx
        pop     bx
        pop     bp
        ret
    endfunc win_disp,eror

; api_endc
    function api_endc,
        @call   endc
        xor     ax,ax
        ret
    endfunc api_endc,

; api_freebit
    function api_free,bit
    frame
    arg mask_arg,word
        push    bp
        mov     bp,sp
        push    bx
        mov     bx,mask_arg[bp]
        @call   freebit
        pop     bx
        pop     bp
        xor     ax,ax
        ret
    endfunc api_free,bit

; api_getbit
    function api_getb,it
    frame
    arg entryp,cptr
        push    bp
        mov     bp,sp
        push    bx
        push    di
        push    es
        load_cptr es,di,entryp[bp]
        @call   getbit
        mov     ax,bx
        pop     es
        pop     di
        pop     bx
        pop     bp
        ret
    endfunc api_getb,it

; win_buffer
    function win_buff,er
    frame
    arg winhan,dword
    arg bufptr,ptr
    arg lbuf,ptr
        push    bp
        mov     bp,sp
        push    bx
        push    cx
        push    dx
        push    di
        push    es
        mov     bx,winhan+2[bp]
        @call   getbuf
        mov     ax,es                   ; return pointer to buffer
        load_dptr es,bx,bufptr[bp]
        mov     es:[bx],di
        mov     es:[bx+2],ax
        load_dptr es,bx,lbuf[bp]        ; return length of buffer
        mov     es:[bx],cx
        mov     al,dl
        xor     ah,ah
        pop     es
        pop     di
        pop     dx
        pop     cx
        pop     bx
        pop     bp
        ret
    endfunc win_buff,er

; api_kmouse
    function api_kmou,se
    frame
    arg request,word
        push    bp
        mov     bp,sp
        push    bx
        mov     ax,request[bp]
        mov     bl,2
        test    ax,ax
        jz      akm1
        dec     bl
akm1:   @call   kmouse
        xor     ax,ax
        pop     bx
        pop     bp
        ret
    endfunc api_kmou,se

; qry_kmouse
    function qry_kmou,se
    frame
    arg request,word
        push    bp
        mov     bp,sp
        push    bx
        mov     ax,request[bp]
        mov     bl,1
        test    al,al
        jnz     qkm1
        inc     bl
qkm1:   @call   kmouse
        mov     al,bl
        xor     ah,ah
        pop     bx
        pop     bp
        ret
    endfunc qry_kmou,se

; win_locate
    function win_loca,te
    frame
    arg winhan,dword
    arg row,word
    arg col,word
        push    bp
        mov     bp,sp
        push    es
        mov     es,winhan+2[bp]
        mov     bl,byte ptr row[bp]
        mov     bh,byte ptr col[bp]
        @call   locate
        mov     dx,es
        xor     ax,ax
        pop     es
        pop     bp
        fix_long
        ret
    endfunc win_loca,te

; api_pause
    function api_paus,e
        @call   pause
        xor     ax,ax
        ret
    endfunc api_paus,e

; tsk_post
    function tsk_post,
    frame
    arg winhan,dword
        push    bp
        mov     bp,sp
        push    bx
        mov     bx,winhan+2[bp]
        @call   posttask
        pop     bx
        pop     bp
        ret
    endfunc tsk_post,

; win_poswin
    function win_posw,in
    frame
    arg winhan,dword
    arg relhan,dword
    arg rmode,word
    arg rows,word
    arg cmode,word
    arg cols,word
    arg draw,word
        push    bp
        mov     bp,sp
        push    bx
        push    cx
        push    dx
        push    es
        mov     es,winhan+2[bp]
        mov     bx,relhan+2[bp]
        mov     dx,draw[bp]
        and     dx,1
        mov     cl,4
        shl     dl,cl
        mov     cx,rmode[bp]
        and     cl,3
        shl     cl,1
        shl     cl,1
        or      dl,cl
        mov     cx,cmode[bp]
        and     cl,3
        or      dl,cl
        mov     cx,rows[bp]
        mov     ax,cols[bp]
        mov     ch,al
        @call   poswin
        pop     es
        pop     dx
        pop     cx
        pop     bx
        xor     ax,ax
        pop     bp
        ret
    endfunc win_posw,in

; win_putc
    function win_putc,
    frame
    arg winhan,dword
    arg chr,word
    arg atr,word
        push    bp
        mov     bp,sp
        push    bx
        push    dx
        mov     bl,byte ptr chr[bp]
        mov     bh,byte ptr atr[bp]
        mov     dx,winhan+2[bp]
        @call   printc
        xor     ax,ax
        pop     dx
        pop     bx
        pop     bp
        ret
    endfunc win_putc,

; win_hcur
    function win_hcur,
    frame
    arg winhan,dword
        push    bp
        mov     bp,sp
        push    bx
        push    dx
        xor     bx,bx
        mov     dx,winhan+2[bp]
        @call   printc
        xor     ax,ax
        pop     dx
        pop     bx
        pop     bp
        ret
    endfunc win_hcur,

; api_setbit
    function api_setb,it
    frame
    arg mask_arg,word
        push    bp
        mov     bp,sp
        push    bx
        mov     bx,mask_arg[bp]
        @call   setbit
        xor     ax,ax
        pop     bx
        pop     bp
        ret
    endfunc api_setb,it

; api_sound
    function api_soun,d
    frame
    arg freq,word
    arg dura,word
        push    bp
        mov     bp,sp
        push    bx
        push    cx
        mov     bx,freq[bp]
        mov     cx,dura[bp]
        @call   sound
        xor     ax,ax
        pop     cx
        pop     bx
        pop     bp
        ret
    endfunc api_soun,d

; tsk_start
    function tsk_star,t
    frame
    arg winhan,dword
        push    bp
        mov     bp,sp
        push    es
        mov     es,winhan+2[bp]
        @call   start
        xor     ax,ax
        pop     es
        pop     bp
        ret
    endfunc tsk_star,t

; app_start
    function app_star,t
    frame
    arg pifb,ptr
    arg lpifb,word
        push    bp
        mov     bp,sp
        push    di
        push    es
        mov     bx,lpifb[bp]
        load_dptr es,di,pifb[bp]
        @call   newproc
        mov     dx,bx
        xor     ax,ax
        pop     es
        pop     di
        pop     bp
        fix_long
        ret
    endfunc app_star,t

; tsk_stop
    function tsk_stop,
    frame
    arg winhan,dword
        push    bp
        mov     bp,sp
        push    es
        mov     es,winhan+2[bp]
        @call   stop
        xor     ax,ax
        pop     es
        pop     bp
        ret
    endfunc tsk_stop,

; win_open
    function win_open,
        push    bx
        mov     bx,dvm_open*256+dva_tos
        jmp     short ep_han_int
    endfunc win_open,

; ptr_subfrom
    function ptr_subf,rom
        jmp     short do_key_subfrom
    endfunc ptr_subf,rom

; key_subfrom
    function key_subf,rom
do_key_subfrom:
        push    bx
        mov     bx,dvm_subfrom*256+dva_tos
        jmp     short ep_han_int
    endfunc key_subf,rom

; ptr_addto
    function ptr_addt,o
        jmp     short do_key_addto
    endfunc ptr_addt,o

; key_addto
    function key_addt,o
    frame 1
    arg keyhan,dword
    arg flags,word
do_key_addto:
        push    bx
        mov     bx,dvm_addto*256+dva_tos
ep_han_int:
        push    bp
        mov     bp,sp
        xor     ax,ax
        push    ax
        push    flags[bp]
        push    keyhan+2[bp]
        push    keyhan[bp]
        mov     ah,12h
        int     15h
        xor     ax,ax
        pop     bp
        pop     bx
        ret
    endfunc key_addt,o

; mal_erase
    function mal_eras,e
        jmp     short do_key_erase
    endfunc mal_eras,e

; ptr_erase
    function ptr_eras,e
        jmp     short do_key_erase
    endfunc ptr_eras,e

; tim_erase
    function tim_eras,e
        jmp     short do_key_erase
    endfunc tim_eras,e

; win_erase
    function win_eras,e
        jmp     short do_key_erase
    endfunc win_eras,e

; key_erase
    function key_eras,e
do_key_erase:
        push    bx
        mov     bx,dvm_erase*256+dva_tos
        jmp     short ep_han
    endfunc key_eras,e

; mal_free
    function mal_free,
        jmp     short do_key_free
    endfunc mal_free,

; pan_free
    function pan_free,
        jmp     short do_key_free
    endfunc pan_free,

; ptr_free
    function ptr_free,
        jmp     short do_key_free
    endfunc ptr_free,

; tim_free
    function tim_free,
        jmp     short do_key_free
    endfunc tim_free,

; win_free
    function win_free,
        jmp     short do_key_free
    endfunc win_free,

; tsk_free
    function tsk_free,
        jmp     short do_key_free
    endfunc tsk_free,

; app_free
    function app_free,
        jmp     short do_key_free
    endfunc app_free,

; key_free
    function key_free,
do_key_free:
        push    bx
        mov     bx,dvm_free*256+dva_tos
        jmp     short ep_han
    endfunc key_free,

; mal_close
    function mal_clos,e
        jmp     short do_key_close
    endfunc mal_clos,e

; mal_unlock
    function mal_unlo,ck
        jmp     short do_key_close
    endfunc mal_unlo,ck

; pan_close
    function pan_clos,e
        jmp     short do_key_close
    endfunc pan_clos,e

; ptr_close
    function ptr_clos,e
        jmp     short do_key_close
    endfunc ptr_clos,e

; tim_close
    function tim_clos,e
        jmp     short do_key_close
    endfunc tim_clos,e

; key_close
    function key_clos,e
    frame 1
    arg keyhan,dword
do_key_close:
        push    bx
        mov     bx,dvm_close*256+dva_tos
ep_han:
        push    bp
        mov     bp,sp
        push    keyhan+2[bp]
        push    keyhan[bp]
        mov     ah,12h
        int     15h
        xor     ax,ax
        pop     bp
        mov     dx,bx

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -