This presentation is the property of its rightful owner.
Sponsored Links
1 / 40

本節介紹支援 SIC/XE 機器架構的組譯程式設計。 SIC/XE 機器的組合語言範例程式及對應的目的碼請見 Figure 2.6(p. 58) 。 PowerPoint PPT Presentation


  • 137 Views
  • Uploaded on
  • Presentation posted in: General

本節介紹支援 SIC/XE 機器架構的組譯程式設計。 SIC/XE 機器的組合語言範例程式及對應的目的碼請見 Figure 2.6(p. 58) 。 此程式是將 Figure 2.2 的程式以 SIC/XE 機器的指令改寫而成。 此程式大量的使用 register-to-register 指令來替代原本的 register-to-memory 的指令。 將指令大量改寫為立即定址法的指令。. 2.2 與機器相關的組譯程式特性. 在 SIC/XE 機器的組合語言程式中,「間接定址」指令是在運算元之前加一個「 @ 」符號來表示。

Download Presentation

本節介紹支援 SIC/XE 機器架構的組譯程式設計。 SIC/XE 機器的組合語言範例程式及對應的目的碼請見 Figure 2.6(p. 58) 。

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Sic xe sic xe figure 2 6 p 58

  • SIC/XE

  • SIC/XE Figure 2.6(p. 58)

    • Figure 2.2SIC/XE

    • register-to-register register-to-memory

2.2


Sic xe sic xe figure 2 6 p 58

  • SIC/XE@

    • 70 J @RETADR

    • 95 RETADR RESW 1

2.2


Sic xe sic xe figure 2 6 p 58

  • SIC/XE#

    • 12 LDB #LENGTH

    • 25 COMP #0

    • 55 LDA #3

    • 133 +LDT #4096

2.2


Sic xe sic xe figure 2 6 p 58

  • (register-to-memory)()

    • BASE

    • ()

2.2


Sic xe sic xe figure 2 6 p 58

  • 2.2.1SIC/XE(SIC)

  • 2.2.2SIC/XE multiprogramming()

    • SIC/XE

    • ()

2.2


Sic xe sic xe figure 2 6 p 58

FIX(C416), FLOAT (C016), HIO(F416), TIO(F816)OPTAB()

2.2.1

OP

8


Sic xe sic xe figure 2 6 p 58

  • register-to-register CLEAR(B416), COMPR(A016)

  • OPTAB

    • 125 RDREC CLEARX

    • 130 CLEARA

    • 132 CLEARS

    • 150 COMPRA, S

2.2.1


Sic xe sic xe figure 2 6 p 58

  • SYMTAB

    • A(016), X(116), L(216), PC(816), SW (916), B(316), S(416), T(516), F(616)

2.2.1

r1

OP

r2

8

4

4


Sic xe sic xe figure 2 6 p 58

  • register-to-memory ()

    • (PC)

    • (B)

  • :

2.2.1

OP

n

i

x

b

p

e

disp

6

6

12


Sic xe sic xe figure 2 6 p 58

    • 20 bitsSIC/XE(1M bytes)

    • address

2.2.1


Sic xe sic xe figure 2 6 p 58

  • +

  • +()

    • )

2.2.1


Sic xe sic xe figure 2 6 p 58

  • LineLOCObject code

    15 0006 +JSUB RDREC4B101036

    .

    125 1036REREC CLEAR X

    : JSUB = (48)16

2.2.1

OP

n

i

x

b

p

e

address

6

6

20


Sic xe sic xe figure 2 6 p 58

  • register-to-memory ?

    • (disp)

    • disp

2.2.1


Sic xe sic xe figure 2 6 p 58

  • ()

    LineLOCObject code

    10 0000 FIRST STL RETADR17202D

    .

    95 0030RETADR RESW 1

    Disp=(030)16-(003)16= (02D)16 PCdisp

    STL =(14)16

2.2.1


Sic xe sic xe figure 2 6 p 58

  • ()

    LineLOCObject code

    15 0006 CLOOP +JSUB RDREC

    .

    40 0017J CLOOP 3F2FEC

    Disp=(006)16-(01A)16= (-14)16 PCdisp

    J =(3C)16

2.2.1


Sic xe sic xe figure 2 6 p 58

  • Line 20 Object code

    LineLOCObject code

    20 000A LDA LENGTH ??????????

    .

    100 0033LENGTHRESW 1

    LDA =(00)16

2.2.1


Sic xe sic xe figure 2 6 p 58

  • ?

    • (disp)

    • BASE TA

    • () NOBASE

2.2.1


Sic xe sic xe figure 2 6 p 58

  • ()

    LineLOCObject code

    12 0003 LDB #LENGTH69202D

    13 BASE LENGTH

    100 0033 LENGTH RESW 1

    105 0036BUFFER RESB 4096

    160 104E STCH BUFFER,X 57C003

    Disp=(036)16-(033)16= (003)16 Bdisp

    STCH =(54)16

2.2.1


Sic xe sic xe figure 2 6 p 58

  • ()

    LineLOCObject code

    12 0003 LDB #LENGTH69202D

    13 BASE LENGTH

    100 0033 LENGTH RESW 1

    175 104E EXIT STX LENGTH134000

    Disp=(033)16-(033)16= (000)16 Bdisp

    STX =(10)16

2.2.1


Sic xe sic xe figure 2 6 p 58

LineLOCObject code

