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

Conversation

ajay_bhargav
Sat Aug 30 2014, 12:15 PM
@sufiyan, You can use solenoid lock in place of LED.
Fri Aug 29 2014, 12:17 AM
sufiyan
please can you tell me which type of lock activator should i connect in place of LED? can i use selenoid lock actuator
ajay_bhargav
Thu Aug 28 2014, 06:34 AM
Please post questions in forum
Thu Aug 28 2014, 01:44 AM
yednekachew
can you give a project made bay proteus software
Mon Aug 25 2014, 07:12 AM
Vinod Soni
Hi Sir, How can i make this RFID with ATMega16/32 controller
pavanjain
Sat Aug 23 2014, 05:10 AM
Sir i want to download the hex file in P89v51rd2 microcontroller using max232 IC but we not load the program in IC
Tue Aug 19 2014, 04:51 PM
allen ndumu
please i will like to know if the problem of speed control of dc motor using keypad and l298 was if yes can i have the complete project send it to the address i really need to see it
Tue Aug 19 2014, 10:47 AM
Amit Bisht
sir i want to have some trending projects on which i could work related to ATmega 16 microcontroller
ExperimenterUK
Sat Aug 16 2014, 04:16 PM
@diligent . create a thread
Sat Aug 16 2014, 03:17 PM
diligent
in assembly langauage programming..

Downloads

Comments

[email protected]
Sat Aug 30 2014, 04:45 PM
enisi
Wed Aug 27 2014, 06:08 AM
sadalakshmi
Wed Aug 27 2014, 12:39 AM
Paecake
Sun Aug 24 2014, 04:07 PM
pavanjain
Sat Aug 23 2014, 02:33 AM
samchovatiya
Thu Aug 21 2014, 02:30 PM
hasmukhjain
Wed Aug 20 2014, 06:28 AM
rablo
Tue Aug 19 2014, 10:10 AM
Forum Activity
ajay_bhargav Avatar
Posted By ajay_bhargav
Sat Aug 30 2014, 12:03 PM
Forgot to attach files. This has source for both R...
ajay_bhargav Avatar
Posted By ajay_bhargav
Sat Aug 30 2014, 11:56 AM
I found a very good working source but its for PIC...
siddique Avatar
Posted By siddique
Sat Aug 30 2014, 03:34 AM
Have you tried using the TX setup to receive and v...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Aug 28 2014, 03:31 PM
So, I don't think there is any need to load any da...
ajay_bhargav Avatar
Posted By ajay_bhargav
Thu Aug 28 2014, 06:33 AM
Did your professor ask this question to you? I sug...
siddique Avatar
Posted By siddique
Thu Aug 28 2014, 01:09 AM
hi,In the Tx code, I have disabled auto acknowledg...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Aug 27 2014, 04:59 PM
Your board has two serial ports, are you connectin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Aug 27 2014, 04:45 PM
In your TX code I see where you set payload width ...
enisi Avatar
Posted By enisi
Wed Aug 27 2014, 07:05 AM
It can be more than one ansawer correctly