Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/10/07 03:50
Read: times


 
#144192 - Assemble code
#include "reg89v51.h"
ORG 0000H
LJMP MAIN
ORG 4000H
MAIN: MOV SP,#60H
LCALL InitialSerial
START: MOV A,#AAH
LCALL SendChar
LJMP START

; initial the serial com
; set the boutrate at 9600bit/s
InitialSerial:

MOV SCON,#D0H

MOV TMOD,#21H
MOV TH1, #FDH ;set boutrate 9600bit/s

MOV PCON,#00H

SETB TR1

SETB ES
CLR A

MOV IP,A
CLR EA ;close all interrupt
RET

;***** console output routine *****
;Outputs character in the ACC to
;the serial output line.
SendChar:
MOV SBUF,A ;output char to SIO
JNB TI,SendChar ;wait till xmtr ready
CLR TI ;reset xmtr flag
RET ;and done

;***** console input routine *****
;Waits until character has been received
;and then returns char in ACC.
ReceiveChar:
JNB RI, ReceiveChar ;wait till char
CLR RI ;reset rcvr flag
MOV A,SBUF ;read the char
RET ;and done
END


There is some error inside the program.
The complier( keil 7.05) notify that "ISP.A51(7): error A45: UNDEFINED SYMBOL (PASS-2)".
Will anyone come to tell me why


List of 13 messages in thread
TopicAuthorDate
Assemble code            01/01/70 00:00      
   Have a look at the listing file            01/01/70 00:00      
   hex number begin with 0 -> #0AAH            01/01/70 00:00      
      explanation            01/01/70 00:00      
         RTFM!            01/01/70 00:00      
            please say out aloud            01/01/70 00:00      
               [OT] Leading zeros on numbers in C            01/01/70 00:00      
   reply            01/01/70 00:00      
      Yes            01/01/70 00:00      
         Explanation            01/01/70 00:00      
      asked and answered            01/01/70 00:00      
         Only for him            01/01/70 00:00      
   thanks            01/01/70 00:00      

Back to Subject List