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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/23/03 09:29
Read: times


 
#53160 - RE: how to include files in assembly..(keil)
Responding to: ???'s previous message
this will cause a code overlap, include file be assembled from 0000h and you again used ORG 0000h at the end which will again init the LC to the 0000h and futher code will laped over the old one. for best of my knowledge this should be like this.

file 1(main.asm)

org 0000h
ljmp on_reset
org 002bh
#include "rs_485.asm"
on_reset:
mov ie,#00h
mov sp,#07h
lcall rs_485_init ;initailise the serial communication
end


file 2(rs_485.asm)

rs_485_init:

mov tmod,#20h ;timer 1 in mode2(auto reload)
mov th1,#-3 ;reload value for 9600 baud rate
mov scon,#50h ;8 bit,1 start,1 stop and REN enabled
clr ti ;clear transmit interrupt flag
clr ri ;clear receive interrupt flag
setb tr1 ;Start timer 1
ret



abhishek




List of 7 messages in thread
TopicAuthorDate
how to include files in assembly..(keil)            01/01/70 00:00      
   RE: how to include files in assembly..(keil)            01/01/70 00:00      
      ps:existing thread            01/01/70 00:00      
      thanx abishek....It worked            01/01/70 00:00      
         RE: thanx abishek....It worked            01/01/70 00:00      
         RE: thanx abishek....It worked            01/01/70 00:00      
            RE: thanx abishek....It worked            01/01/70 00:00      

Back to Subject List