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

时间:2015-03-02 03:59:22

标签: assembly machine-language

我的作业要求我取一个数字列表,然后使用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

1 个答案:

答案 0 :(得分:0)

第二天早上我又开始研究这个问题并注意到我的错误在哪里。 INDEX1需要设置为27而不是30,因为它从0开始,而不是3.在10次移动之后,它将以27而不是30结束。而且T应该设置为30.我的假设是正确的反向列表数字将从存储10个保留字的存储器地址开始。在这种情况下15C。我将发布正确的.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开始反转列表。