For Programmers: Free Programming Magazines  


Home > Archive > A86 Assembler > May 2006 > How to write an adaptive macro









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to write an adaptive macro
PMH

2006-05-26, 6:57 pm

The Keil assembler has eight 8 bit registers which can
be alternatively used in some versions of the 8051 as
four 16 bit registers or even two 32 bit registers:

8 bit: R0, R1, R2, R3, R4, R5, R6, R7
16 bit: WR0=R0:R1 WR2=R2:R3 WR4=R4:R5 WR6=R6:R7
32 BIR: DR0=R0:R1:R2:R3 DR4=R4:R5:R6:R7

I would like to write some macros to ease the usage of
the WRx and DRx register combinations. If the argument
is WR4, a sequence of instructions like..

ADD .. R5
ADDC .. R4

and if the argument is DR0, instructions like..

ADD .. R3
ADDC .. R2
ADDC .. R1
ADDC .. R0

shall get generated. How can this be done in an easy
way with the Intel macro language?

Jack Klein

2006-05-27, 9:57 pm

On Fri, 26 May 2006 18:21:11 +0200, "PMH" <spamtrap@crayne.org> wrote
in comp.lang.asm.x86:

> The Keil assembler has eight 8 bit registers which can
> be alternatively used in some versions of the 8051 as
> four 16 bit registers or even two 32 bit registers:
>
> 8 bit: R0, R1, R2, R3, R4, R5, R6, R7
> 16 bit: WR0=R0:R1 WR2=R2:R3 WR4=R4:R5 WR6=R6:R7
> 32 BIR: DR0=R0:R1:R2:R3 DR4=R4:R5:R6:R7
>
> I would like to write some macros to ease the usage of
> the WRx and DRx register combinations. If the argument
> is WR4, a sequence of instructions like..
>
> ADD .. R5
> ADDC .. R4
>
> and if the argument is DR0, instructions like..
>
> ADD .. R3
> ADDC .. R2
> ADDC .. R1
> ADDC .. R0
>
> shall get generated. How can this be done in an easy
> way with the Intel macro language?


This group only supports assembly language for PC compatible
processors, namely the x86 line, from Intel and others. The 8051 is
most definitely not a PC compatible processor.

As for what "Intel macro language" might be, I haven't got the
faintest idea.

The place to ask about 8051 controllers and Keil tools is
news:comp.arch.embedded.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~.../FAQ-acllc.html

PMH

2006-05-28, 6:57 pm

Thank you for the comp.arch.embedded advise. I had not found it.

Intel's "Macro Processing Language" should be almost identical
on the C51 and x86 assemblers.

PMH

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com