Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to write an adaptive macro
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?


Report this thread to moderator Post Follow-up to this message
Old Post
PMH
05-26-06 11:57 PM


Re: How to write an adaptive macro
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


Report this thread to moderator Post Follow-up to this message
Old Post
Jack Klein
05-28-06 02:57 AM


Re: How to write an adaptive macro
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


Report this thread to moderator Post Follow-up to this message
Old Post
PMH
05-28-06 11:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

A86 Assembler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:18 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.