org 000h ljmp start org 0060h start: mov r1,#10h mov r2,#2 mov 40h,#70h mov p1,#00h

mov tmod,#22h mov th1,#-6 MOV TH0,#70H MOV SCON,#50H SETB TR1 LOOP: CLR RI H1: JNB RI,H1 mov a,sbuf cjne a,#'S',h2 lcall sine h2: cjne a,#'P',h3 lcall pulse h3: cjne a,#'Q',loop lcall stop sjmp loop

org 0100h sstore:db 2CH,42H,57H,6CH,7FH,92H,0A4H,0B4H,0C3H,0D1H,0DDH,0E7H,0EFH,0F6H,0FBH,0 FEH,0FFh ORG 0120H pstore: org 0150h sine:mov dptr,#sstore mov R0,#12h again1:clr ri clr a movc a,@a+dptr h11:jnb ri,h12 lcall change h12:mov p1,a inc dptr push 0e0h dec R0 lcall delay djnz R0,again1 mov R0,#12h again2:pop 0e0h mov p1,a dec R0 acall delay djnz R0,again2 clr ri jnb ri,sine

h13 lcall increase h13: cjne a.h14 .#'I'.h9 clr tf0 mov th0.h8 mov a.40h ret org 0400h decrease:mov a.ret org 0200h pulse: mov dptr.40h ret org 0350h increase:mov a.a mov th0.pulse mov a.a mov th0.sbuf cjne a.#'Q'.@a+dptr clr ri h5:jnb ri.sbuf cjne a.h10 ret org 0470h change: mov a.40h ret org 0450h stop: clr tr0 h10: clr ri h8: jnb RI.r1 mov 40h.#'D'.#49h.r1 mov 40h.40h subb a.h6 lcall increase h6:cjne a.sbuf cjne a.40h add a.#44h.#pstore clr a movc a.h7 lcall decrease sjmp pulse ret org 0250h h7:ljmp loop ret org 0300h delay:setb tr0 h9: jnb tf0.

h14: h15: h16: lcall decrease cjne a.h15 lcall incamp cjne a.r2 ab org 0490h incamp: mov mul ret org 0510h decamp: mov div ret end .#'W'.r2 ab b.#'E'.h16 acall decamp ret b.

Sign up to vote on this title
UsefulNot useful