Home

A Graphical Computer Simulator for Systems Programming Courses

image

Contents

1. on such diverse platforms as VAX VMS MS DOS and UNIX Unlike computer assisted instructional tools in other disciplines however existing CSTs employ only the most rudimentary user interface mech anisms They rely on typed commands for in put and with few exceptions provide only a sin gle text based output stream CPU SIM and other Macintosh based systems make use of multiple win dows but their contents are purely textual Tuto rial facilities are noticeably lacking and online help is limited to terse explanations of command syntax In the systems programming course at Auburn University we employ the SICSIM simulator de veloped by Leland Beck to accompany his popu lar text 7 Source code for SICSIM is distributed with the text and is easily installed on most Pas cal hosts It simulates the SIC XE a hypotheti cal machine designed to reflect the features of such diverse systems as IBM 360 370 DEC VAX and Intel 80x86 Beck s model is admirable in its abil ity to expose students to the variety of instruction formats and addressing modes commonly found on popular real machines while ignoring their idiosyncracies SIC XE s 59 instructions are di vided into four formats which support 18 address ing modes integer and floating point arithmetic and device level I O The model provides a uni form basis for teaching the fundamentals of assem bler linker loader macro processor and to some extent compiler
2. is activated in context sensive 161 mode whenever the user clicks on a window title bar shown here as white text on a black ground appropriate information about the window is dis played in response For example clicking on the REGISTERS titlebar provides information on the number and purpose of SIC XE registers as well as how the display objects can be manipulated to change format register contents etc The two buttons in the SETTINGS box CONTROL and EAKPT are used for controlling program execution COUNT BS Pressing this button lets you set the number of E instructions to be executed each time you press RUN The count value is entered and displayed as a positive decinal number The default count is 1000 Me button lets you set the breakpoint address nce a breakpoint is set subsequent execution will stop at the 34 instruction immediately preceding the breakpoint J The breakpoint address is specified and displayed as a hexadecimal value The default breakpoint is FFFFh which is beyond the upper bound of memory i e no breakpoint Figure 7 The popup HELP facility Experiences with xSICSIM Written in a highly portable subset of the C language xSICSIM can be installed on any sys tem supporting release X11R4 or later of the X Window System To date it has been ported to UNIX workstations Sun 3 50 SparcStation and IPC IBM AIX systems RISC System 6000 and X Stations With the exception of one minor a
3. A Graphical Computer Simulator for Systems Programming Courses Mark Newsome and Cherri M Pancake Department of Computer Science and Engineering Auburn University AL 36849 mnewsome eng auburn edu pancake ducvaz auburn edu xSICSIM ts an X based graphical interface for the SICSIM computer simulation tool Its graphical portrayal of register level components transforms the black boz SICSIM machine into a visual computer helping students understand how com puters work Single step fast ezecution and break points are among the control features helpful for de bugging assembly language programs Automatic disassembly and format conversions and displays for comparing expected to actual execution reduce frustration in debugging loader macro processor and assembler projects Overview Computer simulation tools CSTs are becoming increasingly popular in the computer science cur ticulum These tools employ software simulation to mimic the behavior of other hardware systems From an educational standpoint CSTs offer several benefits e By using software layers to extend the capabil ities of the underlying system a CST can pro vide students with hands on experience with out the need to invest in specialized hardware Tools such as PARALLAXIS 1 for example simulate costly SIMD and MIMD multiproces sor systems e A CST can monitor the execution of stu dent programs providing feedback in situa tions where di
4. C 0000454F 46280000 00000001 00000300 00050000 00F30600 00055400 00000000 00000000 00000000 T 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 FFFFFFFF FEFFFFFF FFFFFEFFEF FRFFFFFF FEFFFEFF FRFFEFFE FEEFEFFF FFFFFFFF esis FFFFFFFF FFFFFFFF FFEFFFFFF FFFFFFFF EFEFFFFF FFFFFFFF FFFFEFFF FFFFFFFF FFFFFFFF FFFEFFFF FFFFFFFF FFFFFFFF 000000 TEST START 000000 480022 CLOOP JSUB RDREC 000003 000074 LDA LENGTH 000006 280074 COMP ONE 000009 300012 JEQ ENDFIL 00000C 480052 JSUB WRREC o0000F 3C0000 J CLOOP xSICSIM MESSAGE econ SNC aS 000012 00006A ENDFIL LDA EOF 000015 acane2 STA BUFFER Processor Stopped 000018 000074 LDA THREE 000018 0C007A STA LENGTH 00001E 480052 JSUB WRREC SETTINGS 000021 FF BYTE K FF 000022 04006 0000 000028 00002E D80070 Figure 2 Frame from sample xSICSIM session source window IRRA execution controls Figure 3 Structure of xSICSIM Figure 4 Popup windows control the value and format of each register 159 is depicted in Figure 3 Beck s SICSIM simulator provides the basic functionality but is no longer in direct contact with the user The xSICSIM interface hides the command driven simulator completely it runs SICSIM in the background taking advantage of UNIX multitasking and interprocess communi cation via pipes In the X Windo
5. MORY CONTENTS SPECIFIED COMMAND S TART R UN E NTER D UMP H COUNT B KPT Q UIT Q Figure 1 Sample SICSIM session numbered lines indicate input typed by the user 158 After SICSIM was adopted at Auburn three years ago it soon became clear that the clumsy inter face was frustrating student attempts to employ the tool Figure 1 presents the output from an inter active SICSIM session Although there are only five commands they are cryptic one letter each somewhat ambiguous e g Start vs Run and un forgiving compare the effect of blanks in lines 8 and 3 All information on program execution is in hex adecimal notation requiring that the student hand disassemble instructions and manually convert data elements to integer or character form Error detec tion is almost non existent Students complained that testing and debugging their results was easier by comparing it to printed output than by using the simulator To improve SICSIM s usability we added a graphical user interface The resulting tool xSICSIM utilizes the X Window System 8 plat form to provide simple and intuitive access to the basic functionality of the simulator see Figure 2 xSICSIM s rich visual feedback in the form of LED like light displays and color highlighting helps students see the results of program execu tion The graphical presentation also increases stu dent interest making learning more fun As the simulator executes instruct
6. design The accompanying simu lator makes it possible for students to write systems software for the SIC XE then execute their object code and observe the results SIC SIMULATOR V1 5 cm S TART R UN E NTER D UMP H COUNT B KPT Q UIT s COMMAND S TART R UH E NTER D UMP H COUNT B KPT Q UIT preg A FFFFFF X FFFFFF L FFFFFF B FFFFFF S FFFFFF T FFFFFF P 000000 CC LT COMMAND S TART R UN E HTER D UMP H COURT B KPT Q UIT D 0000 0090 0000 69100874 1740034B 10002K03 40002900 0010 01332007 4B10005C 3F2FECO3 20590F20 0020 59010003 OF40004B 10005C3E 4003B410 0030 B400B440 75100800 E3203433 2FFADB20 0040 34400433 20085740 31B8503B 2FEA57A0 0050 296D0001 90411340 004F0000 B4107740 0060 00E32012 332FFA53 A010DF20 09B8503B 0070 2FEF4F00 O0F10645 4F460000 00000000 0080 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0090 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF COMMAND S TART R UN E HTER D UMP H COUNT B XPT Q UIT R 1000 INSTRUCTIONS EXECUTED 00006F COMMAND S TART R UN E HTER D UMP H COUNT B KPT Q UIT Hi fy COMMAND S TART R UN E HTER D UMP H COUNT B KPT Q UIT R 1 INSTRUCTIONS EXECUTED P 000061 COMMAND S TART R UN E HTER D UMP H COUNT B KPT Q UIT n 1 INSTRUCTIONS EXECUTED P 000064 COMMAND S TART R UN E BTER D UMP H COUNT B KPT Q UIT D 0000 0090 EJ HO ENDING ADDRESS SPECIFIED COMMAND S TART R UN E NTER D UMP H COUNT B KPT Q UIT E RA FF COMMAND S TART R UN E NTER D UMP H COUNT B KPT Q UIT E 0005 Ea INVALID ADDRESS SPECIFIED INVALID ME
7. djustment the interface preserves the total in dependence of SICSIM which may still be invoked via its command line interface xSICSIM was used successfully over the past year in CSE400L the systems programming laboratory course required for undergraduates in the Com puter Science and the Computer Engineering cur ricula at Auburn The response has been very fa vorable In particular the graphical interface is cited as being both appealing and useful 2SICSIM is written in Pascal notorious for its I O buffer ing The program was modified to flush the buffer after each write ensuring that xSICSIM receives an immediate response from the simulator otherwise unacceptable delays would occur in the display as the buffer filled Judging from the quality of student implementa tions of assemblers and macro processors xSICSIM increases student interest and improves their under standing of the interrelationships between source code object code and CPU operation Students report that the tool s error detection capabilities which identify illegal opcodes malformed instruc tions and out of range addresses are helpful in localizing mistakes or misalignments in the object code format a task which previously was frustrat ing and time consuming In effect xSICSIM con verts the black box SICSIM machine into a vi sual computer which reinforces the student s men tal model of computer operation By observing how
8. e stored as 24 bit binary numbers using 2 s complement to represent negative values while characters make use of standard 8 bit ASCII codes The LEDs display the binary representation of the register values each light representing one bit In addition the hexadecimal or optionally the ASCII value appears in the upper lefthand corner of each register display the display mode is changed by clicking the righthand mouse button while the cursor is positioned over the register A register s value may be changed via a popup window acti vated when the lefthand mouse button is pressed The popup also allows the student to view the reg ister contents in binary hexadecimal or decimal format see Figure 4 Figure 5 The MEMORY DUMP window 1 Although Beck s model also supports a 6 byte floating point register its is not supported by the SICSIM simulator and therefore cannot be used in student programs Location Opcede Source Line ogodo0 TEST START 000000 480022 cLOOP 000003 00007A 000006 280071 000009 300012 oooooc 480052 00000F 3C0000 000012 O0006A 000015 0C0082 0060018 00001B 00001E 000021 000022 000025 000028 000028 00002 J ENDFIL S Figure 6 The USER LISTING window Storage Display The scrollable MEMORY DUMP window Figure 5 displays the contents of memory in both hexadecimal and ASCII represen tations To alter storage values the user presses the lefthand mouse button while the cursor is po
9. in dicated by the Program Counter and changes the button label to Stop A subsequent press halts exe cution and restores the label to Execute Execution also stops automatically when a HLT HALT in struction is executed an error illegal instruction ALU or I O error is detected or a breakpoint is reached Special settings are used to control the rapid execution options supported by the simulator The count button manages the so called execution counter which reflects the number of instructions executed since the last Reset operation or count ex piration When the value of the counter has been reached execution halts and a message is displayed in the MESSAGES area Selecting breakpt ac 160 tivates a popup window where the user indicates breakpoint addresses Whenever a breakpoint lo cation is accessed during the instruction fetch se quence execution is halted and a message is issued to the MESSAGES area Execution may then be resumed by the Execute or Single Step mecha nisms The user may also start execution at an arbitrary location in the program by selecting the Program Counter register entering the new loca tion and and resuming execution via Single Step or Execute Register Displays The REGISTERS window contains LED panels representing the SIC XE reg isters A Accumulator X Index L Linkage B Base S General Purpose T General Purpose and Program Counter each 3 bytes in length In tegers ar
10. ions the user can ob serve changes to the contents of memory registers and the program counter The information can be viewed and manipulated in several familiar formats hexadecimal decimal binary and ASCII with automatic conversion between them An automatic disassembly feature dissects the current instruction into opcode addressing mode and operand fields indicating how the object code is interpreted by the simulator xSICSIM s interface mechanics based on single stroke access to common functions reduce the likelihood that new errors will be introduced by typing mistakes Finally students are more pro ductive because bugs are easier to identify and fix This paper describes the structure of xSICSIM Although the interface clearly was designed to en hance the functionality of Beck s SICSIM the prin ciples are equally applicable to a variety of related tools e g MicMac 4 CPU SIM 5 MIC 10 9 SIM68 10 used in teaching computer organiza tion assembly language programming and systems programming Components of xSICSIM The xSICSIM system exploits recent advances in graphical interface technology Its overall structure a REGISTERS MEMORY 48002200 00742800 71300012 4800523 H 00000000 GABCOG82 0000740C 00744800 52FF0400 GEQODODGE 0007030 0028D800 R 7D280077 38004054 80822C00 7F380028 w 54808210 O07A0000 74180071 OCOO7AAC T 00000400 GEE0007E 30005550 80820C00 7E2C007A 3800554
11. rect execution would be impos sible or impractical VHDL 2 for example simulates machine execution based on an ar chitectural specification allowing the student to test his or her design Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage the ACM copyright notice and the title of the publication and its date appear and notice is given that copying is by permission of the Association for Computing Machinery To copy otherwise or to republish requires a foe and or specific permission 1992 ACM 0 89791 468 6 92 0002 0157 31 50 157 e Because the CST intervenes between the user and the system it can mask irrelevant details in order to maximize the educational experi ence ASSIST 3 for example hides the intri cacies of assembly language I O by providing a series of high level pseudo instructions Since a CST is implemented completely in soft ware it can simulate hypothetical as well as teal systems MicMac 4 and CPU SIM 5 for example allow students to study computer or ganization through abstract instructions which approximate but do not duplicate the behav ior of actual machines Because they are designed for use in a variety of educational settings CSTs often are sup ported across a range of computer systems The SICSIM program 6 for example is writ ten in standard Pascal and has been installed
12. roprogram ming and Conventional Machine Language ACM SIGCSE Bulletin 20 4 43 49 Decem ber 1988 10 Allen Laura Sim68000 A Simulator for the MC68000 Version 2 unpublished report dis tributed by University of Florida 1990 11 Peterson Chris D Athena Widget Set C Lan guage Interface Cambridge MA Massachusetts Institute of Technology and Digital Equipment Corporation 1989
13. si tioned over the window This activates a data entry popup similar to the register popup Again values may may be entered in any format The MEM ORY scrollbar is used to bring the desired region of memory into view Clicking on the arrows located at either end of the bar causes the display to scroll one line alternatively the thumb grey region in side the bar can be dragged until the desired area is visible Source Code Display The program is executed directly from the student s object code file and re flects any anomalies in its format To facilitate the identification of incorrect object instructions the USER LISTING window Figure 6 provides quick access to the expected instructions the original assembly language instruction the location counter and the object code generated by the as sembler As in the MEMORY window a scrollbar allows easy navigation through the program text Help and Tutorial Features On line help is al ways available via popup windows see Figure 7 The hierarchically organized help system makes use of xhelp an X utility also developed by the au thors to provide a tutorial style introduction to the mechanics of the interface the SIC XE machine ar chitecture SIC XE assembly language and details of program execution Selecting the master help button labeled HELP enters the help system at the top level and is used primarily by newcomers to xSICSIM In addi tion the help facility
14. the machine interprets and responds to each instruction he or she can identify the cause and ef fect of object code anomalies without the tedium of manual format conversions and disassembly References 1 Barth Ingo Thomas Braunl and Frank Sem bach Parallazis User Manual Technical Report 3 90 Universitaet Stuttgart Computer Science Department March 1990 2 Coelho David R The VHDL Handbook Boston Kluwer Academic Publishers 1989 3 Overbeek Ross A Assembler langauge with ASSIST and ASSIST I Chicago Science Re search Associates 1986 4 Donaldson John L MicMac a Microprogram Simulator for Courses in Computer Organiza tion ACM SIGCSE Bulletin 20 3 428 431 September 1988 5 Skrien Dale and John Hosack Multilevel Sim ulator at the Register Transfer Level for Use in an Introductory Machine Organization Class ACM SIGCSE Bulletin 23 1 347 351 March 1991 6 Beck Leland L SICSIM documentation un published manuscript from San Diego State Uni versity distributed by Addison Wesley 1990 7 Beck Leland L Systems Software An Intro duction to Systems Programming Reading MA Addison Wesley 1990 8 Scheifler Robert and James Gettys X Window System Complete Reference to Xlib X Protocol ICCCM XLFD Second Edition Bedford MA Digital Press 1990 162 9 Sayers Jerry E and David E Martin A Hy pothetical Computer to Simulate Mic
15. w System tradition the user interacts with interface objects displayed on the screen which in turn communicate with the xSICSIM controller All user input is captured interpreted and responded to by the controller or reformulated as one or more commands to SICSIM SICSIM output is likewise intercepted and refor matted for display in one of the interface objects The interface objects are implemented using standard X Window System widgets from the Athena widget set 11 augmented by specialized widgets designed at Auburn The nature and use of each object is described below Ezecution Control xSICSIM is operated via pushbutton panels the white buttons in Figure 2 Selecting Reset cold starts the SIC XE pro cessor with a hardware reset This causes the machine to set all memory locations to a hex value of FF clear all registers to 00 and reset all I O de vices Reset also precipitates several housekeep ing tasks that previously had to be handled by the user such as invoking the SICSIM relocating loader as well as loading the USER LISTING win dow with the assembly language listing file After a Reset operation has been performed the object code is in memory and awaits execution The Single Step option allows the user to step through program execution one instruction at a time Alternatively Execute may be used as a tog gle to start stop rapid execution of the program Pressing it resumes execution at the location

Download Pdf Manuals

image

Related Search

Related Contents

柏研修センター実施要項(案) - 国土交通大学校  aceite italika  Participation, choix occupationnel et gains sur un marché du travail  Publier sur SPIP 3  Aparato de ensayo de tracción LEISTER Examo  Samsung RHF050ETE Manuel de l'utilisateur  

Copyright © All rights reserved.
Failed to retrieve file