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

hareeshchamiyar
Thu Mar 29 2018, 10:47 AM
please help me for the configuration bits for dspic30f2010
hareeshchamiyar
Thu Mar 29 2018, 10:45 AM
can any one using dspic30f2010.
Thu Mar 29 2018, 06:03 AM
Neena
can anybody give solar tracking in 8051 using proteus and keil to mail [email protected]
ExperimenterUK
Mon Mar 19 2018, 07:33 PM
sorry bedo.. maybe next time
Sun Mar 18 2018, 07:48 AM
Mourya Manojkumar
Please send me circuit diagram and PCB diagram
Thu Mar 01 2018, 05:49 AM
Felixc
May you please help me with a code for programmable load shedding controlling 4 loads
Sun Feb 25 2018, 08:29 PM
ezeoke.charles
i need of it
Sat Feb 24 2018, 03:35 AM
Aaquib
I want help for digital ic tester
ExperimenterUK
Tue Feb 20 2018, 04:01 PM
Join up.. and post your problem
Mon Feb 19 2018, 11:17 AM
ashishkumar
i needs help for my project

Downloads

Comments

Pater
Fri Apr 20 2018, 02:38 PM
jamiel
Sat Apr 14 2018, 12:47 AM
akrepkral76
Wed Apr 04 2018, 07:51 PM
samanthaeaves
Mon Apr 02 2018, 06:27 AM
rana2056
Sat Mar 31 2018, 02:11 PM
Darshanparabbnb
Mon Mar 26 2018, 07:17 AM
marttinsmarcio
Sat Mar 24 2018, 12:31 PM
LAMBO
Tue Mar 20 2018, 09:51 AM

Online

Guests: 33, Members: 0 ...

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

Members: 37994
Newest member: Pater
Forum Activity
Pater Avatar
Posted By Pater
Fri Apr 20 2018, 02:40 PM
Actually I want to transmit 3 bits serially using ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Apr 16 2018, 08:49 PM
On the diagram, a diode feeds a rectified sine wav...
LAMBO Avatar
Posted By LAMBO
Mon Apr 16 2018, 06:39 AM
Hi sir i haven't connected any serial connec...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Apr 13 2018, 02:09 AM
I assume you are doing this project.http://www.805...
LAMBO Avatar
Posted By LAMBO
Thu Apr 12 2018, 06:51 PM
hii sir,I am working on ac motor controller .I hav...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Apr 10 2018, 06:12 PM
The lpc214x has a 32-bit prescaler , so I would ...
Praneeth1299 Avatar
Posted By Praneeth1299
Tue Apr 10 2018, 09:16 AM
Hi,I'm generating constant frequency of 1hz and va...
akrepkral76 Avatar
Posted By akrepkral76
Sat Apr 07 2018, 01:57 PM
I have used diptrace.I think ı have recevied from ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Apr 07 2018, 01:45 AM
You will need to say which software you are using,...
akrepkral76 Avatar
Posted By akrepkral76
Fri Apr 06 2018, 12:22 PM
I have drawed many PCB board. But it is still not ...