EQU 在此代码中的功能是什么?

What does EQU do functionaly in this code?

我正在尝试破译旧 DOS 程序中的这个文件实际上在做什么。

 IDATE  EQU I/1/8/0                    Date : MM/DD/YY
       ITIME  EQU I/9/8/0                    Time : HH:MM:SS
       IUSER  EQU I/17/6/0                User ID : XXX999
       ITERM  EQU I/23/4/0            Terminal ID : ST99
       KAREA  EQU K/1/64/0

我还以为EQU是一个运算符,问“等于”。我似乎无法弄清楚它在这里有什么用。

看起来像“I/1/8/0”或“K/1/64/0”的字符串实际上是与 ITIMEKAREA 变量进行比较的值,还是它们指向到存储数据的某个位置?

文件中的其他一些行:

     FUNITM EQU X/3001/013/0
   F0     EQU W/3001/013/0/    000000000
   F1     EQU *13/0/ASM 000103000
   F2     EQU *13/0/ASM,000103000
   F3     EQU *13/0/JCR 000104000
   F4     EQU *13/0/JCRR000104000
   F5     EQU *13/0/JVR 000104000

我希望我知道 google 这是如何工作的正确词语...任何线索都会很好。谢谢

这是程序中的另一段文件,可能是其中所写内容的指示器:

       RMK     Cash receipts listing in Alpha sequence
       RMK
       RMK
       RMK     ***** Data Definition *****
       RMK     ***** File I/O Area is 1024 bytes *****
       RMK           "A" Record in SCRN File contains 8 numbers from 01-98
       RMK            (99 is reserved as the null file pointer)
       RMK            in positions 11-12, 13-14, ... 25-26 where 11-12
       RMK            establishes the physical location of file #1,
       RMK            13-14 file #2 ... 25-26 file #8 as referenced in this
       RMK            source code module.
       RMK            These numbers (01-98) point to the physical file
       RMK            assignments for files #1 thru #8 used in this source
       RMK            file.
       RMK            The actual physical locations of these files (01-98)
       RMK            appear in positions 3 thru 25 in records 1-98 in the
       RMK            STxx\FILES.REF file.
       RMK
       RMK     (I/O Area Definitions)
IAREA  EQU I/1/1024/0     The "I" area position 1 for a length 1024
       RMK
       RMK     (File #1 I/O Area Definition)
       CPY /DB\CHK/
       RMK
       RMK     (File #2 I/O Area Definition)
       CPY /DB\CST/

首先感谢大家的宝贵意见;它帮助我朝着正确的方向前进;

原来 EQU 被用来为 BTRIEVE 数据库创建数据库 table 定义。

然后很高兴,我可以通过 BUTIL 实用程序轻松操作数据并编写一些脚本将部分二进制 .DAT 文件拆分为逗号分隔的列。

特别感谢 David Wohlferd(如果您 post 回答有关结构定义的问题,我会将其标记为已接受)。

虽然我从未见过这样使用 EQU,但它们看起来像是某种字段或结构定义。

从 IDATE 行开始:

I - Integer type.
1 - Offset of the 'IDATE' field.
8 - Length of the 'IDATE' field.
0 - ???  Perhaps # of decimal places?

如果我们取 IDATE 的偏移量并加上它的长度,我们得到 9,这是 ITIME 行上的偏移量。同样适用于 IUSER、ITERM 和 KAREA。

显然这与 btrieve 数据有关。我使用 btrieve(很多年前),但从未见过使用这种语法定义的表。人们更常使用 DDF 文件(例如,参见 this)。如果您在解析数据时仍然遇到困难,可能需要寻找一些东西。