You are on page 1of 4

org 0000h ljmp main org 0013h ljmp key main: mov ie,#10000100b mov tmod,#01h

mov a,#38h acall comm acall delay mov a,#0eh acall comm acall delay mov a,#01h acall comm acall delay mov a,#06h acall comm acall delay mov r0,#00h ;position of cursor mov r1,#00000000b ;flag mov dptr,#starting clr a movc a ,@a+dptr acall comm acall delay jz send_data1 inc dptr sjmp c1 send_data1:mov dptr,#starting c1: mov a,#01h acall comm acall delay

mov dptr,#rules clr a movc a,@a+dptr acall comm acall delay jz send_data2 inc dptr sjmp c2 send_data2:mov dptr,#rules c2: mov a,#01h acall comm

acall delay mov dptr,#start clr a movc a,@a+dptr acall comm acall delay jz send_data3 inc dptr sjmp c3 send_data3:mov dptr,#start c3: mov a,#01h acall comm acall delay mov a,#0c0h acall comm acall delay mov a,#'*' acall datar acall delay ;player initial position ; player

;hurdle programing mov r3,#84h ;hurdle mov a,r3 acall comm acall delay mov A,# '?' acall datar acall delay delayhurdl: mov r6,#8dh back:mov tl0,#00h mov th0,#00h setb tr0 mov a,r3 mov 98h,r0 mov a,r3 cjne a,98h,point check: jnb tf0,check djnz r6,back ;mov r3,#0cah ;hurdle at 84h ;mov a,r3 ;acall comm ;acall delay ;mov A,# '?' ;acall datar ;acall delay ;;mov tl0,#00h ;mov th0,#00h ;setb tr0 ;mov a,r3 at 84h

;hurdle is ?

;hurdle is ?

point: inc r1 mov a,r3 acall comm acall delay mov a,' ' acall datar acall delay mov dptr,#gameover clr a movc a,@a+dptr acall comm acall delay jz send_data4 inc dptr sjmp c4 send_data4:mov dptr,#gameover mov dptr,#score c5: clr a movc a,@a+dptr acall comm acall delay jz send_data5 inc dptr sjmp c5 send_data5:mov dptr,#score c4:

;interupt sub routine key:mov a,r0 jb p1.1,swaprow jb p1.2,left jb p1.3,right swaprow:mov a,r0 cpl acc.6 sjmp wat left: anl a,#0fh mov r2,a inc r2 cjne r2,#0fh,next sjmp wat right:anl a,#0fh mov r2,a dec r2 cjne r2,#00h,next2 sjmp wat next: mov r2,#00h sjmp wat next2: mov r2,#0fh sjmp wat wat: mov a,r0 anl a,#0f0h add a,r2 mov r0,a mov a,r0 acall comm

;position of cursor

acall delay mov a,'*' acall datar acall delay reti comm: mov p3,a clr p2.0 clr p2.1 setb p2.2 acall delay clr p2.2 ret datar: mov p1,a setb p2.0 clr p2.1 setb p2.2 acall delay clr p2.2 ret delay: mov r3,#50 here2: mov r4,#255 here: djnz r4,here djnz r3,here2 ret

starting: db "welcome to alphamania" rules: db "Use a-> right b-> left c->up down" start: db "angels vs demons" score: db "your score is" gameover: db "Gameover"

end

You might also like