HW02: Long Live the Dog! due Mon 09 Sep 23:59

Purpose

Success in this course is tied directly to your independent and successful completion of a variety of programs. In this assignment you will employ tools from various programs to revisit a simple but timeless classic! This assignment gives practice in utilizing provided I/O macros and in the protocol we will use for turning in programs.

Instructions

Write a NASM program that will allow the user to enter the name and age of their dog. Your program should display the dog's name and its age in dog years. NOTE: 1 human year is equal to 7 dog years. You should use iomacros.asm for all input and output.

Submission Requirements

This semester you will be submitting homework using a homework git repository as we did in Program Design 2. The URL for repository from which I'll be providing resources is: https://tsergeant@bitbucket.org/tsergeant/al_homework.git.

If you don't remember how to use the repository for turning in homework, follow the instructions at http://josephus.sergeantservices.com/classes/all/usinggit/. As part of the setup instructions you will establish your own (private) copy of the repository at bitbucket.org and will give terrys@gmail.com read privileges to your repository. Make sure you have the most recent files from the course repository and do your work in the provided hw02 directory.

When completed commit your work and push it to your bitbucket repository. Once you finish the assignment, feel free to “play around” with the program. Just for fun, see what other tasks you can convince your program to accomplish!

Where To Work

Assembly code commonly has some idiosyncracies that are specific to your chosen operating system. I will be grading your work on a 64-bit Linux system so it would be ideal for you to write your programs in the same environment. Unless you happen to be running 64-bit Linux on your own computer my advice is that you simply do your work on csci.hsutx.edu. If you already have experience working directly on the server then you can safely ignore the rest this section.

To work directly on csci.hsutx.edu you will need to connect to the server using an SSH client. In doing so you will establish a terminal (command-line) connection to the server and work from there. So, your working respository will be in your workspace on the server. For instructions on how to working remotely on csci.hsutx.edu read https://hsutx.instructure.com/courses/13381/pages/about-working-on-the-csci-server?module_item_id=434105.

Once you have successfully connected to the server you will find it helpful to watch these videos:

Helpful Info

To complile assembly source (creates myprog.o file): nasm -f elf64 myprog.asm

To link with C libraries to create executable (creates a.out): gcc myprog.o

To execute: ./a.out

To link but use another name besides a.out (creates myprog.exe): gcc myprog.o -o myprog.exe

Demo of using iomacros: See demos directory in homework repository For iomacros source code: See lib directory in homework repository

Assembly Language

Segmentation Fault Counter

1779736884