如何用汇编计算延时?
来源:百度知道 编辑:UC知道 时间:2024/05/13 06:02:03
而且,比如说我在不停地取那个位,是否有可能漏过一次该位为1的机会呢?请问一下cmos时钟设置那个位的时间是多少?是瞬间,还是更长?
我给你一个微秒的延吧,不过不要问我为什么,说实话我是从BC里TD出来再修改而成的(只是从逻辑上进行优化):;-----------------------------------------------------------------
;
; Delay.asm
;
; Wait for specified period.
;
;
; Run Time Library for Future Assember
; Revision: 1.02
; Author: Chen Wen-yao
; Date: 2004.10.15
;
; Copyright (c) 1999, 2001 by Futuresoft
; All Rights Reserved.
;
;-----------------------------------------------------------------
include system.inc
MULTIPIER = 1193d*2d
.CODE
assume cs:@Code
;void pascal Delay(unsigned Milliseconds);
public @@Delay
@@Delay proc near
push bp
mov bp,sp
;
push di
push si
;stop=di:si,cur=dx,prev=cx
call __R