We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, I have two files,as follows...when I simulate the sub routine is never executed. file 1(main.asm)
#include "rs_485.asm" org 0000h ljmp on_reset org 002bh on_reset: mov ie,#00h mov sp,#07h lcall rs_485_init ;initailise the serial communication end
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
Have you created a project and included both files in the project so that compiler can link them together? Mahmood
Aagh! another one!! This is Assembler - so it has nothing to do with any compiler!!! See: http://www.keil.com/forum/docs/thread3247.asp Also, it is the Linker which does linking (surprisingly enough) - not the compiler!! Anyway, since he's #including the file, there's no need for linking - effectively this is just a single source file giving a single object file!
Hi all, I got the soultion,I'm posting it here so that It could help some one in future...the submodule files are include as shown below(bold text) 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
"I'm posting it here so that It could help some one in future." Excellent! - That's the spirit! :-)