技术文章 - CS253748

在地址子句中使用变量或常量时的不同阐述

已修改: 23-Jun-2022   


注意:本文已使用机器翻译软件翻译,以方便非英语客户阅读。但翻译内容可能包含语法错误或不准确之处。请注意, PTC对本文所含信息的翻译准确性及使用后果不承担任何责任。请在 此处 查看本文的英文原始版本以便参考。有关机器翻译的更多详情,请单击 此处
感谢您告诉我们。我们将尽快审阅此译文。

适用于

  • ApexAda 4.4 to 5.0
  • For example, if an object used to specify or compute the address is declared as a variable and assigned a numeric literal, like one of these:
    • A1 : Interfaces.Unsigned_32 := 16#80000000#;
    • A_static : constant := 16#80000000#;
A2 : Interfaces.Unsigned_32 := a_static;
the generated elaboration code may be a combination of byte, halfword, and word store instructions. The exact elaboration code depends on the structure of the record and its components.
  • Changing the declaration to a constant, like one of these:
    • A3 : constant Interfaces.Unsigned_32 := 16#80000000#;
    • A4 : constant := 16#80000000#;
    • A_static : constant := 16#80000000#;
A5 : constant Interfaces.Unsigned_32 := a_static;
may generate a series of halfword store instructions for the same record type.
 

说明

  • 在 ApexAda 中为记录类型声明地址子句时,如果使用变量而不是常量指定或计算地址,则可能会生成不同的详细说明代码。
  • 这可能会导致详细说明或运行时问题,例如,如果地址子句用于读取或写入内存映射硬件,或者不允许字节寻址的内存设备。
这是文章 253748 的 PDF 版本,可能已过期。最新版本 CS253748