|
請問各位大大,小弟現在製作16sever控制板
以下是小弟的程式:
org 00h
call rs232_set
loop:
mov r0,#40h
mov r1,#10h
loop1:
call delay
clr ri
jnb ri,$
mov a,sbuf
mov @r0,a
inc r0
inc r0
djnz r1,loop1
mov 40h,#90
mov 42h,#207
mov 44h,#115
mov 46h,#93
mov 48h,#200
mov 4ah,#97
mov 4ch,#168
mov 4eh,#170
mov 50h,#140
mov 52h,#196
mov 54h,#105
mov 56h,#178
mov 58h,#123
mov 5ah,#134
mov 5ch,#143
mov 5eh,#155
call sort
call dif
call data_co
call out
jmp thend
rs232_set:
mov tmod,#00100000b
mov th1,#230
mov tl1,#230
setb tr1
mov scon,#01110000b
ret
delay:
mov r5,#5
d1:
mov r6,#10
d2:
mov r7,#10
djnz r7,$
djnz r6,d2
djnz r5,d1
ret
sort:
mov 41h,#00h
mov 43h,#01h
mov 45h,#02h
mov 47h,#03h
mov 49h,#04h
mov 4bh,#05h
mov 4dh,#06h
mov 4fh,#07h
mov 51h,#08h
mov 53h,#09h
mov 55h,#0ah
mov 57h,#0bh
mov 59h,#0ch
mov 5bh,#0dh
mov 5dh,#0eh
mov 5fh,#0fh
mov r2,#0fh
mov r3,#0fh
dif:
.....
................
以上的程式下半段不知道該如何寫!!
可否請教各位大大該如何編寫呢~~~~ |
|