10. Programming

  • Feel free to use your laptop

  • You are strongly encourage to work with others

    • When you get stuck, ask those sitting around you for help

    • Get used to working together in the labs

    • Peer teaching and peer learning has been empirically shown to be very effective

For these questions, use the ESAP design with conditional jumps from here.

Further, use the assembler from here.

10.1. Counting Up and Down

  1. Write an assembly program to count from 0 to 255, then from 255 to 0, on repeat

    • \(0, 1, 2, ..., 253, 254, 255, 254, 253, ..., 2, 1, 0, 1, 2, ...\)

    • Be sure to write the program in assembly, then assemble it with the assembler

    • Run the program on the system to ensure correctness

10.2. Multiplication

  1. Write a program to perform multiplication

    • To simplify the problem, assume the value will be multiplied by at least 1

      • For example, \(15 \times x\), where \(x \ge 1\)

    • Be sure to write the program in assembly, then assemble it with the assembler

    • Run the program on the system to ensure correctness

10.3. Other Programs

  1. Try to create various interesting programs for the ESAP system