SICXE 程序集中整数的反向列表

Reverse list of integers in SICXE assembly

我的作业要求我列出一个数字列表,然后使用 SICXE 将它们倒序排列。我的问题出在我实际上不知道如何检查反转是否真的发生了,所以我实际上无法判断我的程序是否按照我想要的方式工作。我可以阅读转储并知道我的原始列表在哪里,但我不明白我应该在哪里看到反向列表以查看我所做的是否真正起作用。我实际上无法在这里找到受人尊敬的列表。我假设它应该从 15F 开始,因为那是 BETA 以 10 个保留字开始的地方。但是由于那里没有任何显示,我认为这意味着我做错了什么,但实际上我不确定我是否正确。如果我是,我应该如何解决我的问题?我将包括 .lst 文件以及 sic.log 文件。

.lst 文件

*********************************************
University of North Florida: SIC/XE assembler
version date 11/12/2002
account: n00832607; Sun Mar  1 22:45:33 2015
*********************************************
ASSEMBLER REPORT
----------------
     Loc   Object Code       Source Code
     ---   -----------       -----------
001- 00100                      START   100
002- 00100 01001E               LDA     #30
003- 00103 0F2035               STA     INDEX1  . ALPHA DECREASING INDEX
004- 00106 010000               LDA     #0
005- 00109 0F2032               STA     INDEX2  . BETA INCREADING INDEX
006- 0010C 6D0003               LDS     #3      . INITALIZE REGISTER S TO 3
007- 0010F 750000               LDT     #0      . INITALIZE REGISTER T TO 0
008- 00112 072026            REVLP      LDX     INDEX1  . INITALIZE INDEX REGISTER
009- 00115 03A029               LDA     ALPHA,X . LOAD WORD FROM ALPHA INTO REGISTER A
010- 00118 072023               LDX     INDEX2
011- 0011B 0FA041               STA     BETA,X  . STORE WORD IN BETA
012- 0011E 03201A               LDA     INDEX1
013- 00121 1D0003               SUB     #3
014- 00124 0F2014               STA     INDEX1
015- 00127 032014               LDA     INDEX2
016- 0012A 190003               ADD     #3
017- 0012D 0F200E               STA     INDEX2
018- 00130 07200B               LDX     INDEX2
019- 00133 A015                 COMPR   X,T     . COMPARE NEW X INDEX VALUE TO 30
020- 00135 3B2FDA               JLT     REVLP   . LOOP IF INDEX GREATER THAN 30
021- 00138 4F0000               RSUB
022- 0013B                   INDEX1     RESW    1
023- 0013E                   INDEX2     RESW    1
024- 00141 00005D            ALPHA      WORD    93
025- 00144 000032               WORD    50
026- 00147 0000C5               WORD    197
027- 0014A 000037               WORD    55
028- 0014D 000060               WORD    96
029- 00150 000041               WORD    65
030- 00153 00004A               WORD    74
031- 00156 00005C               WORD    92
032- 00159 00002B               WORD    43
033- 0015C 000008               WORD    8
034- 0015F                   BETA       RESW    10
035- 0017D                      END

sic.log 文件

