Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2016, 01:27:10 13:27


Login with username, password and session length


Pages: [1]
Print
Author Topic: how to send the address from c to asm module in IAR  (Read 1034 times)
0 Members and 1 Guest are viewing this topic.
is_razi
Newbie
*
 Muted
Offline Offline

Posts: 23

Thank You
-Given: 4
-Receive: 16


« on: October 24, 2008, 09:51:45 21:51 »

hi buddies,
i have a problem with sending an address from c to assembly module in IAR.i want to define a data some where in the flash memory like when we use the DB directive in assembly such this :
text:
DB "test"
for this i have used this command in c to define the desired data :
__flash char* text ="test";
this command allocates an address for text(ex: 0x220) in the data memory(which itself is mapped to a physical address in flash(ex: 0x15b0)).i use the following command to call an assembly module
c command : lcd_mess2(text);
and the called assembly module:
lcd_mess2:
mov ZL,arg1 //arg1&arg2 are the sent
mov ZH,arg2 //parameter by the c function
rcall Put_Text
ret

the problem i have is this, that when i call the assembly module using the c function it sends the address of text constant in data memory ie,0x220,
but the real data of text are in the code memory ie,0x15b0, which must be loaded to the ZL&ZH registers.
can somebody tell me how can i solve this problem.
(take a look at these two pics)

thanks in advance.
« Last Edit: October 24, 2008, 10:00:20 22:00 by is_razi » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC