<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html charset=utf-8" />
<title>页面速度</title>
<script src="jquery-1.4.4.js"></script>
<script>
var obj = {}
</script>
</head>
<body>
<script>
<!--记录时间点-->
obj.one = new Date*1+10
obj.two = new Date*1+50
obj.three = new Date*1+60
obj.four = new Date*1+80
obj.five = new Date*1+100
var str = $.param(obj)
var img = new Image()
img.src = 'ns.php?'+str
//加载完成或失败都要绑定,如果页面没有正确输出图片(只有头信息是不行的)则会触发onerror事件
img.onload = img.onerror = function() {
//清除无用资源
obj = img = null
}
console.log(img)
//追加显示图片,故我们要把图片变量也清除掉
/*$(function(){
$("#btn").click(function(){
$(document.body).append(img)
//document.body.appendChild(img)
})
})*/
</script>
<button id="btn">单击显示图片</button>
</body>
</html>
需要jquery库支持
这是我自己编过项目中的多字节运算子程序有加法,除法,减乘更为简单类推一下吧
注释写得很详细了,出口入口地址也有标记
n个数据相加子程序
11,13,15为进位。12,14,16为相加结果,分别为低8位、中、高8位
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
ADDP: MOV 11H,#00H
MOV 12H,#00H
MOV R0,#20H <---"20"起始位置
MOV 12H,@R0
LOOP1: MOV A,R0
ADD A,#03H
MOV R1,A
MOV A,12H
ADD A,@R1
JNB PSW.7,SI1
INC 11H
SI1: MOV 12H,A
MOV A,R1
MOV R0,A
CJNE R0,#4DH,LOOP1 <---"4D"终止变量,YANG YF DESIGN
MOV A,#00H
MOV 13H,#00H
MOV 14H,#00H
MOV R0,#21H <---"21"起始位置
MOV 14H,@R0
MOV A,14H
ADD A,11H
MOV 14H,A
LOOP2: MOV A,R0
ADD A,#03H
MOV R1,A
MOV A,14H
ADD A,@R1
JNB PSW.7,SI2
INC 13H
SI2: MOV 14H,A
MOV A,R1
MOV R0,A
CJNE R0,#4EH,LOOP2 <---"4E"终止变量
MOV A,#00H
MOV 15H,#00H
MOV 16H,#00H
MOV R0,#22H <---"22"起始位置
MOV 15H,@R0
MOV A,16H
ADD A,13H
MOV 16H,A
LOOP3: MOV A,R0
ADD A,#03H
MOV R1,A
MOV A,16H
ADD A,@R1
JNB PSW.7,SI3
INC 15H
SI3: MOV 16H,A
MOV A,R1
MOV R0,A
CJNE R0,#4FH,LOOP3 <---"4F"终止自定义位置变量 ,
MOV A,#00H
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
除法运算子程序
支持被除数32位、除数24位,任意位长除法
被除数需根据计时和累加组数****预先置入,****调试准确度调整亦调节此值!!!!!!!!
17H、18H、19H为除数输入口,32H、33H、34H、35H为运算结果
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
SETDIV: MOV P1,#0FFH
JNB P1.1,MEAS_F 当P1.1置1(高)为测速,置0(低)为测频
MEAS_V: MOV R2,#11111111B ***测速****
MOV R3,#11101000B 被除数R2-R5,转移至22H-25H进行变位处理
MOV R4,#00100101B **被除数为定值,前端0的个数已知
MOV R5,#00001011B 设被除数前端0的个数已知为y,除数前端0的个数计数为x(R0),后部循环次数为(32-y)-(24-x)=(8-y)+x
JMP STARDIV
MEAS_F: MOV R2,#00111010B ***测频**** YANG YF DESIGN
MOV R3,#01100110B 被除数R2-R5,转移至22H-25H进行变位处理
MOV R4,#00111110B **被除数为定值,前端0的个数已知
MOV R5,#10000111B 设被除数前端0的个数已知为y,除数前端0的个数计数为x(R0),后部循环次数为(32-y)-(24-x)=(8-y)+x
JMP STARDIV
STARDIV:MOV 22H,R2
MOV 23H,R3
MOV 24H,R4
MOV 25H,R5
MOV 17H,16H 除数17H-19H,载入累加后12H、14H、16H结果
MOV 18H,14H
MOV 19H,12H
MOV 32H,#00H结果输出位32H-35H初置0 YANG YF DESIGN
MOV 33H,#00H
MOV 34H,#00H
MOV 35H,#00H
MOV R0,#00H
MOV R1,#00H
MOV 10H,#00H
CHECKFRONT: CLR C
MOV A,17H检查除数高位是否有空位0
RLC A
JNC MOVFRONT
JMP LOOPCOUNT
MOVFRONT: INC R0
CLR C 除数高位空位为0时前移
MOV A,19H 1)
RLC A
MOV 19H,A
MOV A,18H 2)
RLC A
MOV 18H,A
MOV A,17H 3)
RLC A
MOV 17H,A
JMP CHECKFRONT
LOOPCOUNT: MOV A,#09H
ADD A,R0
MOV 10H,A 后部循环次数R0
JUDGSUB:MOV PSW,#00H
MOV A,R1
CJNE A,10H,JMP0
JMP RESULTDIV
JMP0: MOV A,22H
MOV C,ACC.7 ******!!!!
MOV F0,C
CLR C ******!!!!
SUBB A,17H
JC CANOTSUB 溢位
JNZ JMP1WHEN ACC!=#00H THEN JUMP
MOV A,23H
CLR C
SUBB A,18H
JC CANOTSUB
JMP1: JNZ JMP2WHEN ACC!=#00H THEN JUMP
MOV A,24H
CLR C
SUBB A,19H
JC CANOTSUB
JMP2: JMP SUBBPART
CANOTSUB: JNB F0,TURN1
JB F0,MOVDR
JMP SUBBPART
SUBBPART: CLR C
MOV A,25H
JNB PSW.1,JMPSP1
JB ACC.7,JMPSP1
SETB ACC.7
MOV A,19H
INC A
MOV 19H,A
JMPSP1: MOV A,24H
SUBB A,19H
MOV 24H,A
MOV A,23H
SUBB A,18H
MOV 23H,A
MOV A,22H
SUBB A,17H
MOV 22H,A
ACALL SETCY_1
JB B.0,MOVDL 除数因条件右移后左移恢复
LJMP JUDGSUB
MOVDR: SETB B.0
CLR C 除数右移一位
MOV A,17H 1)
RRC A
MOV 17H,A
MOV A,18H 2)
RRC A
MOV 18H,A
MOV A,19H 3)
RRC A
MOV 19H,A
MOV PSW.1,C 除数末尾移出暂存至F1
ACALL SETCY_0
JMP SUBBPART
MOVDL: MOV C,PSW.1
MOV A,19H 1)
RLC A
MOV 19H,A
MOV A,18H 2)
RLC A
MOV 18H,A
MOV A,17H 3)
RLC A
MOV 17H,A
CLR B.0
SETB B.1
JMP JUDGSUB
TURN1: CLR C
MOV A,25H 1)
RLC A
MOV 25H,A
MOV A,24H 2)
RLC A
MOV 24H,A
MOV A,23H 3)
RLC A
MOV 23H,A
MOV A,22H 4)
RLC A
MOV 22H,A
JB B.1,JMPCALLSC0
ACALL SETCY_0
JMPCALLSC0: CLR B.1
JMP JUDGSUB
SETCY_0:JB B.2,JMPSE1 B.2判断是否置1后第一次置0,是则忽略一次
INC R1 已计算次数计数
CLR C移入一位0
MOV A,35H
RLC A
MOV 35H,A 输出地址32H-35H
MOV A,34H
RLC A
MOV 34H,A
MOV A,33H
RLC A
MOV 33H,A
MOV A,32H
RLC A
MOV 32H,A
CLR C
JMPSE1: CLR B.2
RET
SETCY_1:INC R1 已计算次数计数 YANG YF DESIGN
SETB C 移入一位1
MOV A,35H
RLC A
MOV 35H,A 输出地址32H-35H
MOV A,34H
RLC A
MOV 34H,A
MOV A,33H
RLC A
MOV 33H,A
MOV A,32H
RLC A
MOV 32H,A
CLR C
SETB B.2
RET
RESULTDIV: 不可删 YANG YF DESIGN
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^