System Programming Mid-Term 2

Slides:



Advertisements
Similar presentations
1 Loaders and Linkers Chapter 3 System Software An introduction to systems programming Leland L. Beck.
Advertisements

1 Loaders and Linkers Chapter 3 System Software An introduction to systems programming Leland L. Beck.
Chapter 3 Loaders and Linkers
3. Loaders & Linkers1 Chapter III: Loaders and Linkers Chapter goal: r To realize how a source program be loaded into memory m Loading m Relocation m Linking.
Chapter 3 Loaders and Linkers
COP 3402 Systems Programming Dr. Ali Orooji School of EECS University of Central Florida.
Chapter 3 Loaders and Linkers. Purpose and Function Places object program in memory Linking – Combines 2 or more obj programs Relocation – Allows loading.
Loaders and Linkers CS 230 이준원. 2 Overview assembler –generates an object code in a predefined format »COFF (common object file format) »ELF (executable.
Loaders and Linkers Object Program contains the information:
Chapter 3 System Software
Chap 3 Loaders and Linkers. Object program contains translated instructions and data values from the source program. Loading, which brings the object.
System Programming Mid-Term Date: October 28th, 2005 Time: 09:10-12:00.
CS2422 Assembly Language and System Programming Loader Department of Computer Science National Tsing Hua University.
Simplified Instructional Computer (SIC). SIC Architecture Two versions: SIC and SIC/XE (extra equipments). SIC program can be executed on SIC/XE. Memory.
SP Mid-Term Exam Chang-Yu Wu 2006/12/03. Q1. Consider the memory contents shown in the following figure. What would be loaded to register A with the instruction.
Chapter 6: Machine dependent Assembler Features
CPS4200 System Programming 2007 Spring 1 Systems Programming Chapter 2 Assembler I.
CPE2 3 KU Program Linking System Software Emergency Resolution Lecture #1.
CS2422 Assembly Language and System Programming Linking Loader Department of Computer Science National Tsing Hua University.
Chih-Hung Wang Chapter 2: Assembler (Part-1) 參考書目 Leland L. Beck, System Software: An Introduction to Systems Programming (3rd), Addison-Wesley, 1997.
CS2422 Assembly Language & System Programming January 2, 2007.
System Software by Leland L. Beck Chapter 2
CS2422 Assembly Language & System Programming December 22, 2005.
Homework Assignment- SIC/XE Assembler Hsung-Pin Chang Department of Computer Science National Chung Hsing University.
An introduction to systems programming
1 Chapter 3 Loaders and Linkers Source Program Assembler Object Code Loader Executable Code Linker.
Loader- Machine Dependent Loader Features
CS2422 Assembly Language & System Programming December 26, 2006.
Assembler (Basic Functions)
A Simple Two-Pass Assembler
What is System Software? -a program that manages and supports the computer resources - manages operations of a computer system while it executes various.
5-1 Chapter 5 - Languages and the Machine Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of Computer.
Assemblers.
Computer Science 101 How the Assembler Works. Assembly Language Programming.
Chapter 1 Computer architecture Languages: machine, assembly, high
1 Assemblers System Software by Leland L. Beck Chapter 2.
Assemblers System Software by Leland L. Beck Chapter 2.
5-1 Chapter 5 - Languages and the Machine Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
1 Assemblers System Programming by Leland L. Beck Chapter 2.
2 : Assembler 1 Chapter II: Assembler Chapter goal: r Introduce the fundamental functions that any assembler must perform. m Assign machine address m Translate.
Chapter - 3 Loaders & Linkers. Overview of Chapter 3 Basic Loader Functions Design Issues of: An Absolute Loader Simple Bootstrap Loader Machine-Dependent.
1 Assemblers System Software by Leland L. Beck Chapter 2.
G.Umamaheswari Lect/IT R.M.D.EC system software
Assemblers System Software by Leland L. Beck Chapter 2.
Loader and Linker.
Assemblers System Software.
Linking Loader untuk SIC/XE Machine. Lebih Lanjut mengenai Absolute Loader Shortcoming of an absolute loader –Programmer needs to specify the actual address.
1 Software Project n Design and implement an assembly for SIC/XE The test data look like Figure 2.5. and are generated by MS Notepad. The possible OPCODE.
UNIT III LOADERS AND LINKERS. This Unit gives you… Basic Loader Functions Machine-Dependent Loader Features Machine-Independent Loader Feature Loader.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 – Loaders.
CPS4200 System Programming Spring 1 Systems Programming Chapter 1 Background I.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 4 - Assembler 1.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 –Linkers.
CC410: System Programming
Calculation of REF5 (ENDC-LISTC-10)
System Programming System Software:
Machine dependent Assembler Features
System Programming and administration
System Software by Leland L. Beck Chapter 2
SYSTEM SOFTWARE - UNIT II
Loaders and Linkers CSCI/CMPE 3334 David Egle.
Loaders and Linkers.
A Simple Two-Pass Assembler
System Programming by Leland L. Beck Chapter 2
Welcome to Systems Software
Loaders and Linkers.
Chapter 1 Computer architecture Languages: machine, assembly, high
An introduction to systems programming
UNIT III LOADERS AND LINKERS
Chapter 3 Loaders and Linkers
Presentation transcript:

System Programming Mid-Term 2 Date: December 30th, 2005 Time: 09:10-12:00 2006/1/6

Q1(10%) Translate (by hand) the following assembly program to SIC/XE object code. Loc Source statement Object code SUM2 #START #0 FIRST #LDX #LDA +LDB #TABLE2 #BASE LOOP #ADD #TABLE,X #TABLE2,X #TIX #COUNT #JLT #LOOP +STA #TOTAL #RSUB COUNT #RESW #1 TABLE #2000 TABLE2 TOTAL #END #FIRST

Q1(10%) Translate (by hand) the following assembly program to SIC/XE object code. Loc Source statement Object code SUM2 #START #0 0000 FIRST #LDX 050000 0003 #LDA 010000 0006 +LDB #TABLE2 69101790 #BASE 000A LOOP #ADD #TABLE,X 1BA013 000D #TABLE2,X 1BC000 0010 #TIX #COUNT 2F200A 0013 #JLT #LOOP 3B2FF4 0016 +STA #TOTAL 0F102F00 001A #RSUB 4F0000 001D COUNT #RESW #1 0020 TABLE #2000 1790 TABLE2 2F00 TOTAL 2F03 #END #FIRST

Q1(10%) HSUM2 000000002F03 T00000010050000010000691017901BA0131BC000 T0000100D2F200A3B2FF40F102F004F0000 E000000 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^

Q2(10%) Disassemble (convert object code back into assembly language) the following SIC/XE program.  HSUM 00100000000E  T0010000E01000005000190102D000B3B2FF8  E001000

Q2(10%) Loc Source statement Object code 1000 SUM START #1000 FIRST LDA #0 010000 1003 LDX #1 050001 1006 LOOP ADDR #X,A 9010 1008 TIX #11 2D000B 100B JLT #LOOP 3B2FF8 100E END #FIRST

Q3(20%) Disassemble the following SIC program. (You may choose meaningful labels for those addresses as you wish.) HEXAM2 00000000005A T0000002000004B04004848001E2000540C005848001E1800585480002C004B3C0006E000 T000020205730001ED8005728004230008028004538001E1C004528005138003F1C004E4C T00004020000000000400003000008000000000000700000A000010F1000000 E000000

Q3(20%) Loc Source statement Object code EXAM2 START 0000 FIRST LDA 0000 FIRST LDA ZERO 00004B 0003 LDX K128 040048 0006 LOOP JSUB GETC 48001E 0009 MUL K16 200054 000C STA ZERO2 0C0058 000F 0012 ADD 180058 0015 STCH FIRST,X 548000 0018 TIX 2C004B 001B J 3C0006 001E TD DEV E00057 0021 JEQ 30001E 0024 RD D80057 0027 COMP K4 280042 002A 80 300080

Q3(20%) 002D COMP K48 280045 0030 JLT GETC 38001E 0033 SUB 1C0045 0036 280051 0039 RETURN 38003F 003C K7 1C004E 003F RSUB 4C0000 0042 K4 WORD 4 000004 0045 48 000030 0048 K128 128 000080 004B ZERO 000000 004E 7 000007 0051 10 00000A 0054 K16 16 000010 0057 DEV BYTE X’F1’ F1 0058 ZERO2 005A END FIRST

Q4(20%) Explain the function of the above program. Bootstrap loader (p.128) If we modify the first three bytes from 00004B to 000000, will it make any difference? Why? No, because of both contents loaded are zero. If we modify Bytes[18:1A] from 2C004B to 2C0000, will it make any difference? Why? No, because of following instruction is “J”. What is the ID of the device accessed by this program? F1

Q5(20%) Consider the three control sections in Figure 3.8. Suppose they are linked in the sequence of PROGC+PROGB+PROGA, and the beginning load address is 001000. Print the load map (generated after Pass 1) that shows the external symbols and their addresses.

Q5(20%) Control section Symbol name Address Length PROGC 1000 0051 LISTC 1030 ENDC 1042 PROGB 1051 007F LISTB 10B1 ENDB 10C1 PROGA 10D0 0063 LISTA 1110 ENDA 1124

Q6(20%) REF5 in PROGA ENDC-LISTC-10 001042-001030+FFFFF6=000008 REF5 in PROGC 000008 REF8 in PROGA LISTB-LISTA-PROGA 0010B1+FFFFC0-0010D0=FFFFA1 REF8 in PROGB LISTB+PROGB-LISTA 000060+001051-001110=FFFFA1 REF8 in PROGC LISTB-LISTA 0010B1-001110=FFFFA1