PROJECT2 - Microsoft(R Macro Assembler Version 5.00...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
#Microsoft (R) Macro Assembler Version 5.00 5/10/13 11:54:42 PGM1 Page 1-1 PAGE 60,132 TITLE PGM1 ;******************************************************* ******** ;PGMI Title: Sample Program to add cost to total * ;Programmer: Ahmad Maruf * ;Purpose: Write a program to perform the following calculation:* ; RESULT=HOURS*RATE- (HOURS*RATE*TAXRATE/100) * ; * ;******************************************************* ******** ;Program code segments 0000 PGM1CD SEGMENT 0000 MAIN PROC FAR ;HOUSEKEEPING SECTION ASSUME CS:PGM1CD,DS:PGM1SK,SS:PGM1SK 0000 B8 ---- R MOV AX,PGM1DA ; ESTABLISH ADDRESSABILITY 0003 8E D8 MOV DS,AX ; TO PGM1DA - THE PGM'S DATA SEGMENT ;MAIN PROCESS SECTION 0005 A1 0000 R MOV AX,HOURS ; REG AX = HOURS 0008 8B 1E 0004 R MOV BX,RATE ; REG BX = RATE 000C F7 E3 MUL BX ; AX*BX 000E A3 0008 R MOV HXR,AX ; STORES HOURS*RATE IN MEM LOCATION 0011 8B 1E 0006 R MOV BX,TAXRATE ;BX = TAXRATE 0015 F7 E3 MUL BX ; 0017 F7 36 000A R DIV NUM ; 001B A3 0002 R MOV TOTAL,AX ; 001E 29 06 0008 R SUB HXR,AX ; 0022 A1 0008 R MOV AX,HXR ; 0025 A3 0002 R MOV TOTAL,AX ; ; RETURN TO DOS SECTION 0028 B0 00 MOV AL,0 ; SET O AS THE RETUN CODE FOR DOS 002A B4 4C MOV AH,4CH ; SET FOR DOS END PROCESS FUNCTION 002C CD 21 INT 21H ; CALL DOS TO END PROGRAM 002E MAIN ENDP 002E PGM1CD ENDS
Image of page 2
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern