■ | Personnel and Logistical Information: |
● | Instructional contact and availability: detailed under Who Where When and Instructor Schedule. |
● | Timeline (of events fixed or more or less so): charted as Dates To Note. |
● | Access to class materials: via a front page on TxState Canvas. |
► | Tip: Click the Home tab near the upper left upon getting into the course. |
Additional notes regarding use of TxState Canvas here (for CS2318-251, CS2318-255 and CS2318-256, Spring 2025): |
► | You may see Canvas use CS 2318.251 for the "CS2318-251, CS2318-255 and CS2318-256 combined" course. (I.e., CS2318-251, CS2318-255 and CS2318-256 students share one course site that Canvas may indicate as CS 2318.251.) CS2318-255 and CS2318-256 Students: don't be confused by Canvas use of CS 2318.251 (i.e., the site is also for you). |
► | Canvas will be used to manage assignments. |
| ♯ | Task descriptions, deliverables, due dates and times, . . . (Typically via externally linked pages.) |
| ♯ | Submission of deliverables. (Typically source files in as-is text format and print-to-PDF format.) |
| ♯ | Return of graded work. (Typically submitted source files in print-to-PDF format that have been marked.) |
| You are responsible for the successful and timely uploading of the proper files when submitting assignments. |
| ♯ | (In fairness to all, negative consequences of any failures to do so will be incontestably applied.) |
► | Canvas will be used to administer in-class quizzes (ending 5 minutes of each normal, non-exam class meeting). |
| ♯ | (When
addressing attendance/participation-related matters, your
quiz-participation record on Canvas will serve as key reference.) |
| You will need to equip yourself to effectively access TxState Canvas and take such in-class quizzes. |
► | As a rule, don't attempt to send any message to instructor via Canvas Inbox. |
| ♯ | (Violators are wholly responsible for any unfavorable consequences.) |
► | In general, point values are accurate and pertinent only for each graded assignment/quiz in Canvas Gradebook. |
| (I.e., Canvas Gradebook is not set up for tasks like communicating exam scores and tracking aggregated scores/performances.) |
● | Mode of class delivery: face to face for CS2318-251 and CS2318-255, two way interactive video for CS2318-256. |
► | Where
possible/appropriate, in-class activities to be recorded using
Zoom-enabling equipment (targeting mainly the
vocals). |
| ♯ | Recordings will hopefully serve as a helpful resource for absentee/rehash use. |
| ♯ | Recordings will be made available on TxState Canvas and accessible by students currently enrolled in CS2318-251, CS2318-255 and CS2318-256. |
| Such
use of Zoom-enabling equipment is not to be mistaken with the hosting of
concurrent Zoom meetings for students to participate virtually. |
| ♯ | No hosting of concurrent Zoom meetings is contemplated or anticipated. |
● | Office hours will be remotely via Zoom Video Communication on first-come-first-served basis. |
► | Office Hour Meeting ID: 894 2532 4432 |
| (The office hours are open to ≈150 CS2318/CS3358 students, so let's use them thoughtfully.) |
● | As needed appointments: remotely via Zoom Video Communication. |
► | Appointment requests via TxState email accounts. |
● | For identification purposes, display your first and last names as provided to the university when participating events remotely via Zoom Video Communication. |
► | Also, you are expected to be equipped with a camera and microphone as some remote participations of events are subject to additional constraints that call for them. |
● | How disruptions to routine instruction will be handled. |
► | Notify via TxState email accounts at the earliest possible. |
■ | Description and Learning Objectives: |
● | This course in the main covers introductory programming using the MIPS R2000 assembly language. For effectiveness (in the learning and understanding of the subject), it also includes appropriate discussions of topics related to computer architecture (bits, bit patterns, operations on bit patterns and how bit patterns represent instructions and data, and machine organization of today's mainstream computers). Successful completion of this course will help you gain experience programming at a low (closer to actual machine) level and a good appreciation of how most of today's computers really work (how they are organized down to the basic functional component level). The background you acquired should be valuable to you in furthering your pursuit in computer science, particularly in low-level areas such as Computer Architecture, Embedded Computer Systems and Operating Systems, and more generally in becoming a well-grounded computer scientist. |
● | Learning objectives: |
► | The student will be able to represent digital information in different formats (e.g., binary, hexadecimal, IEEE 754 floating-point, and Unicode representation). |
► | The student will be able to perform binary arithmetic. |
► | The student will be able to list different classes of machine instructions, provide examples, and explain what operations various instructions perform. |
► | The student will be able to outline the process by which high-level source code is translated into machine-readable executables. |
► | The student will be able to explain how the architecture and the instruction set work together with the operating system and programming languages to accomplish computer application objectives. |
► | The student will be able to design and develop assembly-language programs. |
► | The student will be able to efficiently use recursion and estimate the overhead of function invocations. |
|
■ | Prerequisites: |
● | C or better MATH 2358 (Discrete Mathematics I). |
● | C or better in CS 2308 (Foundations of Computer Science II ). |
NOTE: | This course assumes that you are already comfortable programming using a high-level language; specifically, it assumes that you have a C/C++ programming background. |
|
■ | Suggested outside material (for doing comparative self-study): | IMPORTANT:
Overwhelmingly, the most important reference material consists of
lecture notes and examples accessible online. Typically, some
lecture notes (or parts of them) are skimmed over or skipped due to
time. Students are expected to attend lectures (and take good notes) to
be primed for what to expect in exams/quizzes and to do well. |
|
![]() |
TITLE:
MIPS Assembly Language Programming AUTHOR: Robert L. Britton EDITION / PUBLISHER / YEAR / ISBN: 1st / Pren Hall / 2004 / 0-13-142044-5 |
|
■ | Course Plan: |
Lectures/Discussions (main bullets) and Descriptions (sub-bullets) (contents guide meant to be adaptively applied, not rigidly followed) |
Readings/References (C,S -> Chap.,Sec. of text) (LN -> Lecture Note) (maybe in-class handouts) |
● | Introduction. | class website |
|
► | Class website. |
► | Highlights -> administrivia, success tips, etc. |
|
● | Big Pictures on assembly language. | LN001 |
|
► | How it relates to computer science. |
► | Abstraction in
hardware (separation of concerns, divide-and-conquer).
♯ computer level hierarchy (virtual machine layers). ♯ where assembly language fits in. |
► | Other quick takes on assembly language and assembly language programming. |
|
● | Digital representation of things. | C3, Appendix B
S11.1, S11.4 thru S11.10 LN002 thru LN005 |
|
► | Digital and
binary:
♯ what digital means and why binary. ♯ how anything can be represented digitally and in binary. |
► | Representing
unsigned whole numbers:
♯ positional number systems. ♯ Horner's method. ♯ converting from one base to another. ♯ binary addition. |
► | Representing
signed whole numbers:
♯ sign-magnitude, 1's complement, 2's complement, biased/excess. ♯ adding 2's complement numbers and overflow detection. ♯ shortening and lengthening of 2's complement representation. - zero-extending vs sign-extending. |
► | Representing
floating-point numbers:
♯ positional system for unsigned floating-point numbers. ♯ IEEE-754 standard for signed floating-point numbers. ♯ encoding/decoding decimal numbers based on IEEE-754 standard. |
► | Representing
characters:
♯ ASCII code. ♯ Unicode. |
|
● | Bit manipulation operations. | S5.2, S5.3
LN005a |
► | Bit shifting. |
► | Bitwise NOT, AND, OR and XOR (and NOR in lieu of NOT for MIPS). |
► | Example applications: multiplication/division (by 2x), multiple (of 2x) detection, masking. |
|
● | Fundamentals of machine organization -> with MIPS slant. | C1
LN006, LN007 |
|
► | Aspects of key components at various levels. |
► | Aspects of
memory hierarchy, including:
♯ registers. ♯ cache memory. ♯ main memory (RAM). ♯ secondary memory. |
► | Aspects of
microarchitecture, including:
♯ datapath. ♯ control. |
► | Aspects of
instruction set architecture (ISA),
including:
♯ programmer accessible registers. ♯ instruction and instruction set. ♯ addressing mode. |
► | Other aspects ->
mostly those needed
in later discussions:
♯ 0-operand, 1-operand, 2-operand, 3-operand processors. ♯ load-store architecture. ♯ RISC vs CISC. ♯ historical perspective on technological advances. ♯ fetch-decode-execute cycle. ♯ pipelining. ♯ memory-related matters: - programmers' view -> virtual vs physical. - addressability. - operations -> read and write. - alignment. - byte ordering -> little-endian vs big-endian. ♯ von Neumann (Princeton) vs Harvard architectures. |
|
● | MIPS32 ISA -> helpful views for assembly language programmers. | C1, S2.3, S7.7
LN008 |
|
► | Organizational
overview:
♯ memory (RAM). ♯ registers. ♯ coprocessors. |
► | Conventional
memory model -> memory
partitions:
♯ text segment. ♯ data segment. ♯ stack segment. ♯ reserved. |
► | CPU registers:
♯ names. ♯ usage convention. |
► | Instruction
design -> width and formats:
♯ fixed-width (32-bit). ♯ R-format. ♯ I-format. ♯ J-format. |
|
● | MIPS32 assembly language programming -> getting started. | S1.10, S1.11
S2.2, S2.10, S2.11 S5.4, Appendix A LN009 |
|
► | Language/program
elements:
♯ statements -> instructions, pseudoinstructions, directives. ♯ comments. ♯ system services. ♯ program templates. |
► | Programming environment -> MIPS emulator (MARS). |
► | Introductory
example programs:
♯ sequence flow of control. ♯ use of system services. ♯ algorithm development -> universal and essential problem-solving step. |
|
● | MIPS32 assembly language programming -> doing the basics. | S2.4 thru S2.8
S5.2, S5.3 Appendix A, C and D LN010, LN011 |
|
► | Rundown of
different types of instructions:
♯ load and store instructions. ♯ data movement instructions. ♯ constant-manipulating instructions. ♯ arithmetic instructions. ♯ logical instructions. ♯ comparison instructions. ♯ branch instructions. ♯ jump instructions. ♯ other instructions. |
► | Basic
programming constructs:
♯ performing arithmetic and bitwise operations. ♯ accessing main memory. ♯ making decisions. ♯ doing loops. |
► | Some tips, tricks, traps and observations. |
|
● | MIPS32 assembly language -> instruction encoding/decoding. | S1.10, S2.9
Appendix C and D LN012, LN013 |
|
► | Instruction
layout:
♯ operation codes. ♯ operands. |
► | Addressing
modes:
♯ immediate addressing. ♯ register addressing. ♯ base addressing. ♯ PC-relative addressing. ♯ pseudodirect addressing. |
► | How memory
addresses are formed:
♯ load/store memory address. ♯ branch destination address. ♯ jump destination address. |
|
● | MIPS32 assembly language programming -> doing functions. | S2.4, C6, C7
LN015, LN016 |
|
► | Data segment (global) vs stack segment (local) variables. |
► | Invocation flow of control. |
► | MIPS function-call mechanism and instruction support. |
► | Passing-by-value vs passing-by-reference. |
► | Simple functions -> no stack-segment memory (stack frames) needed. |
► | Complex
functions -> stack-segment
memory (stack frames) needed:
♯ a function-call convention similar to that used by GNU C-compiler. |
|
● | Exploiting instruction-level parallelism (ILP) to improve performance. | C10
LN017 |
|
► | Pipelining basics. |
► | A pipelined
implementation of MIPS and programmer-visible
hazards:
♯ delayed-load data hazard. ♯ delayed-branch control hazard. |
► | Principles of select further techniques: ♯ superpipelining. ♯ superscalar. ♯ VLIW (Very Long Instruction Word). |
|
● | The "source code->object code->executable code" paradigm. | LN018 |
|
► | A translation hierarchy for C -> compiling, assembling, linking, loading. |
► | Functional overview of compiler. |
► | Functional overview of assembler and more in-depth study of some aspects. |
► | Functional overview of linker and more in-depth study of some aspects. |
► | Functional overview of loader. |
► | Exploratory example -> how (a version of) GCC does it for C. |
|
● | MIPS32 assembly language programming -> input/output (I/O) considerations. | C8, C9
LN019, LN020 |
|
► | Memory-mapped I/O. |
► | I/O via polling. |
► | I/O via interrupts -> Coprocessor 0 and exception handling. |
|
● | MIPS32 assembly language programming -> others (time permitting). | C11
LN021 |
|
► | Floating-point instructions -> Coprocessor 1. |
|
■ | Attendance and Quizzes: |
● | Attendance is required. A short in-class quiz (administered via TxState Canvas) is slotted
for the ending 5 minutes of each normal, non-exam class meeting. Your
quiz-participation record (on Canvas) will be key reference when
addressing attendance/participation-related matters. |
► | As incentive to discourage absentism, attendance will contribute up to 5% toward the overall grade (see also under Grading
Criteria). |
| (1) | Any requests for excused absences (for acceptable reasons with supporting documentation) must be received before Canvas quiz scores are finalized/recorded for the day. |
| (2) | An unexcused absence will be assigned a quiz score of 0 and affect overall attendance. An excused absence will not receive a quiz score and will not affect overall attendance. |
| (3) | To avoid having to deal with unexcused cases,
especially the borderline ones, each student is allowed an up to 5%
non-attendance cushion. |
► | Missing the first class meeting is especially bad since pivotal "must-knows" (class website, class calendar, how class is administered, grading criteria, success tips, . . .) are made known and "missing class(es) is the bane of successful course completion" is underscored. |
|
■ | Assignments: |
● | Required written/programming assignments in 4 main areas (typically). |
► | 1 | Information representation. |
► | 2 | MIPS32 assembly language programming: getting started. |
► | 3 | MIPS32 assembly language programming: doing the basics. |
► | 4 | MIPS32 assembly language programming: doing functions. |
NOTE1: | Item(s) listed against each assignment -> key concept(s) for the exercise. |
NOTE2: | Later assignments typically require use of earlier concepts (which are not listed). |
NOTE3: | The number of assignments is not necessarily 4, as an assignment may involve multiple areas. |
● | A less than 50% average score for required assignments will result in a penalty of "loss of one letter grade" (e.g., if your overall score is in the B range, you will get a C instead). |
● | (Repeated for emphasis) Assignments will be managed using TxState Canvas: |
► | Task descriptions, deliverables, due dates and times, . . . (Typically via externally linked pages.) |
► | Submission of deliverables. (Typically source files in as-is text format and print-to-PDF format.) |
► | Return of graded work. (Typically submitted source files in print-to-PDF format that have been marked.) |
You are responsible for the successful and timely uploading of the proper files when submitting assignments. |
► | (In fairness to all, negative consequences of any failures to do so will be incontestably applied.) |
● | In general, late work will not be accepted (and will earn no credit). |
► | I reserve the right to make due-date/due-time extensions or relaxations where appropriate. |
|
■ | Exams: |
● | 3 required exams: |
► | Exam 1 (1hr 20min) |
► | Exam 2 (1hr 20min) |
► | Final (2hr 30min) | - | comprehensive (cumulative) but tend to emphasize on areas that have not been tested. |
● | All exams will regularly happen physically in-class (face-to-face). |
► | If (for factors like extenuating circumstances) exams must irregularly and virtually/remotely be administered, they will be on-line via TxState Canvas. |
| Such exams are subject to additional constraints with the following being key ones: |
| ♯ | Students are to also meet virtually (via Zoom Video Communication) and have video on to enable some modicum of proctoring. |
| ♯ | Questions will be presented one at a time (students cannot see the entire exam at once). |
| ♯ | Students are not allowed to go back to previous questions already answered. |
|
■ | Grading Criteria: |
● | Exams: 70% (20% Exam 1, 20% Exam 2, 30% Final). |
● | Assignments: 25%. |
● | Quizzes: 5%. |
|
■ | Withdrawal Policy: |
● | Registrar's Office guidance: https://www.registrar.txstate.edu/resources/dropping-vs-withdrawing.html. |
● | After the automatic W period, you are expected to check with me prior to dropping the class to see if you will receive a grade of W or F. |
|
■ | Make-Up Exams: |
● | Make-up exams will only be given under unexpected and truly severe situations, which must be supported by some official document. |
|
■ | Academic Honesty: |
● | Unless indicated otherwise, all work submitted in the class is expected to be your individual work. Violations will be dealt with according to university policies - see Student Handbook pages 46-47 or look under here. |
● | ******************** *** Important Note *** ******************** |
Any attempts at obtaining
homework, project, or exam solutions from “note sharing sites” such as
Chegg and CourseHero or from other sources are considered cheating and
carry the same penalty. The department regularly monitors websites for
posted solutions. |
|
■ | Course Related Material: |
● | Students can access these via the course site on TxState Canvas. Students are responsible for keeping abreast of the latest postings. |
► | Where expedient and appropriate, I will do my best to alert students (such as during class meetings or through mass emails) of upcoming, freshly added or updated postings. |
● | ******************** *** Copyright Note *** ******************** |
Unless otherwise noted,
the materials provided in conjunction with this course, including but
not limited to the lecture notes, handouts, homeworks, exams, and
source code, are protected by copyright and for the exclusive use of
the students enrolled in the course. Allowing others to access any of
this material by posting it on public repositories such as git or
submitting it to “note sharing sites” such as Chegg and CourseHero
(which encourage you to break the law and post copyrighted content you
do not own) is expressly forbidden. Note that you are not allowed to
publicly post any of this material even if you made modifications. This
copyright protection extends past the end of the semester. |
|
■ | Guidelines, Success Tips, and Other Pertinent Issues: |
● | These will be mentioned in class and/or posted on the course site. Students are responsible for noting these while attending class (one reason why class attendance is important) and by visiting the course site often. I typically spend some time on the first day of class highlighting these. |
|
■ | Collective (Mass), Outside-of-Meeting, Instructor-to-Students Communication: |
● | Electronically via students' Texas State email accounts (using a mailing list created from students' Texas State NetIDs). |
|
■ | Special Needs: |
● | Students with special needs (as documented by the Office of Disability Services) should have the instructor informed at the beginning of the semester/session. |