ICS 312 TA Homepage Fall 2009

General Information

TA:Jade Cheng  成玉  (yucheng@hawaii.edu)
Instructor:David Pager (pager@hawaii.edu)
Course:Machine-Level and Systems Programming
TA Office:POST Building Room 303-3 (cubicle 3)
TA Hours:Tuesday 11:00 to 12:00
Thursday 11:00 to 12:00

Course Requirements

TBD

Homework Assignments

If you do not complete homework assignments sufficently, you would automatically fail the course. Otherwise, homework does not affect your grades. Homework submissions will be recorded and posted on this site using the student codes provided by the TA.

Please submit your homework assignments by 11:59 pm on the posted due date. Homework received on time will receive 10 points. One point will be deducted for late submissions. After one week homework will not be accepted.

To facilitate the grading process, please try to follow the following guidelines when submitting assignments.

  1. Email submissions

    Assignments should be submitted via email using your UH UNIX email account. The TA will not accept any other form of submissions.

  2. “To” field of email

    Assignments should be submitted to yucheng@hawaii.edu. Please do not send the assignments to the professor.

  3. “Cc” field of e-mail

    Please cc the email to youself. That way, if the TA doesn’t get your email for some reason, you have proof that it was sent.

  4. Subject of email

    Please use the following pattern for the subject of your email.

    [312] homework number

    For example: [312] homework 1

  5. Body of email

    Please copy and paste the contents of the homework in the email body. That way, the TA will receive your work even if the attachment is rejected.

  6. Attachments

    Plain text files are preferred. PDF, JPG, and PNG files are also accepted. Please do not send Microsoft Office documents.

  7. Multiple submissions

    You may submit an assignment more than one time. Only the most recent assignment submitted will be evaluated.

Grades

The grades for homework assignments, programming projects, in-class quizzes, and the exams will be posted using the student codes provided by the TA. If you lose or forget your code, please contact the TA.

Click your student ID to view your grades.

Homework and Quiz Solutions

The solutions of some of the homework assignments and the in-class quizzes will be posted in this section. Since late submmisions are allowed, the solutions will not be available until a couple of weeks after the due date.

hw-11-2-code.asm

;; program5-2 -- This program calls a subroutine to return the larger digit of
;; two.  The subroutine employ a call by reference with the main routine fixing
;; up the stack.

        .model small
        .stack 100

        .data
X       dw          0                   ; define a memory spot for X.
Y       dw          0                   ; define a memory spot for Y.
prompt1 db          0dh, 0ah, 'Please enter a digit: $'
prompt2 db          0dh, 0ah, 'The larger of the two digits is: $'

        .code
main2   proc
        mov         ax, @data
        mov         ds, ax

        lea         dx, prompt1             ; prompt the first user input num.
        mov         ah, 9h
        int         21h
        mov         ah, 1h
        int         21h
        cwd
        mov         X, ax                   ; store the input in X.
        mov         bx, offset X
        push        bx                      ; push the address of X onto stack.
        lea         dx, prompt1             ; prompt the second user input num.
        mov         ah, 9h
        int         21h
        mov         ah, 1h
        int         21h
        cwd
        mov         Y, ax                   ; store the input in Y.
        mov         bx, offset Y
        push        bx                      ; push the address of Y onto stack.
        lea         dx, prompt2             ; print out result message.
        mov         ah, 9h
        int         21h
        call        choose2                 ; call subroutine.
        add         sp, 4                   ; fix up the stack.
        mov         dl, al                  ; print out al, which contains the
        mov         ah, 2h                  ; return value.
        int         21h

        mov         al, 0                   ; return code of 0
        mov         ah, 4ch                 ; function code for exit to os
        int         21h
main2   endp

choose2 proc
        push        bp                      ; save bp.
        mov         bp, sp                  ; let bp points to the stack top.
        push        bx                      ; save bx.
        mov         bx, [bp+6]              ; move the address of X to bx.
        mov         ax, [bx]                ; move X to ax.
        mov         bx, [bp+4]              ; move the address of Y to bx.
        cmp         ax, [bx]                ; compare X and Y.
        jg          done
        mov         ax, [bx]                ; ax stores the larger digit.
done:
        pop         bx                      ; restore bx.
        pop         bp                      ; restore bp.
        ret                                 ; pop IP
choose2 endp
end     main2

Links

Valid HTML 4.01 Valid CSS