Вы находитесь на странице: 1из 2

COMPASM - COMPUTER ASSEMBLY 1st TERM, ACADEMIC YEAR 2012-2013 MACHINE PROBLEM Objectives: 1.

To be familiar with assembly language of 8086/8088 2. To have hands-on experience in using the 8086/8088 addressing modes 3. To be familiar with some of the ALU operations of 8086/8088 4. To be familiar with execution control instructions of 8086/8088 Specifications: Write an 8086/8088 assembly language program that determines a keyword and two numbers from a string of ASCII characters. The Input The program must ask the user to input a string of characters terminated by a period. This string of characters must include two operands and a keyword which represents the operation to be performed on the two operands. The keywords are ADD, for addition operation, SUB for subtraction operation, and MUL for multiplication operation. Keywords are case sensitive and can be found anywhere in the string. In case of multiple keywords in a string, the first keyword from the left is considered the valid keyword. For example: 1) Aas gdgs SUbrrtv fgdrtgqa ADDdfw Dsf ggrw 34 ew3 fg4 5 t. 2) UIdsf MUas e aOSedv W sf Ls SesweSUB aseffc0 2 e -99 drgf. 3) fgfjgibMULStju Sdgged UslLS efnmsfov e 9 w 33 sfef 44 e skfnhg. 4) ddfge 98 sdf RTSms -101 MULsf rfx SUBsf BdMULdf 32 s sdsfADD. 5) dfer yfee -3 df 4rd dfg 4MULeeS er 4. 6) AAA aADDFd AND -9O0 adkj 10 ioo Adi EMU MUL SUBB 45. Keywords are: 1) ADD, 2) SUB, 3) MUL, 4) MUL, 5) MUL and 6) ADD The operands for this machine problem are the numbers from -99 to 99. This will set the range of possible outputs from 9999 = 9801 to -9999 = -9801. The operands can be found from the input string separated from other characters using space. In cases where there are more than two operands in the input string, use the first two operands. In the sample strings above: Operands are: 1) 34 and 5, 2) 2 and -99, 3) 9 and 33, 4) 98 and 32, 5) -3 and 4, 6) 10 and 45 Note that the negative sign for this MP is a dashed line (ASCII: 2DH) not the minus sign (ASCII: C4H) Subroutines should be used in the program. Use only data registers to transfer the parameters through and from the subroutines. The number of subroutines will depend on your design/approach. The Output After performing the corresponding operation from the string, the program must display the result of the operation (in decimal) and terminate immediately. In cases where there is no valid keyword or there are less than two valid operands in the string, the program must flag the user that he/she inputs an invalid string and ask for a string again. Assume that the string will always be terminated by a period.

Documentation: I. II. III. IV. Subroutines used and a brief description of the subroutines Flow chart of each of the subroutines used Flow chart flow chart of the main program Source code

Submission: Source Code (.ASM): Documentation: August 20, 2012 11:59 AM email: mac.cordel@yahoo.com (for S23), sensei88@yahoo.com (for S11/S12) August 22, 2012 (hardcopy Ms. Shengs table)

Your file should be named: <lastname><first letter of first name>.asm Note: Maximum of 8 letters for the filename, truncate surname if it exceeds 7 letters Rubrics: 80% is given to those who submit on time (0% if the file does not assemble or virus-infected) -10% if it does not perform ADD operation (both pos and neg) -10% if it does not perform SUB operation (both pos and neg) -10% if it does not perform MUL operation (both pos and neg) -10% if it fails to detect errors regarding keywords search -10% if it fails to detect errors regarding operands search -10% if it operates beyond the operands range, i.e. +/- 99 -5% for every hour that the source code is submitted late -5% for using wrong filename convention -5% for sending the source code in wrong email address -5% if the code is not properly documented (use comments to describe subroutines, etc) 20% documentation (hardcopy) -5% for every hour that the documentation is submitted late -5% if no flowchart for the main program (-2.5% if flowchart is present but no explanation) -5% if no flowchart for the subroutines (-2.5% if flowchart is present but no explanation) -5% if documentation is poorly written (for example: more than 5 grammatical errors, figures/tables are too small or not readable, etc).

Вам также может понравиться