12 0003 LDB #LENGTH 69202D

55 0020 LDA #3 010003

133 103C +LDT #4096 75101000

100 0033 LENGTH RESW 1

LDA =(00)16 LDB =(68)16 LDT =(74)16

2.2.1


Sic xe sic xe figure 2 6 p 58

LineLOCObject code

70 002A J @RETADR3E2003

95 0030 RETADR RESW 1

J =(3C)16

2.2.1


Sic xe sic xe figure 2 6 p 58

PROG1 START 0

LDS #3

+LDT #3072

CLEAR X

ADDLP +LDA ALPHA,X

+ADD BETA,X

+STA GAMMA,X

ADDR S,X

COMPR X, T

JLT ADDLP

RSUB

ALPHA RESW 1024

BETA RESW 1024

GAMA RESW 1024

END PROG1


Sic xe sic xe figure 2 6 p 58

PROG1 START 0

LDS #3

+LDT #3072

CLEAR X

ADDLP +LDA ALPHA,X

+ADD BETA,X

+STA GAMMA,X

ADDR S,X

COMPR X, T

JLT ADDLP

RSUB

ALPHA RESW 1024

BETA RESW 1024

GAMA RESW 1024

END PROG1

LOC

(0000)16

(0003)16

(0007)16

(0009)16

(000D)16

(0011)16

(0015)16

(0017)16

(0019)16

(001C)16

(001F)16

(0C1F)16

(181F)16


Sic xe sic xe figure 2 6 p 58

PROG1 START 0

LDS #3

+LDT #3072

CLEARX

ADDLP +LDA ALPHA,X

+ADD BETA,X

+STA GAMMA,X

ADDRS,X

COMPRX, T

JLT ADDLP

RSUB

ALPHA RESW 1024

BETA RESW 1024

GAMA RESW 1024

END PROG1

Object code

(6D0003)16

(75100C00)16

(B410)16

(0390001F)16

(1B900C1F)16

(0F90181F)16

(9041)16

(A015)16

(3B2FED)16

(4F0000)16


Sic xe sic xe figure 2 6 p 58

SUM START 0

FIRST LDX #0

LDA #0

+LDB #TABLE2

BASE TABLE2

LOOP ADD TABLE,X

ADD TABLE2,X

TIX COUNT

JLT LOOP

+STA TOTAL

RSUB

COUNT RESW 1

TABLE RESW 2000

TABLE2 RESW 2000

TOTAL RESW 1

END FIRST


Sic xe sic xe figure 2 6 p 58

SUM START 0

FIRSTLDX #0

LDA #0

+LDB #TABLE2

BASE TABLE2

LOOPADD TABLE,X

ADD TABLE2,X

TIX COUNT

JLT LOOP

+STA TOTAL

RSUB

COUNT RESW 1

TABLE RESW 2000

TABLE2 RESW 2000

TOTAL RESW 1

END FIRST

LOC

(0000)16

(0003)16

(0006)16

(000A)16

(000D)16

(0010)16

(0013)16

(0016)16

(001A)16

(001D)16

(0020)16

(1790)16

(2F00)16


Sic xe sic xe figure 2 6 p 58

SUM START 0

FIRST LDX #0

LDA #0

+LDB #TABLE2

BASE TABLE2

LOOP ADD TABLE,X

ADD TABLE2,X

TIX COUNT

JLT LOOP

+STA TOTAL

RSUB

COUNT RESW 1

TABLE RESW 2000

TABLE2 RESW 2000

TOTAL RESW 1

END FIRST

Object code

(050000)16

(010000)16

(69101790)16

(1BA013)16

(1BC000)16

(2F200A)16

(3B2FF4)16

(0F102F00)16

(4F0000)16


Sic xe sic xe figure 2 6 p 58

()

2.2, page 55 & 58

2.2.1


2 2 2

2.2.2

  • (I/O)

    • (multiprogramming)

    • ()()


2 2 21

2.2.2

    • ()


2 2 22

2.2.2

  • Figure 2.6 (P. 58)

  • 50007420:

    • 5 0000 COPY START 0

    • .

    • 15 0006 CLOOP +JSUB RDREC(4B101036)

    • .

    • 125 1036 RDREC CLEAR X (B410)


Sic xe sic xe figure 2 6 p 58

2.7

1036+5000

1036+7420


2 2 23

2.2.2

  • RDREC1036bytes

    • 15 CLOOP +JSUB RDREC ()

    • ()(COPY)

    • 15 CLOOP +JSUB RDREC(4B101036)


2 2 24

2.2.2

  • ()

    • ()

    • (relocatable program)

  • ?

    • ()


2 2 25

2.2.2

  • ()

    • SIC/XE

    • SIC RSUB

  • SIC/XE(Figure 2.6, P. 58):

    • LineLocSource StatementObject code

    • 15 0006 CLOOP +JSUB RDREC 4B101036

    • 40 0013 +JSUB WRREC 4B10105D

    • 65 0026 +JSUB WRREC 4B10105D


Sic xe sic xe figure 2 6 p 58

1M

2716

8916

JSUB

M00000705


2 8 2 6

2.82.6


2 2 26

2.2.2

  • SIC(Figure 2.2, P. 47)COPY0?

  • 31:

    • Line 10~70

    • Line 125~175

    • Line 210~240


Sic xe sic xe figure 2 6 p 58

  • :

    • ()

2.2.2


  • Login