Can you help me with an HC08 assembly language macro issue?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can you help me with an HC08 assembly language macro issue?

935 Views
rogerdipaolo
Contributor I

In trying to make a legacy HC08 assembly code base more understandable and maintainable I am implementing macros where there used to be none.

 

This macro does not create a build error:

 

BCLR_RedAlarmReset_BIT_IS2_3:          MACRO

                                                                 BCLR 3,INT_STAT2

                                                                 ENDM

 

Where INT_STAT2 is defined as:

 

INT_STAT2:  DS.B 1             ;Internal status flag group #2

 

Yet, this macro does cause a build error:

 

TurnOnAnnunciator1:               MACRO

                                                 BSET 4,PORTA

                                                 ENDM

 

Where PORTA is defined as:

 

PORTA:      EQU $0000          ;Port A Data Register

 

-----------------------------------

 

So I can see the obvious differences, but nothing in any documentation I can find tells me why the first example works, and the second one does not.

 

If you can help with this, I want to thank you *very much* in advance, it is *greatly* appreciated!!!!  (and if you're near Burlington, Mass I'll take you out for lunch!!)

 

 

Labels (1)
0 Kudos
7 Replies

538 Views
rogerdipaolo
Contributor I

Pascal & ZhangJennie,

Thank you very much for all of your help.  For reasons that will most likely remain unknown I still could not get this to work correctly as Pascal did.  For the sake of keeping on project schedule I found a work-around that's a little clumsy, but does the job I need it to do.

I'll consider this case closed and not take up any more of anyone's time on this.  Thank you again!!!!  :smileyhappy:

All my best,

Roger DiPaolo

0 Kudos

538 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Roger,

I just test your code

TurnOnAnnunciator1:               MACRO

                                                 BSET 4,PORTA

                                                 ENDM

on my side, there is no build error.

see attached video. and project.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

538 Views
rogerdipaolo
Contributor I

Thank you very much for your reply ZhangJennie!

Unfortunately, my issue also includes the fact that I cannot use the more modern tools that you used.  Our company is in a regulated industry, and unfortunately I am stuck for this legacy project using the very old "HiWare" toolset (from the late 90s).  The older tools have the issue which I posted above, and my code - although it is correct for the modern versions of CodeWarrior, does not work as expected using the HiWare tools.

For anyone that reads this, please don't say "upgrade to the latest tools" - it isn't that easy at all, and actually not even an option.  In our company each and every "tool" we use must go through a long, rigorous, and expensive validation process before we are allowed to use it to build the code that will be used in our devices (and my management has already said "no way, too much time and expense" to qualify the newest CodeWarrior for use on this project.)   Therefore.... switching away from the "HiWare" tools is *not* an option.

If you have any knowledge of how the "HiWare" version of the HC08 tools assembler works in regards to macros I would be deeply in your debt if you could assist!!!  Even if you have access to old documentation (which I don't have), or can point out to me where I could find it, I would still be extremely grateful!!!

All the best to all of my Freescale colleagues,

Roger DiPaolo

0 Kudos

538 Views
trytohelp
NXP Employee
NXP Employee

Hi Roger,

If you're using an old version we need to know exactly what is the version used ?

In the past the version was named like T99_G for instance.

99 was the year and G the release version.

Where you can find the information ?

    1- On the CD directly - A Sticker containing the version information was pasted on the CD.

    2- under the installation folder on \prog, launch CHC08.exe for isntance and click on Help + About...

          The first line will contains the compiler info for instance:

                HI-CROSS+ ANSI-C/cC++ Compiler for HC08 V-5.0.10 ICG, Oct 21 1999

This is for very old tool.

For more recent which is based on CodeWarrior IDE ...

  Under CodeWarrior IDE (classic)

                Start the IDE and click on Help | About Freescale CodeWarrior.

                Click on Installed Products

                Provide us all info displayed.

                Or you can save them in a txt file.

If the Installed Products is not available for older version you should find information in the welcome.txt

under the installation folder.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

538 Views
rogerdipaolo
Contributor I

Thank you so much for your reply Pascal!

My CHC08.exe reports (running under Windows 98):

HI-CROSS+ ANSI-C/cC++ Compiler for HC08 V-5.0.8 ICG, Apr 16 1999

Hope this helps!!!  :smileyhappy:

All my best,

Roger

0 Kudos

538 Views
trytohelp
NXP Employee
NXP Employee

Hi Roger,

I've created an application using the T99_G.

This application is based on fibonacci where I've included your macros.

I can build the file and check how it's running under HIWave.

On my side it's working fine.

Attached you will find the project.


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

538 Views
trytohelp
NXP Employee
NXP Employee

Hi Roger,

This is very old one probably T99_C or D version.

This was the version ... when I've started at Hiware AG ...:smileywink:

You're using Assembler tool -> ahc08.exe.

The Assembler is not updated at each version.

On my T99_G installation the assembler tool version used is:

    HI-CROSS+ Assembler for HC08 V-5.0.6, Jun 18 1998

So this is the same version you're using on our tool too.

For information regarding the assembler you can refer to the manual:

    \DOCU\Hc08\Manual\MA08.pdf

I will perform some tests on my side and will keep you informed.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos