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

Fri Jul 19 2019, 10:33 AM
charmdatedhd
cooking
ExperimenterUK
Thu Jul 11 2019, 07:55 PM
@ramos https://www.theengineeringprojects.com/2017/09/l298-motor-driver-library-proteus.html
ExperimenterUK
Thu Jul 11 2019, 07:44 PM
@praveen123. Can you give a link to the project ?
Thu Jul 11 2019, 04:47 PM
ramos
buenos dias alguien podria ayudarme necesito saber como descargar la libreria del l298n para proteus
Thu Jul 11 2019, 11:11 AM
praveen123
anyone can help me
Thu Jul 11 2019, 11:11 AM
praveen123
i need source code for 8051 -smart trolley rfid
Thu Jul 11 2019, 11:10 AM
praveen123
hii
ExperimenterUK
Thu Jun 27 2019, 09:14 PM
Hi.. good to see you again
۞ TPS ۞
Thu Jun 27 2019, 07:31 AM
Hello
AdiGhazi
Tue Jun 18 2019, 11:21 AM
Hlo Dear , I've to program AT89C51AC3 RT-LUM using flip but I'm getting time out error for RS232. Will you please suggest me which programmer will be supportable to program this Chip.

Downloads

Comments

rpels7707
Fri Jul 19 2019, 11:31 AM
ameya123
Fri Jul 19 2019, 07:36 AM
anhsieuno
Thu Jul 18 2019, 11:39 AM
zxcvbnm1234
Sat Jul 13 2019, 07:09 AM
surajghayal
Wed Jul 10 2019, 01:17 PM
figureyang
Fri Jul 05 2019, 04:25 AM
mousompal
Sat Jun 29 2019, 05:02 PM
AdiGhazi
Tue Jun 18 2019, 11:15 AM

Online

Guests: 47, Members: 0 ...

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

Members: 38080
Newest member: rpels7707
Forum Activity
ameya123 Avatar
Posted By ameya123
Fri Jul 19 2019, 07:42 AM
Hello,Please share 8051 Assembly language code for...
figureyang Avatar
Posted By figureyang
Fri Jul 05 2019, 04:37 AM
here is the source code prepared for you download ...
figureyang Avatar
Posted By figureyang
Fri Jul 05 2019, 04:30 AM
Cheap_Flash_FS(Normal Version)--Embedded FAT16/32 ...
wimac Avatar
Posted By wimac
Sat Jun 22 2019, 01:26 PM
I’ve use the AT89C51ED2 which has a similar progra...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jun 20 2019, 10:08 PM
baud rate is 9600 at stop bits of 2. AdiGhaziThe u...
AdiGhazi Avatar
Posted By AdiGhazi
Thu Jun 20 2019, 05:24 AM
Dear,I'm using RS232 serial port cable to use flip...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 18 2019, 10:19 PM
Okay.. I have never programmed the AT89C51AC3 or ...
AdiGhazi Avatar
Posted By AdiGhazi
Tue Jun 18 2019, 11:20 AM
Hlo Dear ,I've to program AT89C51AC3 RT-LUM using ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu May 30 2019, 08:32 PM
It occurs to me that although the P89LPC921 and P8...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed May 29 2019, 09:05 PM
I would suggest a fresh approach.The Keil compile...