Monday, October 4 Assignment(s) due: Assignment #5: COMPLEMENT ARITHMETIC

Embed Size (px)

DESCRIPTION

Monday, October 4 Assignment(s) due: Assignment #5: COMPLEMENT ARITHMETIC Assignment #6: DEBUG EXERCISES Quiz(zes) due:Quiz #5: Base Arithmetic Quiz #6 (Complement Arithmetic) Note: Quiz #7 (Debug) will be due next Monday Emulator Progress Worksheet 1 will be due next Monday - PowerPoint PPT Presentation

Text of Monday, October 4 Assignment(s) due: Assignment #5: COMPLEMENT ARITHMETIC

  • Monday, October 4

    Assignment(s) due: Assignment #5: COMPLEMENT ARITHMETICAssignment #6: DEBUG EXERCISES

    Quiz(zes) due:Quiz #5: Base ArithmeticQuiz #6 (Complement Arithmetic)

    Note: Quiz #7 (Debug) will be due next Monday

    Emulator Progress Worksheet 1 will be due next MondayToday is the cutoff date for all Simple Computer labs and assignments

    And next Monday is the cutoff date for all arithmetic assignments and quizzes(Assignment #5, Quiz #5, Quiz #6, Optional Quizzes #5, #7 and #8)

    Please note:The date of the midterm is Monday, October 18- an 8.5 in. * 11 in. cheat sheet will be allowed

    We will review for the midterm next week

    I recommend going over the midterm practice exercises before I discuss them on Monday

    Don't forget the optional quiz: Debug

  • Given the following information in DEBUG:

    -e 120 34 12 00 01

    -u 100, 10A21F0:0100BB2001MOVBX, 12021F0:0103BE0200MOVSI, 221F0:01060307MOVAX, [BX]21F0:01080300ADDAX, [BX + SI]

    Trace through the partial program above, showing the contents of the AX, BX and SI registers

    AXBXSI

  • Given the following information in DEBUG:

    -e 120 34 12 00 01

    -u 100, 10A21F0:0100BB2001MOVBX, 12021F0:0103BE0200MOVSI, 221F0:01060307MOVAX, [BX]21F0:01080300ADDAX, [BX + SI]

    Trace through the partial program above, showing the contents of the AX, BX and SI registers

    AXBXSIBut first:What does this mean?120 121 122 123

  • Given the following information in DEBUG:

    -e 120 34 12 00 01

    -u 100, 10A21F0:0100BB2001MOVBX, 12021F0:0103BE0200MOVSI, 221F0:01060307MOVAX, [BX]21F0:01080300ADDAX, [BX + SI]

    Trace through the partial program above, showing the contents of the AX, BX and SI registers

    AXBXSIBut first:What does this mean?120 121 122 123 34 12 00 01

  • Given the following information in DEBUG:

    -e 120 34 12 00 01

    -u 100, 10A21F0:0100BB2001MOVBX, 12021F0:0103BE0200MOVSI, 221F0:01060307MOVAX, [BX]21F0:01080300ADDAX, [BX + SI]

    Trace through the partial program above, showing the contents of the AX, BX and SI registers

    AXBXSI ?0120 ?

  • Given the following information in DEBUG:

    -e 120 34 12 00 01

    -u 100, 10A21F0:0100BB2001MOVBX, 12021F0:0103BE0200MOVSI, 221F0:01060307MOVAX, [BX]21F0:01080300ADDAX, [BX + SI]

    Trace through the partial program above, showing the contents of the AX, BX and SI registers

    AXBXSI ?0120 ? ?01200002

  • Given the following information in DEBUG:

    -e 120 34 12 00 01

    -u 100, 10A21F0:0100BB2001MOVBX, 12021F0:0103BE0200MOVSI, 221F0:01060307MOVAX, [BX]21F0:01080300ADDAX, [BX + SI]

    Trace through the partial program above, showing the contents of the AX, BX and SI registers

    AXBXSI ?0120 ? ?01200002123401200002

  • Given the following information in DEBUG:

    -e 120 34 12 00 01

    -u 100, 10A21F0:0100BB2001MOVBX, 12021F0:0103BE0200MOVSI, 221F0:01060307MOVAX, [BX]21F0:01080300ADDAX, [BX + SI]

    Trace through the partial program above, showing the contents of the AX, BX and SI registers

    AXBXSI ?0120 ? ?01200002123401200002133401200002

  • Review:MOVCX ,0003MOV AX, 0000ADDAX, CX

    LOOP106

    INT20Using the LOOP instruction (works with CX): How does the loop instruction work?

  • Review:MOVCX ,0003MOV AX, 0000ADDAX, CX

    LOOP106

    INT20Using the LOOP instruction (works with CX): How does the loop instruction work?

    1.It decrements CX

    2. It checks CX (is CX > 0?)

    3.If CX > 0- it loops to the address specified

    If CX = 0- it goes to the next instruction in sequence

  • - each location in the computer is assigned a unique address

    - memory locations- input/output devices

    - the address allows them to be recognized by the CPU

    - the CPU puts the address on the address bus - identified by the decoding circuits

    - the data bus is used to get data to or from the address

    - the control bus sends read/write signals- to indicate if the CPU is asking for or sending information

    - every process in the computer (at every level of the computer)- uses this fetch/decode/execute cycle

  • - each location in the computer is assigned a unique address

    - memory locations- input/output devices

    - the address allows them to be recognized by the CPU

    - the CPU puts the address on the address bus - identified by the decoding circuits

    - the data bus is used to get data to or from the address

    - the control bus sends read/write signals- to indicate if the CPU is asking for or sending informationCPU

    (ALU,registers,controlunit)RAMROMPrintercd/dvdMonitorKeyboardMouseAddress BusData BusControl Bus

  • - the function (or purpose) of the CPU:- to fetch and execute instructions- more efficient if the process is divided

    - at the same time:- one instruction is being executed, and- the next instruction is being fetched

    - implemented by theoretically dividing the CPU into:

    - the execution unit- decodes and executes instructionsand- the bus interface unit- fetches the instructions

  • - the execution unit contains- the ALU- performs operations- arithmetic- logical- registers- high speed memory- temporarily store data or addresses

    - general purpose registers- available to programmers- special purpose registers- e.g. the instruction pointer, the instruction register- not available to programmers- to indicate if the CPU is asking for or sending information- the flags register- is set (or reset) as the result of operations done in the ALU- can be checked by a program

    - the decoder- determines the type of instruction- interprets it into a form that can be used in the ALU and registers

  • - the bus interface unit- where instructions and data come in from main memory- the bus interface unit delivers them to the execution unit- contains:- the instruction queue- allows the bus interface unit to stay ahead of the execution unit- when the queue is full - the buses are idle- if the program performs a jump- the queue will be changed

    - the instruction pointer- holds the address of the next instruction to be executed- the address will be placed on the address bus

    - the segment registers- hold the addresses of the various parts of memory used by the program- where the instructions are stored- where the data is stored- where the programs stack is located

    - the execution unit and the bus interface unit work in parallel- but the bus interface unit is always at least one step ahead

  • Registers:

    General- EAX (accumulator) EAX - 32 bits 8 hexadecimal digits

    AX - 16 Bits 4 hexadecimal digits

    AH and AL - 8 bits each 2 hexadecimal digits each

    - EBX, ECX, EDX - and BX, BH, BL, CX, CH, CL, DX, DH, DL

  • Intel Registers (grouped by function)Data Registers(general purpose)Index Registers(used in string operations)Pointer Registers(used in stack operations)Accumulator registerBase registerCount registerData registerSource Index registerDestination Index registerStack Pointer registerBase Pointer registerEAXEBXECXEDXESIESPEBPEDI

  • Segment Registers (16-bit)(hold segment addresses)Control RegistersFlags register detail:

    - bit 0CF- bit 2PF- bit 6ZF- bit 7SF- bit 10DF- bit 11OFIntel Registers (grouped by function)Code Segment registerData Segment registerStack Segment registerExtra Segment registerEIPEFLAGSInstruction pointer registerFlags registerCSDSSSES

  • - immediate addressing

    - the operand comes immediately after the instructione.g. MOV EAX, 12345678 or MOV AX, ABCD or MOV AH, 2A

    - direct addressing

    - specifies the address of the operand e.g. MOV EAX, [0100] or MOV EAX, NUMBER

    - register addressing

    - specifies the register in which the operand is storede.g. MOV EAX, EBX32-bit Addressing Modes

  • Scientific Notation Format

    NormalizedStandard Form Scientific Notation Scientific Notation

    3.141593.14159 x 100.314159 x 101

    100,0001.0 x 105.1 x 106

    .00011.0 x 10-4.1 x 10-3

    -1234-1.234 x 103-.1234 x 104

    -1.234 3 -.1234 4

    mantissa characteristic fraction exponent (or significand)Scientific notation makes it relatively easy to work with very large or very small numbers- normalized scientific notation used in the computer is called floating point notation

  • 4-Decimal-Digit Floating Point FormatFraction2 decimal digitsNormalizedSignedExponent2 decimal digitsSigned4331111-10000-06023.14159100,000.0001-1234( .314159 * 101)( .1 * 106)( .1 * 10-3)( .1234 * 104)

  • 4-Decimal-Digit Floating Point FormatFraction2 decimal digitsNormalizedSignedExponent2 decimal digitsSigned4331111-10000-06023.14159100,000.0001-1234Range: - defined by the number of digits in the exponent (-.99 x 10+99 .. +.99 x 10+99)

    Precision: - defined by the number of digits in the fraction (2 digits of precision)

  • - if the 4-decimal digit format is changed: Fraction3 decimal digitsNormalizedSignedExponent1 decimal digitSigned- the range is smaller (-.999*109 .. 999*109)

    - there is a smaller distance between adjacent numbers- there is greater accuracy

  • - if the 4-decimal digit format is changed: Fraction1 decimal digitNormalizedSignedExponent3 decimal digitsSigned- the range is increased

    - accuracy is greatly decreased

  • - if the 4-decimal digit format is changed: Fraction1 decimal digitNormalizedSignedExponent3

Recommended

View more >