- 1、本文档共4页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
波形发生器汇编程序
ORG? 0000H?
SJMP????START?
ORG??30H?
START:?
CJNE? A,#0FFH,KEY?
SJMP? $?
KEY: JNB??P1.0,KEY0?
JNB? P1.1,KEY1?
JNB??P1.2,KEY2?
JNB??P1.3,KEY3?
SJMP? START?
KEY0: ACALL SIN?
SJMP? KEY?
KEY1: ACALL FANG?
SJMP? KEY?
KEY2: ACALL JUCHI?
SJMP? KEY?
KEY3: ACALL?SJIAO?
SJMP KEY?
SIN:?
LOOP: MOV?R0,#00H?
LOOP1:MOV??A,R0?
MOV?????DPTR,#TABLE?
MOVC????A,@A+DPTR?
MOV?????P2,A?
INC?R0?
MOV?P0,#0FFH?
MOV?R3,P0?
L1:? INC?R3?
CJNE R3,#00H,L1?
CJNE R0,#255,LOOP1?
JNB??P1.4,E1?
SJMP?LOOP?
E1:? RET?
FANG:?
LOOP2:
MOV? A,#00H?
MOV? P2,A?
MOV? P0,#0FFH?
MOV? A,P0?
CPL? A?
MOV? R3,A?
ACALL DELAY?
?
?
JNB? P1.4,E2?
MOV? A,#0FFH?
MOV? P2,A?
MOV? P0,#0FFH?
MOV? A,P0?
CPL? A?
MOV? R3,A?
ACALL DELAY?
SJMP LOOP2?
E2:? RET?
JUCHI:MOV? A,#00H?
LO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