Discussion in "8051 Discussion Forum" started by    Nisar Ahmed    Jul 27, 2009.
Mon Jul 27 2009, 10:25 AM
#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, 01:03 PM
#2
have u added the file to your source group of "main.asm"?
Mon Jul 27 2009, 03: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, 02: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, 04:39 AM
#5
Now it's ok
In" main.asm" file .I use directive #include<table.asm>

Regards
Nisar Ahmed
Wed Jul 29 2009, 05: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..
Wed Jul 29 2009, 11:40 PM
#7
There is no any warning.
Fri Jul 31 2009, 02: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, 02:56 PM ]
Tags keil assembly programmingkeil C calling label external file
Fri Jul 31 2009, 11:30 PM
#9
Thanks for help
Mon Aug 03 2009, 01: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, 01:13 PM ]

Get Social

Information

Powered by e107 Forum System
Forum Activity
pravin_35 Avatar
Posted By pravin_35
Tue Jul 29 2014, 06:00 AM
Fyiimage with connections
pravin_35 Avatar
Posted By pravin_35
Tue Jul 29 2014, 05:53 AM
another chip is also same problem... i am confused...
pravin_35 Avatar
Posted By pravin_35
Tue Jul 29 2014, 01:41 AM
hi guys i found the following link is very useful...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jul 28 2014, 11:17 PM
Link the tx and rx pins on HC06, everything you se...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jul 28 2014, 11:13 PM
another chip is also same problem... i am confused...
pravin_35 Avatar
Posted By pravin_35
Mon Jul 28 2014, 01:33 PM
I suggest you to try with another chip of same and...
pravin_35 Avatar
Posted By pravin_35
Mon Jul 28 2014, 05:29 AM
I suggest you to try with another chip of same and...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 28 2014, 03:23 AM
I suggest you to try with another chip of same and...
pravin_35 Avatar
Posted By pravin_35
Mon Jul 28 2014, 03:11 AM
just now tried with Mplabx screen shotpravin_35Are...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 28 2014, 02:45 AM
just now tried with Mplabx screen shotpravin_35Are...

Conversation

ajay_bhargav
Mon Jul 28 2014, 12:34 AM
@ Anshu Raj sorry we do not take such requests.
Sun Jul 27 2014, 12:23 AM
Anshu Raj
sir plz send the automatic collage alram bells in 2 hrs bells ring. For microcontroller programme plz sir
ajay_bhargav
Thu Jul 24 2014, 01:06 AM
@R.ABHISHEK where? I dont see it. is it in forum?
Wed Jul 23 2014, 05:49 AM
R.ABHISHEK
sir,pls message on microcontroller 8051 assambly language new program
Wed Jul 23 2014, 05:47 AM
R.ABHISHEK
sir,pls message on 8051 microcontroller assambly language program new quastions
ajay_bhargav
Tue Jul 22 2014, 09:18 AM
@Pragya Android application is taken from google play. Only Author has its source with him. Application is only used in this project.
Tue Jul 22 2014, 04:58 AM
Pragya
plz send me 8051 code and android code for android based device controller via Bluetooth .Here in this project I am using Hc-06 Bluetooth module
Thu Jul 10 2014, 09:57 AM
Caleb
plz someone mail me the source code for that project
Thu Jul 10 2014, 09:57 AM
Caleb
http://www.8051projects.net/download-d188-control-your-pc-tv-remote.html
ExperimenterUK
Tue Jul 08 2014, 03:25 PM
Post questions in the forum.. this area is for chat

Downloads

Comments

kritz22
Mon Jul 28 2014, 10:33 AM
Abbasans786
Mon Jul 28 2014, 03:15 AM
Imran.pk
Fri Jul 25 2014, 07:50 PM
PavanKh
Fri Jul 25 2014, 12:56 AM
vinosentinal
Mon Jul 21 2014, 08:28 PM
niks_here
Sun Jul 20 2014, 05:38 PM
athiramsankar
Sun Jul 20 2014, 12:00 PM
salemalqahtani
Sun Jul 20 2014, 12:55 AM

Online

Guests: 42, Members: 0 ...

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

Members: 37483
Newest member: kritz22