SOEN228_11w4_week_6RTL_intro_to_assy

SOEN228_11w4_week_6RTL_intro_to_assy - SOEN 228 Week6-2...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon
SOEN 228 Week6-2
Background image of page 1

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

View Full DocumentRight Arrow Icon
Intel Architectures 8088 architecture 16 bit, 1 M addressing with segments AH AL BH BL CH CL DH DL DI SI SP BP DS ES CS SS AX BX CX DX DATA SEGMENT EXTRA SEGMENT CODE SEGMENT STACK SEGMENT Destination Index Source index Stack pointer Base pointer FLAGS IP
Background image of page 2
Intel Architectures x86 architectures, 32 bit AH AL BH BL CH CL DH DL DI SI SP BP DS ES CS SS AX BX CX DX DATA SEGMENT EXTRA SEGMENT CODE SEGMENT STACK SEGMENT Destination Source index Stack pointer Base pointer EFLAGS EIP FS GS
Background image of page 3

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

View Full DocumentRight Arrow Icon
CPU model Very simplified x86 MAR MDR IP IR DH DL CH CL Instruction decoder System clock REGISTERS(16 bit) Address bus BH BL AH AL FLAGS AX BX CX DX Address logic
Background image of page 4
Flags Flag register: Condition codes Condition codes record details of the results of an operation C P Z S T I D O C: carry P: parity Z: zero S: sign T: trap I: interrupt D: direction O: overflow
Background image of page 5

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

View Full DocumentRight Arrow Icon
Condition codes Results of an operation: examples An add results in a zero: z is set to 1 A subtract results in a negative number: s is set to 1 The zero flag is set when the result of an operation is zero Overflow is set when the result is too large to fit in the operand it originally occupied
Background image of page 6
Some instructions MOV destination, source mov ax, bx ADD destination, source add ax, bx CMP destination, source cmp ax, cx DEC destination dec cx INC destination inc ax JMP LABEL jmp next LOOP LABEL loop top SUB destination, source sub ax, bx
Background image of page 7

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

View Full DocumentRight Arrow Icon
Definitions Destination: where the result is stored. It may be a register or a memory address It may be 8 bits or 16 bits in our simplified machine Source: the other operand It may be a register or a memory address as above LABEL: a name given to a line of code, which is interpreted as the address of that line
Background image of page 8
Instruction details MOV Operates register to register Or memory to register Or register to memory NOT memory to memory The register size determines the operand size MOV AX, VAL1 ; AX VAL1
Background image of page 9

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

View Full DocumentRight Arrow Icon
Instruction details ADD (same address restrictions as MOV) Result in destination, flags (z,s,o) SUB (ditto) CMP( same address restrictions as MOV) Result in flags(z,s) DEC (one address only, result in destination, flags(z,s)) INC (as above) JMP LABEL: go to address “label” LOOP LABEL: decrement CX, test it for zero, go to address “label” until CX = 0 (CX is treated as an unsigned counter)
Background image of page 10
Register Transfer Language (RTL) MOV AX, VAL1 MAR IR:ADDR MDR VAL1 AX MDR MOV AX, BX AX BX MOV VAL2, DX MAR IR:ADDR MDR DX VAL2 MDR
Background image of page 11

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

View Full DocumentRight Arrow Icon
MORE RTL ADD AX, DX AX AX + DX FLAGS values of z,s,o produced by ALU SUB AX, DX AX AX - DX FLAGS values of z,s,o produced by ALU
Background image of page 12
More precise RTL ADD AX, DX ALU AX ,ALU DX, AX ALU(add) FLAGS ALU (z or s or o) SUB AX, DX ALU AX ,ALU DX, AX ALU(add) FLAGS ALU (z or s or o)
Background image of page 13

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

View Full DocumentRight Arrow Icon
ALU operations ALU AX DX Registers immediately available to the ALU - example: ADD AX, DX result clock Set up Transfer edge FLAGS
Background image of page 14
Architecture
Background image of page 15

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

View Full DocumentRight Arrow Icon
Image of page 16
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 48

SOEN228_11w4_week_6RTL_intro_to_assy - SOEN 228 Week6-2...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online