sendAA_Code SEGMENT CODE
PUBLIC sendAA
RSEG sendAA_Code
ddsz: mov a,0x90
anl a,#1
jz ddsz //等待时钟线为高
mov r0,#24
djnz r0,$ //延时约50微秒
mov a,0x90
anl a,#1
jz ddsz //时钟信号是否仍旧为高
mov a,0x90
anl a,#2
rr a
// jz fq //放弃
mov r0,9 //延时20us
djnz r0,$
mov 0x90,#0 //输出起始位
mov r3,#9
djnz r3,$ //延时约20us
mov 0x90,#0 //时钟线拉低
mov r3,19
djnz r3,$ //延时约40us
mov 0x90,#1 //释放时钟
mov r3,9
djnz r3,$ //延时约20us
mov r0,#0xaa //存放要发送的数据
mov r1,#8 //循环8次
fssj: mov a,0x90 //发送数据
anl a,#1
// jz fq //主机禁止发送则放弃
mov a,r0 //发送数据
anl a,#1
rl a
mov 0x90,a
mov a,r0
rr a
mov r0,a
mov r3,#9
djnz r3,$ //延时约20us
mov 0x90,#0 //时钟线拉低
mov r3,19
djnz r3,$ //延时约40us
mov 0x90,#1 //释放时钟
mov r3,#5
djnz r3,$ //延时约11us
djnz r1,fssj
mov a,0x90
anl a,#1
// jz fq //主机禁止发送则放弃
mov 0x90,#2 //输出校验位
mov r3,9
djnz r3,$ //延时约20us
mov 0x90,#0 //时钟线拉低
mov r3,19
djnz r3,$ //延时约40us
mov 0x90,#1 //释放时钟
mov r3,9
djnz r3,$ //延时约20us
mov a,0x90
anl a,#1
// jz fq //主机禁止发送则放弃
mov 0x90,#2 //输出停止位
mov r3,9
djnz r3,$ //延时约20us
mov 0x90,#0 //时钟线拉低
mov r3,19
djnz r3,$ //延时约40us
mov 0x90,#1 //释放时钟
mov r3,24
djnz r3,$ //延时约20us
RET
END
是不是第二句哪里写错了?
下面是主函数
#include <reg52.h>
#include <stdio.h>
extern void sendAA();
main()
{
sendAA();
}
...sendAA.asm(2): error A45: UNDEFINED SYMBOL (PASS-2)
?PR?sendAA?ASM1 SEGMENT CODE PUBLIC sendAA RSEG ?PR?sendAA?ASM1 sendAA:mov a,0x90 anl a,#1 jz sendAA \/\/等待时钟线为高 mov r0,#24 djnz r0,$ \/\/延时约50微秒 mov a,0x90 anl a,#1 jz sendAA \/\/时钟信号是否仍旧为高 mov a,0x90 anl a,#...