把demo.asm最后定義表的指令注釋可以編譯鏈接,
打開注釋可以編譯,鏈接有錯誤,不清楚哪里問題,設置已經是最大內存程序空間模型了,
哪位有空幫看下。。。
- $include (delay.inc)
- org 0x00
- ajmp start
- org 0x0b
- ajmp time0_isr
- org 0x30
- ;********************************main****************************************
- start:
- mov 30h,#0h
- acall time0_init
-
- acall uart_init
-
- loop:nop
- ajmp loop
- ;****************************************************************************
-
-
-
-
-
- ;*****************************************
- ;funtion name: time0_isr
- ;describe:
- ;*****************************************
- time0_isr:
- push acc
- push psw
- inc 30h
- mov a,30h
- cjne a,#20,t0_ret
- cpl p1.0
- mov sbuf,#0xaa ;----------tx 0xaa
- mov 30h,#0h
- t0_ret:
- mov th0,#0x3c
- mov tl0,#0xb0
- pop psw
- pop acc
- reti
-
-
- ;*****************************************
- ;funtion name: uart_init
- ;describe:
- ;*****************************************
- uart_init: ;4800 ;boud = t1/32
- mov scon,#0x50 ;uart mode:01
- anl tmod,#0x0f
- orl tmod,#0x20 ;t1 mode2
- mov pcon,#0x80 ;double boud
- mov th1,#0xf3 ;8bits auto load
- mov tl1,#0xf3
- clr es
- setb ea
- setb tr1
- ret
- org 0xc800 ;50k start
- db 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71
- end
復制代碼 |