SIC SIMULATOR V1.6
File names are:
loader
DEVF1
DEVF2
DEVF3
DEV04
DEV05
DEV06
COMMAND: A(CCEPT file names, R(ENAME 1 or more files
r
loader
DEVF1
Project2.obj
DEVF2
DEVF3
DEV04
DEV05
DEV06
File names are:
loader
Project2.obj
DEVF2
DEVF3
DEV04
DEV05
DEV06
COMMAND: A(CCEPT file names, R(ENAME 1 or more files
a

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
s

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=00005F

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d r
A=000000   X=000011   L=00003A   B=000100
S=FFFFFF   T=FFFFFF   P=00005F   CC=LT

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=000029

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d r
A=002C03   X=000028   L=000042   B=000100
S=FFFFFF   T=FFFFFF   P=000029   CC=EQ   

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=000048

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d r
A=00113E   X=000000   L=00003A   B=00013E
S=FFFFFF   T=FFFFFF   P=000048   CC=EQ   

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d
INVALID STARTING ADDRESS
NO ENDING ADDRESS SPECIFIED

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=000048

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d r
A=000000   X=00000D   L=000042   B=000141
S=FFFFFF   T=FFFFFF   P=000048   CC=LT

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=000029

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d r
A=002600   X=000000   L=000042   B=00017D
S=FFFFFF   T=FFFFFF   P=000029   CC=LT

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d
INVALID STARTING ADDRESS   
NO ENDING ADDRESS SPECIFIED

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d
INVALID STARTING ADDRESS
NO ENDING ADDRESS SPECIFIED

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d
INVALID STARTING ADDRESS
NO ENDING ADDRESS SPECIFIED

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d 100-200

0100 01001E0F 20350100 000F2032 6D000375
0110 00000720 2603A029 0720230F A0410320
0120 1A1D0003 0F201403 20141900 030F200E
0130 07200BA0 153B2FDA 4F0000FF FFFFFFFF 
0140 FF00005D 00003200 00C50000 37000060
0150 00004100 004A0000 5C00002B 000008FF
0160 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
0170 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
0180 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
0190 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01A0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01B0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01C0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01D0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01E0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01F0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
0200 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
q

第二天早上我又开始研究这个问题,并注意到我的错误在哪里。 INDEX1 需要设置为 27 而不是 30,因为它从 0 而不是 3 开始。经过 10 次移动后,它将以 27 而不是 30 结束。此外,T 应该设置为 30。我假设反向列表是正确的数字将从存储 BETA 的 10 个保留字的内存地址开始。在本例中为 15C。我会 post 正确的 .lst 和 sic.log 文件。我还在 sic.log.

下面提供了转储的解释

.lst

*********************************************
University of North Florida: SIC/XE assembler
version date 11/12/2002
account: n00832607; Mon Mar  2 08:35:05 2015
*********************************************
ASSEMBLER REPORT
----------------
     Loc   Object Code       Source Code
     ---   -----------       -----------
001- 00100                      START   100
002- 00100 01001B               LDA     #27
003- 00103 0F2032               STA     INDEX1
004- 00106 010000               LDA     #0
005- 00109 0F202F               STA     INDEX2
006- 0010C 6D0003               LDS     #3      . INITALIZE REGISTER S TO 3
007- 0010F 75001E               LDT     #30     . INITALIZE REGISTER T TO 30
008- 00112 072023            REVLP      LDX     INDEX1
009- 00115 03A026               LDA     ALPHA,X . LOAD WORD FROM ALPHA INTO REGISTER A
010- 00118 072020               LDX     INDEX2
011- 0011B 0FA03E               STA     BETA,X  . STORE WORD IN BETA
012- 0011E 032017               LDA     INDEX1
013- 00121 1D0003               SUB     #3
014- 00124 0F2011               STA     INDEX1
015- 00127 032011               LDA     INDEX2
016- 0012A 190003               ADD     #3
017- 0012D 0F200B               STA     INDEX2
018- 00130 A015                 COMPR   X,T     . COMPARE NEW X INDEX VALUE TO 30
019- 00132 3B2FDD               JLT     REVLP   . LOOP IF INDEX GREATER THAN 30
020- 00135 4F0000               RSUB
021- 00138                   INDEX1     RESW    1
022- 0013B                   INDEX2     RESW    1
023- 0013E 00005D            ALPHA      WORD    93
024- 00141 000032               WORD    50
025- 00144 0000C5               WORD    197
026- 00147 000037               WORD    55
027- 0014A 000060               WORD    96
028- 0014D 000041               WORD    65
029- 00150 00004A               WORD    74
030- 00153 00005C               WORD    92
031- 00156 00002B               WORD    43
032- 00159 000008               WORD    8
033- 0015C                   BETA       RESW    10
034- 0017A                      END

sic.log

   SIC SIMULATOR V1.6
File names are:
loader
DEVF1
DEVF2
DEVF3
DEV04
DEV05
DEV06
COMMAND: A(CCEPT file names, R(ENAME 1 or more files
r
loader
DEVF1   
Project2.obj
DEVF2
DEVF3
DEV04
DEV05   
DEV06
File names are:
loader
Project2.obj
DEVF2   
DEVF3
DEV04
DEV05
DEV06
COMMAND: A(CCEPT file names, R(ENAME 1 or more files
a

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
s

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=00005C

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=00002F

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=000056

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=00003C

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
  1000 INSTRUCTIONS EXECUTED
P=00012A

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
r
ATTEMPT TO READ DEVF1 PAST END OF FILE
P=000053

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
d 100-200

0100 01001B0F 20320100 000F202F 6D000375
0110 001E0720 2303A026 0720200F A03E0320
0120 171D0003 0F201103 20111900 030F200B
0130 A0153B2F DD4F0000 FFFFFA00 00210000
0140 5D000032 0000C500 00370000 60000041
0150 00004A00 005C0000 2B000008 00000800
0160 002B0000 5C00004A 00004100 00600000
0170 370000C5 00003200 005D0000 1EFFFFFF
0180 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
0190 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01A0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01B0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01C0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01D0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01E0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
01F0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
0200 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF

COMMAND: S(TART, R(UN, E(NTER, D(UMP, H(COUNT, B(KPT, F(ILES, T(RACE, Q(UIT?
q


13E - 93
141 - 50
144 - 197
147 - 55
14A - 96
14D - 65
150 - 74
153 - 92
156 - 43
159 - 8

15C - 8
15F - 43
162 - 92
165 - 74
168 - 65
16B - 96
16E - 55
171 - 197
174 - 50
177 - 93

正如您在转储中看到的那样,159 是 ALPHA 列表中的最后一个数字所在的位置。它的目标代码是 000008。然后紧接着在 15C 中还有另一个 000008,它开始反向列表。