help with HC05 asm conversion to HCS08 asm

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

help with HC05 asm conversion to HCS08 asm

4,214件の閲覧回数
baddad
Contributor I
Folks,
I am converting some old HC05 asm code to run on a HCS08AW32 (using CW 5.1).  I've been successful with everything but this subroutine:
 
XMT_EMSG0:
 ADD #MSG_LNK&0FF  ; Add LSB of Message Link Offset
 STA VSRL_LSB  ; Message in the EEPROM Pointer
 LDA VSWI
 ADC #MSG_LNK/100  ; Add MSB of Message Link Offset
 STA VSRL_MSB  ; Message in the EEPROM
...
 
This code is creating a 16-bit offset pointer to some messages.
The 2 add statements (ADD and ADC) create errors due to the complex statement.
 
Any suggestions on how to reduce these two lines to simple HC08 instructions that will assemble?
 
Thanks in advance.
Brian
 
ラベル(1)
0 件の賞賛
返信
5 返答(返信)

1,589件の閲覧回数
bigmac
Specialist III
Hello,
 
There may be another potential problem with your code conversion - from your code snippet it would appear that your HC05 assembler may assume hexadecimal numbers by default, when there is no prefix or suffix to indicate otherwise.  For CW assembler, decimal numbers are the default, unless this is specifically changed.
 
Regards,
Mac
 
0 件の賞賛
返信

1,589件の閲覧回数
baddad
Contributor I
Thanks MAC.
 
I did fix that early on, but I cut and pasted from the original file.
 
BTW, I also found that passing parameters to a macro function uses different symbols also.  (old way - %, new way - /)
 
Thanks again for all the help.
 
BadDad
0 件の賞賛
返信

1,589件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
use the LOW and HIGH operators.
 ADD #LOW(MSG_LNK)
 ...
 ADC #HIGH(MSG_LNK)


Daniel
0 件の賞賛
返信

1,589件の閲覧回数
baddad
Contributor I
Daniel,
 
Thanks.
 
That was exactly what I was looking for.
 
BadDad
0 件の賞賛
返信

1,589件の閲覧回数
Geezer
Contributor I
I believe you've run out of 'tiny' memory and the linker is putting all subsequent DS.B and DS.W things into the larger block of RAM (aka INDIRECT) which cannot be manipulated by instructions designed for DIRECT stuff. LDA and ADD, for instance. You''l hve to convert to code using 16-bit stuff, the old LDHX and the like.

Look at your MAP file, I think you'll find that the variable you use are no longer below address 0xff.

Whose ASSEMBLER are you using?
0 件の賞賛
返信