Asee peer logo

Synergies Of Teaching Assembly And C In A Junior Microprocessors Course

Download Paper |

Conference

2009 Annual Conference & Exposition

Location

Austin, Texas

Publication Date

June 14, 2009

Start Date

June 14, 2009

End Date

June 17, 2009

ISSN

2153-5965

Conference Session

Programming for Engineering Students I

Tagged Division

Computers in Education

Page Count

15

Page Numbers

14.1112.1 - 14.1112.15

DOI

10.18260/1-2--5757

Permanent URL

https://peer.asee.org/5757

Download Count

87

Request a correction

Paper Authors

author page

Arlen Planting Boise State University

author page

Sin Ming Loo Boise State University

Download Paper |

Abstract
NOTE: The first page of text has been automatically extracted and included below in lieu of an abstract

Synergies of Teaching Assembly and C in a Junior Microprocessors Course Abstract

As part of an effort to update its core computer engineering courses, Boise State University has developed course material to effectively transition students in a Microprocessors course through both the assembly and C languages. It was found that teaching both languages in the same course provides benefits not found in teaching them separately. The material has been developed to promote both a thorough understanding of microprocessors, and greater productivity that allows students to do more intriguing and relevant projects. The course presents just enough C, at a very low level and in a specific topic order, to enable the students to better comprehend microprocessors and how they can control a broad range of devices. The updated Microprocessors course is currently in its fourth iteration.

Introduction

The C programming language is increasingly being utilized in development of embedded systems and ultra-small microcontrollers that were previously the domain of assembly language- only programming. Teaching assembly only in a Microprocessors course does not provide students the skills they are likely to need in the workplace [1], and the time required to produce code for each new device in assembly results in the course becoming more software-oriented rather than focusing on the hardware and devices. However, using the C language only is not considered practical for teaching microprocessors since assembly is the language of the processor and thus is necessary for understanding how the microprocessor works. Simply rewriting device code in C without applying software engineering principles [2] yields poor quality code that is difficult to maintain and cannot be readily targeted to other platforms. However, by selectively applying some of the object oriented principles [3] that can be found in the Linux kernel and device drivers, the C programming language can provide an effective solution for programming many of these small devices. Principles of layering, data encapsulation and abstraction can help make the code more readable, maintainable and portable.

It should be noted that the intent is not to write C code as translated assembly, which is hard to read, hard to maintain and offers little benefit over assembly code. By effectively utilizing the facilities of the C language, many assembly language routines can be reduced to very small and elegant solutions. For students lacking the insight into how to write assembly programs but are proficient at C or Java, compiling a program in C is a method of seeing how a program can be written in C. Writing code at the lowest level to access devices is generally very tedious in either language, but by providing appropriate abstractions this code can be isolated in layers to allow the higher level more freedom to solve problems with less consideration for hardware details. This also provides for easier retargeting to other platforms.

Consequently, Boise State University (BSU) decided to update its junior level Microprocessors course by incorporating the C programming language in addition to assembly. It was not practical - or necessary - to teach the entire C programming language in order to significantly enhance software skills beyond what is achieved with the assembly language alone. Following a

1

Planting, A., & Loo, S. M. (2009, June), Synergies Of Teaching Assembly And C In A Junior Microprocessors Course Paper presented at 2009 Annual Conference & Exposition, Austin, Texas. 10.18260/1-2--5757

ASEE holds the copyright on this document. It may be read by the public free of charge. Authors may archive their work on personal websites or in institutional repositories with the following citation: © 2009 American Society for Engineering Education. Other scholars may excerpt or quote from these materials with the same citation. When excerpting or quoting from Conference Proceedings, authors should, in addition to noting the ASEE copyright, list all the original authors and their institutions and name the host city of the conference. - Last updated April 1, 2015