Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 07:12:58 19:12


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 2974 times)
0 Members and 1 Guest are viewing this topic.
is_razi
Newbie
*
Offline Offline

Posts: 23

Thank You
-Given: 4
-Receive: 16


« on: October 24, 2008, 08:51:45 20: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, 09:00:20 21: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