Compiler Option

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Compiler Option

跳至解决方案
896 次查看
Brax02
Contributor III

Hello,

 

I have a basic question about the compiler options

 

in my PRM file I have the following configuration about the Z_RAM direct access

 

Z_RAM                    = READ_WRITE   0x0080 TO 0x00FF;

 

DEFAULT_RAM,                        INTO  Z_RAM;

etc..

_DATA_ZEROPAGE,                     /* zero page variables */

MY_ZEROPAGE                         INTO  Z_RAM;

 

 

in main.asm

 

MY_ZEROPAGE:  section

abcd:  DS.B  1

 

main: section

LDA abcd           ; 3 bytes used in memory (2 bytes for the addresses)

LDA abcd.B        ;2 bytes used in memory (1 bytes for the addresses)

 

 

How is it possible to configure the compiler to do the difference between a direct address and a long address by itself to optimize the code size ?

标签 (1)
标记 (1)
1 解答
757 次查看
bigmac
Specialist III

Hello,

The PRM file, which identifies the addresses of the various section names, is accessed by the linker, but not the assembler.  The assembler will normally assume that all variables have 16 bit addresses, by default.  Any variables to be specifically located within zero page RAM can be identified with the assembler directive XREFB.

Regards,

Mac

在原帖中查看解决方案

0 项奖励
回复
3 回复数
758 次查看
bigmac
Specialist III

Hello,

The PRM file, which identifies the addresses of the various section names, is accessed by the linker, but not the assembler.  The assembler will normally assume that all variables have 16 bit addresses, by default.  Any variables to be specifically located within zero page RAM can be identified with the assembler directive XREFB.

Regards,

Mac

0 项奖励
回复
757 次查看
Brax02
Contributor III

ok thanks a lot !

757 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

can you please upload your demo project to showcase us your issue? thanks!

0 项奖励
回复