今天用汇编写一中断程序时,不知道为什么中断程序总是不能返回请大家帮我看一下问题再那里?谢谢 org 0000h ljmp main org 0003h ljmp zd1 org 0013h ljmp zd2 org 0040h main: mov tcon,#00h mov ie,#85h mov ip,#01h loop:mov p1,#0ffh lcall dly mov p1,#00h lcall dly ljmp loop zd1: push 7 push 6 push 5 push 4 push acc
mov r7,#7 mov a,#01h lop: mov p1,a lcall dly rl a djnz r7,lop pop acc pop 4 pop 5 pop 6 pop 7 reti zd2: push 7 push 6 push 5 push 4 push acc mov r7,#7 mov a,#80h lop2: mov p1,a lcall dly rr a djnz r7,lop2 pop acc pop 4 pop 5 pop 6 pop 7 reti
dly:mov r4,#100 DY10ms:MOV R6,#20 ; 置外循环次数 DLP1: MOV R7,#250 ; 置内循环次数 DLP2: DJNZ R7,DLP2 ; 2机周×250 =500机周 DJNZ R6,DLP1 ; 500机周×20= 10000机周 DJNZ R4,DY10ms ret end
|