我有一个Metal C程序,我正在尝试通过__asm("...:DS(staticdata((语句添加一些静态数据,但是生成的汇编代码遇到了一些问题。
当我使用自己的序言和尾声代码时,我得到:
0007E6 00000 009A8 1997 CKKTESTR CSECT , 000000
0007E8 1998 $STATIC DS 0D 000000
0007E8 0000000000000000 1999 DC (336)X'00' 000000
000938 00938 00828 2000 ORG $STATIC+64 000000
000828 0000000100000030 2001 DC XL8'0000000100000030' 000000
000830 00830 00830 2002 ORG $STATIC+72 000000
000830 F2F1C3E2D9C5C3D7 2003 DC XL8'F2F1C3E2D9C5C3D7' 000000
000838 00838 007F8 2004 ORG $STATIC+16 000000
0007F8 C5E2C54000000001 2005 DC XL16'C5E2C540000000010000000100000090' 000000
000808 0000009000000020 2006 DC XL16'0000009000000020C5E2C3C100000001' 000000
000818 0000000100000080 2007 DC XL16'00000001000000800000008000000014' 000000
000828 00828 007E8 2008 ORG $STATIC 000000
0007E8 00010000 2009 DC XL4'00010000' 000000
0007EC 007EC 007EC 2010 ORG $STATIC+4 000000
0007EC F2F1C3E200000000 2011 DC XL12'F2F1C3E2000000007FFFFBAD' 000000
0007F8 007F8 00938 2012 ORG , 000000
2013 LCLC &DSMAC 000000
2014 LCLA &DSSIZE 000000
2015 LCLA &MSIZE 000000
000938 00938 00838 2016 ORG $STATIC+80 000000
00838 2017 @@LAB@3 EQU * 000000
000838 2018 DS 0D Start copyright text on a 000000
00838 2019 TheESET EQU * Address of the ESES 000000
000838 F2F1C3E2 2020 DC CL4'21CSESES' Control block eyecatcher 000000
2021 *.DC.F'1'.Control block version 000000
2022 *.DC.CL8'CKKTESTR'.CSECT name 000000
2023 *.DC.CL8'HTES120'.FMID 000000
2024 *.DC.CL8'XXRMIDXX'.RMID 000000
2025 *.DC.CL8'21CS-TS1'.PID 000000
2026 *.DC.CL19'2020-07-04 02:25:21.816513' 000000
2027 *.DC.CL5' '.Pad with blanks 000000
2028 *.DC.C'Copyright '.Copyright text 000000
2029 *.DC.C'(C) Teracloud S.A. '.Copyright Teracloud S.A. 000000
2030 *.DC.C'1991,2001'.Insert the year(s) 000000
000840 2031 EndCKKModId DS 0D End of ESES and copyright 000000
00008 2032 @@LAB@3L EQU *-@@LAB@3 000000
2033 &DSMAC SETC '@@LAB@3' 000000
2034 &DSSIZE SETA 256 000000
2035 &MSIZE SETA @@LAB@3L 000000
** ASMA032E Relocatable value or unresolved symbol found when absolute value required - OPENC/@@LAB@3L
** ASMA435I Record 944 in SSAF.METALC.C.ASM(CKKTESTR) on volume: TSO001
2036 AIF (&DSSIZE GE &MSIZE).@@OK@3 000000
2037 .@@OK@3 ANOP 000000
记录944是"&MSIZE SETA @@LAB@3L"。
当我删除模块中各种例程的 prolog 和 epilog 的 #pragmas 时,我得到了非常相似的代码,但它组装得很干净(为了方便起见,我重命名了程序(:
0002AA 00000 0044A 850 CKKTESTP CSECT , 000000
0002B0 851 $STATIC DS 0D 000000
0002B0 0000000000000000 852 DC (336)X'00' 000000
000400 00400 002F0 853 ORG $STATIC+64 000000
0002F0 0000000100000030 854 DC XL8'0000000100000030' 000000
0002F8 002F8 002F8 855 ORG $STATIC+72 000000
0002F8 F2F1C3E2D9C5C3D7 856 DC XL8'F2F1C3E2D9C5C3D7' 000000
000300 00300 002C0 857 ORG $STATIC+16 000000
0002C0 C5E2C54000000001 858 DC XL16'C5E2C540000000010000000100000090' 000000
0002D0 0000009000000020 859 DC XL16'0000009000000020C5E2C3C100000001' 000000
0002E0 0000000100000080 860 DC XL16'00000001000000800000008000000014' 000000
0002F0 002F0 002B0 861 ORG $STATIC 000000
0002B0 00010000 862 DC XL4'00010000' 000000
0002B4 002B4 002B4 863 ORG $STATIC+4 000000
0002B4 F2F1C3E200000000 864 DC XL12'F2F1C3E2000000007FFFFBAD' 000000
0002C0 002C0 00400 865 ORG , 000000
866 LCLC &DSMAC 000000
867 LCLA &DSSIZE 000000
868 LCLA &MSIZE 000000
000400 00400 00300 869 ORG $STATIC+80 000000
00300 870 @@LAB@5 EQU * 000000
000300 871 DS 0D Start copyright text on a 000000
00300 872 TheESET EQU * Address of the ESES 000000
000300 F2F1C3E2 873 DC CL4'21CSESES' Control block eyecatcher 000000
874 *.DC.F'1'.Control block version 000000
875 *.DC.CL8'CKKTESTR'.CSECT name 000000
876 *.DC.CL8'HTES120'.FMID 000000
877 *.DC.CL8'XXRMIDXX'.RMID 000000
878 *.DC.CL8'21CS-TS1'.PID 000000
879 *.DC.CL19'2020-07-04 02:25:21.816513' 000000
880 *.DC.CL5' '.Pad with blanks 000000
881 *.DC.C'Copyright '.Copyright text 000000
882 *.DC.C'(C) Teracloud S.A. '.Copyright Teracloud S.A. 000000
883 *.DC.C'1991,2001'.Insert the year(s) 000000
000308 884 EndCKKModId DS 0D End of ESES and copyright 000000
00008 885 @@LAB@5L EQU *-@@LAB@5 000000
886 &DSMAC SETC '@@LAB@5' 000000
887 &DSSIZE SETA 256 000000
888 &MSIZE SETA @@LAB@5L 000000
889 AIF (&DSSIZE GE &MSIZE).@@OK@5 000000
890 .@@OK@5 ANOP 000000
无论出于何种原因,生成的 DS 都使用 @@LAB@5,但"&MSIZE SETA @@LAB@5L"在这里组装没有错误。 奇数,因为第一个程序中的@@LAB@3L和第二个程序中的@@LAB@5L计算值相同:
00008 2032 @@LAB@3L EQU *-@@LAB@3 000000
-----------------------------------------------------------------------------------------------------------------------
00008 885 @@LAB@5L EQU *-@@LAB@5 000000
当我比较两个片段时(我删除了右侧的十六进制偏移量和序列信息(,这就是我得到的:
====== CKKTESTR CSECT ,
.OAAAA CKKTESTP CSECT ,
000002 $STATIC DS 0D
000003 DC (336)X'00'
000004 ORG $STATIC+64
000005 DC XL8'0000000100000030'
000006 ORG $STATIC+72
000007 DC XL8'F2F1C3E2D9C5C3D7'
000008 ORG $STATIC+16
000009 DC XL16'C5E2C540000000010000000100000090'
000010 DC XL16'0000009000000020C5E2C3C100000001'
000011 DC XL16'00000001000000800000008000000014'
000012 ORG $STATIC
000013 DC XL4'00010000'
000014 ORG $STATIC+4
000015 DC XL12'F2F1C3E2000000007FFFFBAD'
000016 ORG ,
000017 LCLC &DSMAC
000018 LCLA &DSSIZE
000019 LCLA &MSIZE
000020 ORG $STATIC+80
====== @@LAB@3 EQU *
.OAAAB @@LAB@5 EQU *
000022 DS 0D Start copyright text on a
000023 TheESET EQU * Address of the ESES
000024 DC CL4'21CSESES' Control block eyecatcher
000025 *.DC.F'1'.Control block version
000026 *.DC.CL8'CKKTESTR'.CSECT name
000027 *.DC.CL8'HTES120'.FMID
000028 *.DC.CL8'XXRMIDXX'.RMID
000029 *.DC.CL8'21CS-TS1'.PID
000030 *.DC.CL19'2020-07-04 02:25:21.816513'
000031 *.DC.CL5' '.Pad with blanks
000032 *.DC.C'Copyright '.Copyright text
000033 *.DC.C'(C) Teracloud S.A. '.Copyright Teracloud S.A.
000034 *.DC.C'1991,2001'.Insert the year(s)
000035 EndCKKModId DS 0D End of ESES and copyright
====== @@LAB@3L EQU *-@@LAB@3
====== &DSMAC SETC '@@LAB@3'
.OAAAC @@LAB@5L EQU *-@@LAB@5
.OAAAD &DSMAC SETC '@@LAB@5'
000038 &DSSIZE SETA 256
====== &MSIZE SETA @@LAB@3L
====== AIF (&DSSIZE GE &MSIZE).@@OK@3
====== .@@OK@3 ANOP
.OAAAE &MSIZE SETA @@LAB@5L
.OAAAF AIF (&DSSIZE GE &MSIZE).@@OK@5
.OAAAG .@@OK@5 ANOP
代码段完全相同,除了标签差异。
关于我可以在我的 prolog 和 epilog 中做什么的任何想法,这些想法会扰乱汇编程序导致此错误。
谢谢 斯科特
在Steve Smith和Alex Brodsky的大量在线帮助下,他们(独立地(发现"在"显示的代码(在我的prolog中生成(上方,我有一个DS语句,该语句具有变量重复因子,该变量重复因子依赖于"低于"的值(由insert_asm语句中的一个宏声明(。 这样可以防止汇编程序在失败的SETA语句时知道位置计数器是什么,并且它失败了,即使语句的结果只需要相对偏移量。
为清楚起见,编译器生成的代码的要点是确保在 __asm(...:D S...( 语句中生成的数据小于或等于指定的长度(默认为 255(。
从用户的角度来看,错误消息是难以理解的。
** ASMA032E Relocatable value or unresolved symbol found when absolute value required - OPENC/@@LAB@3L
** ASMA435I Record 944 in SSAF.METALC.C.ASM(CKKTESTR) on volume: TSO001
我猜 OPENC 的意思是"开放代码",@@LAB@3L是发生故障的地方,但是在汇编程序完成后查看输出并不能明显看出@@LAB@3L在处理 SETA 时存在某种缺陷。