Discussion in "Project Addition or Changes" started by    Utsavi    Jun 6, 2017.
Tue Jun 06 2017, 11:59 AM
#1
Hello,

I am using PXAG-49. I am using Tasking EDE which uses c166 compiler.

In project I have 2 different files one is in c and one is in assembly. The assembly code I placed on address 0F000H like., ORG 0F000H.

In c file i am running my mail program. On certain condition I want to jump on address 0F000H address. Can anybody tell me how to jump on this address in C.

I tried to write like.

#pragma asm
JMP 0F000H
#pragma endasm

with successfully compiled, on the otherside in asm program ,I placed debug point in my asm program that showing me program not jumping on this address.

Regards
Utsavi Bharuchwala


[ Edited Tue Jun 06 2017, 12:16 PM ]
Tue Jun 06 2017, 10:16 PM
#2
to jump from c its better to use function pointers e.g.

/* define a pointer */
void (*fptr)(void);
/* assign address */
fptr = 0xF000;
/* then jump */
fptr();
Wed Jun 07 2017, 05:47 AM
#3
Hi Ajay,

Thanks for reply. I tried your code. But that is not working for me.It seems like program is reseting itself.

Any other suggestions?

Regards
Utsavi Bharuchwala
Wed Jun 07 2017, 11:44 PM
#4
I suggest you write a very simple program.. just a few lines of C and assembly.
Then look at the lst file / map and see what code was actually created.
Is a jump what you want or a call ?

Thu Jun 08 2017, 05:44 PM
#5
I think what phil has suggested is correct, you need to first check if you code is getting linked properly or not. what IDE are you using?
Mon Jun 12 2017, 10:46 AM
#6
Hello

Thanks for quick reply.

Yes I am able to jump on absolute address using JMP instruction.

Problem is when I am merging my 2 files(.c ->main file, .asm->Work defined file) JMP is not working for this case.

Both files are compiled by Tasking EDE

Note that .asm file start at ORG 0F000H.

Why it is so?

Regards
Utsavi Bharuchwala

Mon Jun 12 2017, 09:43 PM
#7
Your 'c' file and your assembly file are created at different times then linked.
It may be that your assembly file is not actually being created.
The problem comes at the linking stage, it is often complicated and will
be different for each compiler/IDE.
I would avoid it like the plague !
Try to use in-line assembly or re-write your assembly code in 'c'.


[ Edited Tue Jun 13 2017, 05:41 PM ]

Get Social

Information

Powered by e107 Forum System

Conversation

Sat Feb 24 2018, 09:05 AM
Aaquib
I want help for digital ic tester
ExperimenterUK
Tue Feb 20 2018, 09:31 PM
Join up.. and post your problem
Mon Feb 19 2018, 04:47 PM
ashishkumar
i needs help for my project
Mon Feb 19 2018, 04:46 PM
ashishkumar
can i join you guys
ExperimenterUK
Mon Feb 05 2018, 03:08 AM
Hi Dave. Good to see you.
DavesGarage
Wed Jan 10 2018, 01:25 AM
It's been a few years since I poked around here - Hi all...
ExperimenterUK
Tue Jan 09 2018, 12:49 AM
Hi TPS. it's been a while..
۞ TPS ۞
Mon Jan 08 2018, 12:12 AM
hello
Thu Jan 04 2018, 07:20 PM
sayyad affrid
its AT89S52
Thu Jan 04 2018, 07:20 PM
sayyad affrid
sir, i want embedded c code for ultrasonic sensor having buzzer interfaced with AT9S52

Downloads

Comments

Manojsanghavi
Sat Feb 24 2018, 12:47 PM
Daro12_76
Wed Feb 21 2018, 05:01 PM
radhikanathani
Wed Feb 21 2018, 06:55 AM
Narayani
Wed Feb 21 2018, 04:10 AM
Parth09
Tue Feb 20 2018, 07:53 AM
goutham
Mon Feb 19 2018, 02:49 AM
kks
Sun Feb 18 2018, 05:59 PM
justotemon
Sat Feb 17 2018, 07:14 AM

Online

Guests: 33, Members: 0 ...

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

Members: 37971
Newest member: Manojsanghavi
Forum Activity
Manojsanghavi Avatar
Posted By Manojsanghavi
Sat Feb 24 2018, 01:03 PM
Dear allCan someone please help me on how to progr...
Ansh12 Avatar
Posted By Ansh12
Fri Feb 23 2018, 07:10 PM
sbit E = P0^7; //E pin for LCD //use port 0sb...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 23 2018, 02:43 PM
sbit NOT #definesbit E = P0^7; //E pin for LCD ...
Ansh12 Avatar
Posted By Ansh12
Fri Feb 23 2018, 01:55 PM
change your defines tosbit E = P0^7; //E pi...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 23 2018, 01:12 AM
Add pull- ups for EN and RS.change your defines t...
Ansh12 Avatar
Posted By Ansh12
Thu Feb 22 2018, 01:36 AM
Can you post your Proteus files.ExperimenterUKThan...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Feb 21 2018, 09:07 PM
The code you refer to is to drive the circuitshown...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Feb 21 2018, 05:41 PM
Can you post your Proteus files.You will need pull...
radhikanathani Avatar
Posted By radhikanathani
Wed Feb 21 2018, 02:39 PM
I want to design a system for vehicle tracking and...
Narayani Avatar
Posted By Narayani
Wed Feb 21 2018, 04:17 AM
Hello,Your tutorial really helped me understand st...