定时器过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.386
.model flat, stdcall
option casemap :none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Include 文件定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Equ 等值定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IDD_DIALOG1 equ 101
IDC_IOSHOW equ 1000
IDC_IOFLOW equ 1001
IDC_EDIT equ 1002
ID_START equ 1003
ID_STOP equ 1004
ID_TIMER equ 2
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 数据段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data?
hInstance dd ?
hWinMain dd ?
hWinStart dd ?
hWinStop dd ?
idTimer dd ?
bRecentVal db ?
bShowVal db ?
F_RADIO dd ?
F_STOP equ 0001h
F_START equ 0002h
A_ADDR equ 0060h
.data
IO_PORT dw 0d000h
.const
szInit db '显示数字',0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 代码段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;定时器过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProcTimer proc _hWnd,_uMsg,_idEvent,_dwTime
pushad
mov dx,IO_PORT
in al,dx
.if F_RADIO == 2
and al,01h
.if al == bRecentVal
.if al == 0;from left to right
ror bShowVal,1
.else
rol bShowVal,1
.endif
.else
mov bRecentVal,al
.if al == 0
mov bShowVal,80h
.else
mov bShowVal,1h
.endif
.endif
mov al,bShowVal
.endif
out dx,al
movzx eax,al
invoke SetDlgItemInt,hWinMain,IDC_EDIT,eax,FALSE
popad
ret
_ProcTimer endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProcDlgMain proc uses ebx edi esi hWnd,wMsg,wParam,lParam
mov eax,wMsg
;********************************************************************
.if eax == WM_COMMAND
mov eax,wParam
.if ax == ID_START
.if F_RADIO ==1 || F_RADIO ==2
invoke SetTimer,NULL,NULL,1000,offset _ProcTimer
.if idTimer
invoke KillTimer,NULL,idTimer
.endif
mov idTimer,eax
invoke EnableWindow,hWinStart,FALSE
invoke EnableWindow,hWinStop,TRUE
.endif
.elseif ax == ID_STOP
invoke KillTimer,NULL,idTimer
invoke EnableWindow,hWinStop,FALSE
invoke EnableWindow,hWinStart,TRUE
.elseif ax == IDC_IOSHOW
invoke EnableWindow,hWinStart,TRUE
invoke EnableWindow,hWinStop,FALSE
mov F_RADIO,1
.elseif ax == IDC_IOFLOW
invoke EnableWindow,hWinStart,TRUE
invoke EnableWindow,hWinStop,FALSE
mov F_RADIO,2
.endif
;********************************************************************
.elseif eax == WM_CLOSE
invoke KillTimer,NULL,idTimer
invoke EndDialog,hWnd,NULL
;********************************************************************
.elseif eax == WM_INITDIALOG
push hWnd
pop hWinMain
invoke GetDlgItem,hWnd,ID_START
mov hWinStart,eax
invoke GetDlgItem,hWnd,ID_STOP
mov hWinStop,eax
add IO_PORT,A_ADDR
mov F_RADIO,0
mov idTimer,0
invoke SetDlgItemText,hWnd,IDC_EDIT,addr szInit
;********************************************************************
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
_ProcDlgMain endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,eax,IDD_DIALOG1,NULL,offset _ProcDlgMain,NULL
invoke ExitProcess,NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end start
;***************************************************************************
怎么我的invoke SetTimer,NULL,NULL,1000,offset _ProcTimer
为什么这个基于过程的定时器不起作用
而设置基于窗口的定时器,
象SetTimer,hWnd,,idEvent,offset _ProcTimer这样就没有这样的问题
谁能看出来,程序哪里出毛病了吗!!!!!!!
.386
.model flat, stdcall
option casemap :none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Include 文件定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Equ 等值定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IDD_DIALOG1 equ 101
IDC_IOSHOW equ 1000
IDC_IOFLOW equ 1001
IDC_EDIT equ 1002
ID_START equ 1003
ID_STOP equ 1004
ID_TIMER equ 2
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 数据段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data?
hInstance dd ?
hWinMain dd ?
hWinStart dd ?
hWinStop dd ?
idTimer dd ?
bRecentVal db ?
bShowVal db ?
F_RADIO dd ?
F_STOP equ 0001h
F_START equ 0002h
A_ADDR equ 0060h
.data
IO_PORT dw 0d000h
.const
szInit db '显示数字',0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 代码段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;定时器过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProcTimer proc _hWnd,_uMsg,_idEvent,_dwTime
pushad
mov dx,IO_PORT
in al,dx
.if F_RADIO == 2
and al,01h
.if al == bRecentVal
.if al == 0;from left to right
ror bShowVal,1
.else
rol bShowVal,1
.endif
.else
mov bRecentVal,al
.if al == 0
mov bShowVal,80h
.else
mov bShowVal,1h
.endif
.endif
mov al,bShowVal
.endif
out dx,al
movzx eax,al
invoke SetDlgItemInt,hWinMain,IDC_EDIT,eax,FALSE
popad
ret
_ProcTimer endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProcDlgMain proc uses ebx edi esi hWnd,wMsg,wParam,lParam
mov eax,wMsg
;********************************************************************
.if eax == WM_COMMAND
mov eax,wParam
.if ax == ID_START
.if F_RADIO ==1 || F_RADIO ==2
invoke SetTimer,NULL,NULL,1000,offset _ProcTimer
.if idTimer
invoke KillTimer,NULL,idTimer
.endif
mov idTimer,eax
invoke EnableWindow,hWinStart,FALSE
invoke EnableWindow,hWinStop,TRUE
.endif
.elseif ax == ID_STOP
invoke KillTimer,NULL,idTimer
invoke EnableWindow,hWinStop,FALSE
invoke EnableWindow,hWinStart,TRUE
.elseif ax == IDC_IOSHOW
invoke EnableWindow,hWinStart,TRUE
invoke EnableWindow,hWinStop,FALSE
mov F_RADIO,1
.elseif ax == IDC_IOFLOW
invoke EnableWindow,hWinStart,TRUE
invoke EnableWindow,hWinStop,FALSE
mov F_RADIO,2
.endif
;********************************************************************
.elseif eax == WM_CLOSE
invoke KillTimer,NULL,idTimer
invoke EndDialog,hWnd,NULL
;********************************************************************
.elseif eax == WM_INITDIALOG
push hWnd
pop hWinMain
invoke GetDlgItem,hWnd,ID_START
mov hWinStart,eax
invoke GetDlgItem,hWnd,ID_STOP
mov hWinStop,eax
add IO_PORT,A_ADDR
mov F_RADIO,0
mov idTimer,0
invoke SetDlgItemText,hWnd,IDC_EDIT,addr szInit
;********************************************************************
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
_ProcDlgMain endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,eax,IDD_DIALOG1,NULL,offset _ProcDlgMain,NULL
invoke ExitProcess,NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end start
;***************************************************************************
怎么我的invoke SetTimer,NULL,NULL,1000,offset _ProcTimer
为什么这个基于过程的定时器不起作用
而设置基于窗口的定时器,
象SetTimer,hWnd,,idEvent,offset _ProcTimer这样就没有这样的问题
谁能看出来,程序哪里出毛病了吗!!!!!!!
...全文
相关推荐
job定时器操作存储过程
本文将深入解析如何利用Oracle JOB定时器来操作存储过程,包括创建、执行、查询、停止、启动以及删除JOB的全过程,并详细阐述定时器执行时间间隔的设置方法。
存储过程、触发器、定时器例子(oracle)
创建和管理定时器涉及`DBMS_SCHEDULER`包中的多个过程和函数。
oracle定时器调用存储过程
oracle定时器调用存储过程
通用定时器的工作过程.docx
通用定时器的工作过程通用定时器是STM32微控制器中的一种重要的外设,用于实现定时、计数、脉冲宽度调制、捕获和比较等功能。
plsql developer简单实现定时器&存储过程
一、定时器直接在DBMS_Jobs右键new一个定时器出来。需要填写的部分主要有以下两个部分what主要填写你需要定时器执行的存储过程名称。如上图所示,我写了一个名称为“AddHydropowerDa


