CompSci 240, C and Assembly Programming

Index: Announcements, Notes, Software Links

Announcements

to Newest entry.

Posting Date Item
(start of semester) Welcome to CompSci 240, C and Assembly Programming.
This page will contain announcements and updates that occur throughout the semester.

Scroll down or check the links above left for specific course materials. Check "Class Notes, below" for online versions of material covered in class.

2020-07-31

Raspberry Pi requirements

  • Parts list .pdf file.
  • rpi64 Operating System image — the 64-bit operating system for use in CompSci 240. 2.3 Gigabyte .zip-file download.
  • lab-network.py. Script for enabling the BFH103 lab computers to use another Ethernet port.

    Download this script on the lab computer, and run it with python lab-network.py. Then connect your Raspberry Pi and wait for it to assign an IP address to the host computer.

2020-08-28

Course videos

C/Assembly videos channel at "mediasite". Not all class sessons are available, but the ones that are should be in this channel.
2020-09-22

.ppm-reader program

2018-11-15

Notes for Assignment 6

Class Notes

Date Item
2020-08-18

Connecting to Raspberry Pi in the lab

This script sets up a Hardware Lab computer to connect to a Raspberry Pi:

Download this script on the host computer, and run it with python lab-network.py. Then connect your Raspberry Pi and wait for it to assign an IP address to the host computer.

2020-08-25

Copying a file to/from the Raspberry Pi

  • Using "pscp", demonstration of using the "pscp" program on Windows 10 to transfer files to/from a Raspberry Pi.
  • Using "pscp", demonstration of using the "pscp" program on Windows 10 to transfer files to/from a Raspberry Pi.
2020-09-02

Linux information

Code examples from class:

(Versions from section 2)
2020-09-10

Code examples from class

2020-09-10 Code Examples
bmi.c
numVowels with side effects
trigplotter
2020-09-16

Horizontal drawplot()

2020-09-16.drawplot — trigplotter's horizontal drawplot()

2020-09-24

Struct objects

Code from class:

2019-08-29

Related reading:

2019-09-12

A related reading: http://arstechnica.com/security/2015/08/how-security-flaws-work-the-buffer-overflow/
Interesting and informative article about an important kind of programming error, from the Ars Technica website

2019-09-17
2019-09-19
2019-09-24
  • functions slides
  • sincos program variations, from class. Use of "argv", "scanf()", and "fgets()" all shown in main().
2019-09-27
2019-10-03
2019-10-10
2019-10-10
2019-10-15
2019-10-17
  • wordlist program, done using multiple files.
  • output from the "short-paragraph-3.txt" input file.
  • output from the "Enterprise.txt" input file.
  • output from the "The_Elements.txt" input file.
  • output from the "Homer-Iliad.txt" input file.
2019-10-22
  • randtree.c Simple binary tree program (section 2 version)
2019-10-24
2019-10-29 decimal-to-binary routines
2019-10-31
2019-11-05
2019-11-12
2019-11-12
2019-11-19
2019-11-21
2019-11-23 Solution for binary-tree assignment:
2019-12-03 Solution for binary-tree assignment:
2019-12-05 "minimum" C-and-assembly program:
2019-12-10 "minimum" C-and-assembly program:

Resources

References

C programming

"conversion specifiers" in the printf() statement.
The format-specificaton argument to printf().
C operators and precedence — see also K&R.
Python operators and precedence.
Python Operator basics
Pascal operators and precedence.
C/C++ standard basic operators, Python operators, and Pascal operators, for comparison. (additionally, Python operators and some standard methods.)
Errata for The C Programming Language, Second Edition
Listing of "all known errors" in the K&R book.
Wikipedia's C Standard Library:
ctype.h, math.h, stdio.h, stdlib.h, string.h, time.h, etc.
Descriptions of the contents of some of the C standard libraries.
Duff's Device from Usenet://net.lang.c (archived on Google Groups).
An "unusual" programming technique; an early example of the ways in which legal — but perverse — C can do things that were thought to be exclusive to assembly language.

ASCII, EBCDIC

7-bit ASCII table
7-bit ASCII table, showing decimal and hexadecimal values.
ASCII and EBCDIC tables
8-bit character encodings: "Extended ASCII", EBCDIC.

Floating-Point & IEEE-754

IEEE-754 floating-point specification.
Summary of the IEEE-754 standard for floating-point formats.
An Interview with the Old Man of Floating-Point
An interview with one of the major forces behind IEEE-754. Includes a historical perspective.

Assembly, mixed C-and-assembly

ARMv8 architecture, Cortex-A53 processor, Raspberry Pi
Raspberry Pi — ARMv8
Reference Manuals for the Cortex-A53 processor used in the Raspberry Pi Model 3B+. (Local copies.)
Arm® Cortex®-A53 MPCore Processor Technical Reference Manual
ARM® Cortex®-A53 MPCore Processor Advanced SIMD and Floating-point Extension Technical Reference Manual
Technical Reference Manuals for the Cortex-A53 processor used in the Raspberry Pi Model 3B+. (arm.com website.)
ARM assembler
32-bit Assembler articles.
64-bit Linux syscalls — local listing
Low-level operations provided by 64-bit Linux syscall.
32-bit Linux syscalls
32-bit Linux system calls quick reference — .pdf file
Low-level operations provided by Linux interrupt 0x80.
x86 and x86_64 architecture (Intel/AMD processors)
Intel® 64 and IA-32 Architectures Software Developer's Manuals
Links to a set of free documents from Intel (in .pdf format), describing the IA-32 and IA-64 architectures and instruction sets in detail. (Volume 1 also includes a brief history of the x86 architecture family.) (Links are valid as of November 2007.)

Miscellaneous

miscellaneous information relating to LowLevel Programming.
Unorganized stuff…

Software

Operating System image

rpi64 Operating System image
64-bit OS for Raspberry Pi 4B, 3B+, and 3B.

Customized for headless operation; C/Assembly software installed. 2.3 Gigabyte .zip-file download.

for Windows users

Install these programs on your computer as needed. The first, "Raspberry Pi Imager", will be used once to copy the OS image onto your microSD card.

The "Xming" software is an X Window server.

"PuTTY" is an remote-connection tool that opens an SSH session to a host such as the Raspberry Pi. Once you are logged in, you can start a GUI program (such as an editor) that will connect to Xming to display the window.

for MacOS and Linux users

Needed software is standard on these operating systems.
  1. Insert microSD card into USB adapter; plug USB adapter into computer.
  2. Determine what device the card appears as: for example, "/dev/sdc".

    One way to do this is with the "dmesg" command. It will show you the most recent hardware activity; you should see that the card was recognized as "dev/sd???".

  3. If the card was automounted by the computer, unmount it again (but leave it plugged in).
  4. Run this command: sudo dd bs=4M status=progress if=devuanpi.2018-08-25.img of=/dev/sdc Change the image file name and output device as needed.
  5. When that's done, run the command: sync
  6. Remove the card and use it.

There is also a Raspberry Pi Imager utility that can do the "burning". See the information under "for Windows users", above.

compile-load
compiling eldritch runes

pointers

Software tools

Quotes about C and assembly language.