Preview

Computer Organization with Assembly

Satisfactory Essays
Open Document
Open Document
2591 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Computer Organization with Assembly
Computer Organization and Assembly Language
Lecture 3 – Assembly Language Fundamentals

Basic Elements of Assembly Language
An assembly language program is composed of : • Constants • Expressions • Literals • Reserved Words • Mnemonics • Identifiers • Directives • Instructions • Comments

Integer Constants
• Integer constants can be written in decimal, hexadecimal, octal or binary, by adding a radix (or number base) suffix to the end . • Radix Suffices: –d decimal (the default) –h hexadecimal – q or o octal –b binary

Examples of Integer Constants
• • • • • • • • 26 1Ah 1101b 36q 2Bh 42Q 36D 47d Decimal Hexadecimal Binary Octal Hexadecimal Octal Decimal Decimal

Integer Expressions
• An integer expressions is a mathematical expressions involving integer values and integer operators. The expressions must be one that can be stored in 32 bits (or less). The precedence:
– – – – () +, *, /, Mod +, Expressions in Parentheses Unary Plus and minus Multiply, Divide, Modulus Add, Subtract

• •

Examples of Integer Expressions
Expression
16 / 5 - (3 + 4) * (6 – 1) -3 + 4 * 6 – 1 4 + 5 * 2 -5 + 2 12 – 1 MOD 5 (4 + 2) * 6

Value
3 -35 20 1

Real Number Constants
• There are two types of real number constants: – Decimal reals, which contain a sign followed by a number with decimal fraction and an exponent:
[sign] integer.[integer][exponent]

Examples:
2. +3.0 -44.2E+05 26.E5

– Encoded reals, which are represented exactly as they are stored:
3F80000r

Characters Constants
• A character constant is a single character enclosed in single or double quotation marks. • The assembler converts it to the equivalent value in the binary code ASCII:
‘A’ “d”

String Constants
• A string constant is a string of characters enclosed in single or double quotation marks:
‘ABC’ “x” “Goodnight, Gracie” ‘4096’ “This isn’t a test” ‘Say “Goodnight, ” Gracie’

Reserved Words
• Reserved words have a special meaning to the assembler and cannot be used for

You May Also Find These Documents Helpful

  • Satisfactory Essays

    NT1210 Week 1 Labs 1

    • 3680 Words
    • 20 Pages

    Using the binary converter document, create a decimal conversion for the binary value 10000001 2.…

    • 3680 Words
    • 20 Pages
    Satisfactory Essays
  • Good Essays

    Pt1420 Unit 5 Study Guide

    • 2789 Words
    • 12 Pages

    1. Convert the number in hexadecimal into decimal by multiplying each digit of a number with 16 raise to the power of weight of digit.…

    • 2789 Words
    • 12 Pages
    Good Essays
  • Satisfactory Essays

    Lab 1 1

    • 814 Words
    • 9 Pages

    Using the example in Figure 1-5 and the steps that followed, create a binary conversion for the decimal value 156.…

    • 814 Words
    • 9 Pages
    Satisfactory Essays
  • Good Essays

    Period or dot (.) is used for the termination of statements in this language. Each statement must end by a terminator.…

    • 703 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    1) Numbers can be represented in binary (using 2 symbols 0 and 1) and hexadecimal ( 16 symbols…

    • 480 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 1

    • 1660 Words
    • 7 Pages

    Using the example in Figure 1-5 and the steps that followed, create a binary conversion for the decimal value 156.…

    • 1660 Words
    • 7 Pages
    Satisfactory Essays
  • Better Essays

    Nt1310 Unit 1 Assignment

    • 1994 Words
    • 8 Pages

    5. Convert 32 decimal to binary floating point. Use a 6 bit mantissa and a 4 bit exponent.…

    • 1994 Words
    • 8 Pages
    Better Essays
  • Powerful Essays

    Ap Calculus

    • 2722 Words
    • 11 Pages

    | The symbols +, -, *, /, %, and ^ used to denote addition, subtraction (or negation), multiplication, division, percentage, and exponentiation in an Excel formula.…

    • 2722 Words
    • 11 Pages
    Powerful Essays
  • Satisfactory Essays

    The range of values represented by an 8-bit binary number is _____. 4. The binary equivalent of 228 is _________. 5. The result of 7 – 2 using 1’s complement notation is 6.…

    • 4533 Words
    • 19 Pages
    Satisfactory Essays
  • Good Essays

    Mth 208 Week 2 Dq1

    • 253 Words
    • 2 Pages

    Integers are the natural numbers of (0, 1,2,3,4….)and the negative non zero numbers of (-1,-2,-3,-4….)and so forth. Integers are numbers without a fractional or decimal component. Example: 23, 5, and -567 are integers, 8.45, 5½, and √2 are not integers. Integers are any number that can be expressed as the ratio of two integers. All integers are rational because integers can be expressed as a ratio of itself (9= 9/1) Rational numbers (fractional numbers) are regarded as divisions of integers. All numbers that are written as non-repeating, non-terminating decimals are “irrational” Example: Sqrt(2) or PI “3.14159…” the rational and irrationals are two different number types. Real numbers include whole numbers, rational numbers, and irrational numbers. A real number can be positive or negative or zero.…

    • 253 Words
    • 2 Pages
    Good Essays
  • Good Essays

    The media, and Hollywood in particular, represent one avenue in which the general public becomes familiar with the role of nurses. How does the media positively or negatively influence the public’s image of nursing? What other avenues may better educate the general public on the role and scope of nursing as well as the changing health care system…

    • 386 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Simplifying Expressions

    • 656 Words
    • 3 Pages

    In arithmetic we use only positive numbers and zero, but with algebra, we use both positive and negative numbers. The numbers we use in algebra are called the “real numbers” or integers {… , -3, -2, -1, 0, 1, 2, 3…}. In this paper I am going to explain the properties of real numbers using three examples. I will also be explaining how to solve these examples step by step, all while discussing why these properties are so important to begin with. The properties of real numbers are the commutative, associative, identity, and additive inverse properties of addition, distributive law, and the commutative, associative, identity, and the multiplicative inverse (reciprocal) of multiplication.…

    • 656 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Formatting Code Python

    • 451 Words
    • 2 Pages

    Integers We consider the integers 12,345 and -12,345. Formatting code %d %20d %-20d %020d %+d %+20d %+-20d %+020d %3d 12,345 '12345' ' 12345' '12345 ' '00000000000000012345' '+12345' ' +12345' '+12345 ' '+0000000000000012345' '12345' -12,345 '-12345' ' -12345' '-12345 ' '-0000000000000012345' '-12345' ' -12345' '-12345 ' '-0000000000000012345' '-12345'…

    • 451 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Assembly language lecture6

    • 991 Words
    • 13 Pages

    current value of IP (IP := 0002 + 3 = 0005) => IP will point to…

    • 991 Words
    • 13 Pages
    Satisfactory Essays
  • Good Essays

    Assembly Language

    • 5117 Words
    • 21 Pages

    Assembly language is a representation of machine language. In other words, each assembly language instruction translates to a machine language instruction. The advantage of assembly language is that its instructions are readable. For example, assembly language statements like MOV and ADD are more recognizable than sequences of 0s and 1s. Though assembly language statements are readable, the statements are still low-level. Another disadvantage of assembly language is that it is not portable. In other words, assembly language programs are specific to a particular hardware. Assembly language programs for a Mac will not work on a PC. But this can be an advantage for programmers who are targeting a specific platform and need full control over the hardware.…

    • 5117 Words
    • 21 Pages
    Good Essays