MAP

Showing posts with label GTU MCA 3RD SEMESTER. Show all posts
Showing posts with label GTU MCA 3RD SEMESTER. Show all posts

Features of a Symbol Table - System Software - GTU MCA


Ø  SYMTAB (symbol table)

Ø  Content
      Label name and its value (address)
      May also include flag (type, length) etc.

Ø  Usage
      Pass 1: labels are entered into SYMTAB with their address (from
                   LOCCTR) as they are encountered in the source program
       Pass 2: symbols used as operands are looked up in SYMTAB to
                   obtain the address to be inserted in the assembled instruction

Ø  Characteristic
        Dynamic table (insert, delete, search)

Ø  Implementation
        Hash table for efficiency of insertion and retrieval

COPY             1000
FIRST            1000
CLOOP          1003
ENDFIL         1015
EOF                1024
THREE          102D
ZERO             1030
RETADR       1033
LENGTH       1036
BUFFER        1039
RDREC         2039

            SYMBOL TABLE(SYMTAB)

Example Of Assembly language along with the objectcode generated | System Software Example of Assembly Language. - GTU MCA SEM-3RD.


example of Assembly language along with the objectcode generated

Line    Loc         Source statement                                      Object code

5          1000    COPY             START         1000
10        1000    FIRST            STL              RETADR         141033
15        1003    CLOOP          JSUB            RDREC           482039
20        1006                             LDA            LENGTH         001036
25        1009                            COMP            ZERO             281030
30        100C                           JEQ                ENDFIL         301015
35        100F                            JSUB              WRREC        482061
40        1012                              J                    CLOOP          3C1003          
45        1015    ENDFIL         LDA                EOF                00102A
50        1018                            STA                BUFFER        0C1039
55        101B                           LDA               THREE          00102D
60        101E                           STA                LENGTH       0C1036
65        1021                            JSUB              WRREC        482061
70        1024                            LDL                RETADR       081033
75        1027                            RSUB                                     4C0000
80        102A   EOF                BYTE               C’EOF’        454F46
85        102D   THREE          WORD                   3              000003
90        1030    ZERO             WORD                   0               000000
95        1033    RETADR       RESW                                 1
100      1036    LENGTH       RESW                      1
105      1039    BUFFER        RESB               4096 
110                  .
115                  .           SUBROUTINE TO READ RECORD INTO BUFFER
120                  .
125      2039    RDREC         LDX                ZERO            041030
130      203C                           LDA                ZERO            001030
135      203F    RLOOP          TD                   INPUT          E0205D
140      2042                            JEQ                  RLOOP        30203D
145      2045                            RD                     INPUT        D8205D
150      2048                            COMP           ZERO             281030
155      204B                           JEQ                  EXIT                         302057
160      204E                           STCH            BUFFER,X     549039
165      2051                             TIX               MAXLEN       2C205E
170      2054                            JLT                 RLOOP          38203F
175      2057    EXIT                STX                 LENGTH    101036
180      205A                              RSUB                                  4C0000
185      205D   INPUT           BYTE X’F1’  F1
190      205E   MAXLEN      WORD           4096    001000
195                  .
200                  .           SUBROUTINE TO WRITE RECORD FROM BUFFER
205                  .
210      2061    WRREC                    LDX   ZERO 041030
215      2064    WLOOP         TD      OUTPUT       E02079
220      2067                            JEQ    WLOOP         302064
225      206A                           LDCH            BUFFER,X    509039
230      206D                           WD     OUTPUT       DC2079
235      2070                            TIX     LENGTH       2C1036
240      2073                            JLT     WLOOP         382064
245      2076                            RSUB                         4C0000
250      2079    OUTPUT       BYTE X’05’   05
255                                           END  FIRST

What are the basic functions of an assembler | Assemler function in System Software. - GTU MCA MATERIAL


Functions of a Basic Assembler

Ø  Convert mnemonic operation codes to their machine
      language equivalents
           E.g. STL -> 14 (line 10)

Ø  Convert symbolic operands to their equivalent
      machine addresses
                  E.g. RETADR -> 1033 (line 10)

Ø  Build the machine instructions in the proper format

Ø  Convert the data constants to internal machine
        representations
                   E.g. EOF -> 454F46 (line 80)

Ø  Write the object program and the assembly listing

Twitter Delicious Facebook Digg Stumbleupon Favorites More