Assembly Help!!

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

Reply to
Marty
Loading thread data ...

It's a recursive macro. Here's a simple example:

.MACRO RECURSIVE_TEST value .if \value .long \value RECURSIVE_TEST "(\value-1)" .else .long 0x9999 .endif .ENDM

Write out by hand what will be generated if you call this RECURSIVE_TEST macro with a value of, say, 4... it will create the following output:

.long 4 .long 3 .long 2 .long 1 .long 0x9999

When you understand why, you'll be able to understand the PT_ENTRY macro.

The quotes are probably just to get around some text substitution rules in the assember input format.

Cheers,

John

Reply to
John Williams

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.