相关代码 |
|
;PROGRAM NAME:12-5-3.ASM $MOD51 BUFFER DATA 20H SCOPE_CH1 EQU P3.7 ;接到示波器CH1上观察 ; ORG 0000H MOV SP,#50H ;设定堆栈 MOV A,#00H ;累加器=00H MOV BUFFER,A ;(20H)=00H LOOP: MOV P1,BUFFER ;P1=(BUFFER) INC BUFFER ;将BUFFER内容加上1 SETB SCOPE_CH1 ;CHECK POINT=1 LCALL DELAY ;延迟一小段时间 CLR SCOPE_CH1 ;CHECK POINT=0 SJMP LOOP ;ROUTINE ;单纯时间延迟用 DELAY: MOV R0,#00H DLY: MOV R1,#00H DJNZ R1,$ DJNZ R0,DELAY RET END
相关资源 |
|