Discussion in "8051 Discussion Forum" started by    Nisar Ahmed    Jul 27, 2009.
Mon Jul 27 2009, 02:25 PM
#1
Hello everyone
I have a file" table.asm",I want to include with another file" main.asm".Plz help me how i call file "table.asm"in the file "main.asm".I have using Keil assembler.

Thanks in advance
Nisar Ahmed
Mon Jul 27 2009, 05:03 PM
#2
have u added the file to your source group of "main.asm"?
Mon Jul 27 2009, 07:22 PM
#3
there are rules to follow when writing distributed assembly code..
you can download the PDF document from download section regarding Assembly programming in keil.

look for the use of keyword
"extrn" and "segment code" etc.
Tue Jul 28 2009, 06:37 PM
#4
hi guys.. can any 1 post a ScreenShot of them working with multi-file (asm)..
i wana see the declarations made in main pgm and sub-pgms..
Wed Jul 29 2009, 08:39 AM
#5
Now it's ok
In" main.asm" file .I use directive #include<table.asm>

Regards
Nisar Ahmed
Wed Jul 29 2009, 09:16 PM
#6
make sure you are not getting any warnings coz that can ruin your program.

to call a routine from external asm file.. you need to declare that segment as public. i will give you an example soon..
Thu Jul 30 2009, 03:40 AM
#7
There is no any warning.
Fri Jul 31 2009, 06:54 PM
#8
here is the exact Keil example..

File: ADD.asm


;Add routine which will be called from other file
PUBLIC ADDNUM ;declare function as public

ADDNUM_ SEGMENT CODE  ;define code segment for linker
RSEG ADDNUM_ ;select segment ADDNUM

ADDNUM:  ;Our add routine
MOV R2,R1
ADD R2,R0
RET


File: Test.asm


EXTRN CODE (ADDNUM) ;define the external symbol

CSEG at 0 ;code starts at 0
MOV R0,#50  ;Some dummy instructions
MOV R1,#51
ACALL ADDNUM ;lets call this routine which is in second file


Link it and check..


[ Edited Fri Jul 31 2009, 06:56 PM ]
Tags keil assembly programmingkeil C calling label external file
Sat Aug 01 2009, 03:30 AM
#9
Thanks for help
Mon Aug 03 2009, 05:10 PM
#10
Ok i guess Ajay's example is enough to learn the multi file concept..

I have written a code of about 31KB in a notepad which includes main pgm, LCD initilizations, 3 timer configurations and settings, ADC and its lookup table, Serial intializations and its Tx and Rx, keypad routine and some more things..

Unfortunately i dont know the concept of multi file in asm formats and i have written all these in a single file with countless jumps.... Thank god its working and thanks to JTAG debugger as well...

Now i wana seperate them into individual files and add them into my project...

So i request any 1 to plz share me a project where such concept of multi files is used... so i can get a clear idea of it...

And i dont understand why multi file is required when the solo single file is working fine....

Anyways both formats jumps to specified sequence right ? Can any 1 plz explain why they insist on multifile ?


[ Edited Mon Aug 03 2009, 05:13 PM ]

Get Social

Information

Powered by e107 Forum System

Conversation

Sarvn
Sat Jul 22 2017, 05:12 PM
I wnt to learn embedded could anyone help me
Sarvn
Sat Jul 22 2017, 05:11 PM
Hi
Wed Jul 12 2017, 02:34 PM
Ushiwaka
Any good guides on how to interface an 8255 w/ an 8051?
Tue Jul 11 2017, 06:22 PM
Chiko
i need seconds added to this circuit, can you help me modify it and add codes too
ExperimenterUK
Thu Jul 06 2017, 01:25 AM
@martinsnc115877 The hex file is here http://www.8051projects.net/forum-t65048-post.html
martinsnc115877
Sun Jul 02 2017, 04:28 PM
sir, sorry for the disturbance I can find the small and capital letter,hex file, please send it to me
Sun Jul 02 2017, 11:45 AM
Sam Raj
Can I have the circuit of Simple Digital Voltmeter using 8051
ExperimenterUK
Sun Jul 02 2017, 02:09 AM
Read this http://www.8051projects.net/forum-t65048-post.html. The project download contains lower case letters. It is compiled in Keil
martinsnc115877
Sat Jul 01 2017, 10:45 PM
I mean scrolling massage display using 8051 by pratrik suthar, the hex file I have is just only the capital letters I need the capital letters and the small letters hex, and I will like to no the compiler name he used for the code thanks
ExperimenterUK
Sat Jul 01 2017, 09:13 PM
@martinsnc115877 which project..link ?

Downloads

Comments

Sarvn
Sat Jul 22 2017, 11:34 AM
diablom
Fri Jul 21 2017, 01:44 PM
Alihaider.007
Thu Jul 20 2017, 03:07 PM
Vijaykumarsharma
Fri Jul 14 2017, 11:08 AM
varma495
Tue Jul 11 2017, 01:55 AM
Ramweit
Sat Jul 08 2017, 01:42 PM
Ben_J1
Fri Jul 07 2017, 04:32 PM
labsdg
Fri Jul 07 2017, 02:58 AM

Online

Guests: 49, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37860
Newest member: Sarvn
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 20 2017, 04:08 PM
can it be possible ?? Alihaider.007No.You will nee...
Alihaider.007 Avatar
Posted By Alihaider.007
Thu Jul 20 2017, 03:14 PM
Sir I am using AT89S8253 I have trying to use this...
Utsavi Avatar
Posted By Utsavi
Mon Jul 17 2017, 09:57 AM
Hello Ajay_Bhargav,Thanks for your reply. Yes, you...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:41 AM
I do not think it would be a good idea to kind of ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:32 AM
Tasking EDE has linker script facility available y...
Ramweit Avatar
Posted By Ramweit
Thu Jul 13 2017, 06:58 AM
Thank you for response,Sim300 gsm Modem am using h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jul 11 2017, 04:20 PM
After the SMS is sent the modem should respond+CMG...
Ramweit Avatar
Posted By Ramweit
Tue Jul 11 2017, 02:37 PM
From this code gsm modem sending SMS to mobiles mu...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jul 10 2017, 06:09 PM
@RamweitWhat is it you want to know ?
Ramweit Avatar
Posted By Ramweit
Sat Jul 08 2017, 02:12 PM
#include<reg51.h>#include<stdio.h>bit moreov...