Assembly Help!!
From: Marty (mail2riro_at_yahoo.co.kr)
Date: 07/22/03
- Next message: John Williams: "Re: Assembly Help!!"
- Previous message: Sales for IDE-CF flash drive: "Re: Have ext3 on SanDisk CF but can't disable write-back caching as kernel instructs"
- Next in thread: John Williams: "Re: Assembly Help!!"
- Reply: John Williams: "Re: Assembly Help!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 21 Jul 2003 17:07:32 -0700
Hi, there.
I'm kind of a newbie in embedded programming. Now, I'm customizing
imported BSP to fit our new platform, but Assembly language is killing
me.
I hope your help and thanks, In advance.
* We are using Intel XScale CPU, gcc and as.
Here are my questions.
1) It's a MMU page table making code. I don't understand '->' marked
parts.
It seems like to me that they're macro commands in macro definition. I
mean, It seems like using macro command even though PT_ENTRY macro
definition is not yet finished. and why they need some arguments
within double quote??? What does that mean???
.MACRO PT_ENTRY base,x,ap,p,d,c,b,total=0
.if \total
.if \total <= 0x40
.long (\base << 20) | (\x << 12) | (\ap << 10) | (\p << 9) | (\d
<< 5) | (\c << 3) | (\b << 2) | 2
-> PT_ENTRY "(\base+1)",\x,\ap,\p,\d,\c,\b,"(\total-1)"
.else
.if \total <= 0x256
-> PT_ENTRY \base,\x,\ap,\p,\d,\c,\b,0x40
-> PT_ENTRY "(\base+0x40)",\x,\ap,\p,\d,\c,\b,"(\total-0x40)"
.else
-> PT_ENTRY \base,\x,\ap,\p,\d,\c,\b,0x256
-> PT_ENTRY "(\base+0x256)",\x,\ap,\p,\d,\c,\b,"(\total-0x256)"
.endif
.endif
.endif
.ENDM
2) In our assembly source file, I can also find some C language coding
too.
Actually, It includes header files and define something in exactly
same way with C. Is it a 'in-line assembly'?? But, I think it's
somewhat different.
Then, How can I call a function, written in C language, in a assembly
file ??
#include "arch/arm/arm.h"
#define CPWAIT(a) \
mrc p15, 0, a, c2, c0, 0 /* arbitrary read of CP15 */ ;\
mov a, a /* wait for it */ ;\
sub pc, pc, IMMED4 /* branch to next
instruction */ ;
#define IMMED4 #4
That's it. I'm sorry for my poor english and foolish question, but
your help would be really helpful to me.
Thanks.^^
- Next message: John Williams: "Re: Assembly Help!!"
- Previous message: Sales for IDE-CF flash drive: "Re: Have ext3 on SanDisk CF but can't disable write-back caching as kernel instructs"
- Next in thread: John Williams: "Re: Assembly Help!!"
- Reply: John Williams: "Re: Assembly Help!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|