Differenses of two square

Page 1

hamzamac@live.com http://issuu.com/hamzamac

College Of Informatics and Virtual Education

NAME: Makame, Makame H PROGRAM: B Sc. Computer and Information Security COURSE NAME: Computer Architecture and Organization COURSE CODE: CN 200 PART: Machine Architecture that is Really Intuitive and Easy (MARIE)

Problem Descriptions: This program calculates the difference between the squares of two numbers

Requirements, Constraints and Functioning:    

A user should be allowed to enter two numbers from a keyboard, The program squares each number then subtracts the second number from the first, The user should not provide a number less or equal to 0 as the program will loop to infinity, The above mentioned shortcoming of this program is left as an exercise for the reader.

Thursday, March 01, 2012


hamzamac@live.com http://issuu.com/hamzamac

PROGRAM MAP ----------------Symbol | Location -------+--------a | 020 a2 | 025 b | 021 b2 | 026 c | 022 c2 | 027 d | 023 d2 | 028 one | 024 one2 | 029 repeat | 006 repet | 014 Assembly listing for: exm16.mas Assembled: Sun Apr 24 21:32:42 EAT 2011 000 001 002 003 004 005 006 007 008 009 00A 00B 00C 00D

1020 5000 2020 1021 3020 2021 1022 3020 2022 1021 4024 2021 8400 9006

00E 00F 010 011 012 013 014 015 016 017 018 019 01A 01B

1025 5000 2025 1026 3025 2026 1027 3025 2027 1026 4029 2026 8400 9014

01C 01D 01E 01F

1022 4027 6000 7000

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

LOAD a INPUT STORE a LOAD b ADD a STORE b repeat LOAD c ADD a STORE c LOAD b SUBT one STORE b SKIPCOND 400 JUMP repeat

repet

LOAD a2 INPUT STORE a2 LOAD b2 ADD a2 STORE b2 LOAD c2 ADD a2 STORE c2 LOAD b2 SUBT one2 STORE b2 SKIPCOND 400 JUMP repet LOAD c SUBT c2 OUTPUT HALT

Thursday, March 01, 2012


hamzamac@live.com http://issuu.com/hamzamac

020 021 022 023 024

0000 0000 0000 0000 0001

025 026 027 028 029

0000 0000 0000 0000 0001

| | | | | | | | | | |

a b c d one

DEC DEC DEC DEC DEC

0 0 0 0 1

a2 b2 c2 d2 one2

DEC DEC DEC DEC DEC

0 0 0 0 1

Assembly successful.

SYMBOL TABLE -------------------------------------------------Symbol | Defined | References --------+---------+------------------------------a | 020 | 000, 002, 004, 007 a2 | 025 | 00E, 010, 012, 015 b | 021 | 003, 005, 009, 00B b2 | 026 | 011, 013, 017, 019 c | 022 | 006, 008, 01C c2 | 027 | 014, 016, 01D d | 023 | d2 | 028 | one | 024 | 00A one2 | 029 | 018 repeat | 006 | 00D repet | 014 | 01B -------------------------------------------------_

Thursday, March 01, 2012


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.