Emulator 8086 Lecture 3 What is an assembly

Published  . 0 views
↓ Download
Emulator 8086 Lecture 3 What is an assembly
1 / 1
Emulator 8086 Lecture 3 What is an assembly - slide 1 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 2 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 3 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 4 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 5 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 6 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 7 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 8 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 9 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 10 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 11 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 12 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 13 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 14 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 15 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 16 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 17 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 18 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 19 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 20 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 21 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 22 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 23 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 24 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 25 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 26 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 27 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 28 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 29 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 30 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 31 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 32 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 33 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 34 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 35 of 36 Emulator 8086 Lecture 3 What is an assembly - slide 36 of 36
Description: Emulator 8086 Lecture 3 What is an assembly language? Assembly language is a low level programming language. Inside the CPU Architecture 8086 Microprocessor 4 Execution Unit (EU) EU executes instructions that have already been fetched by

Related Topics

Download Presentation

"Emulator 8086 Lecture 3 What is an assembly" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentation Transcript

slide1. Emulator 8086 Lecture 3<br>
slide2. What is an assembly language? Assembly language is a low level programming language.<br>
slide3. Inside the CPU<br>
slide4. Architecture 8086 Microprocessor 4 Execution Unit (EU)

EU executes instructions that have already been fetched by the BIU.

BIU and EU functions separately. Bus Interface Unit (BIU)

BIU fetches instructions, reads data from memory and I/O ports, writes data to memory and I/ O ports. Four 16-bit segment registers

Code Segment (CS)
Data Segment (DS)
Stack Segment (SS)
Extra Segment (ES)<br>
slide8. Signed Numbers<br>
slide9. Emulator Calculator<br>
slide11. Inside the CPU GENERAL PURPOSE REGISTERS

8086 CPU has 8 general purpose registers, each register has its own name:
AX - the accumulator register (divided into AH / AL).
BX - the base address register (divided into BH / BL).
CX - the count register (divided into CH / CL).
DX - the data register (divided into DH / DL).
SI - source index register.
DI - destination index register.
BP - base pointer.
SP - stack pointer.<br>
slide12. Inside the CPU SEGMENT REGISTERS
CS - points at the segment containing the current program.
DS - generally points at segment where variables are defined.
ES - extra segment register, it's up to a coder to define its usage.
SS - points at the segment containing the stack.<br>
slide13. Inside the CPU SPECIAL PURPOSE REGISTERS
IP - the instruction pointer it points to currently executing instruction.
Flags Register - determines the current state of the processor.
is modified automatically by CPU after mathematical operations, this allows to determine the type of the result, and to determine conditions to transfer control to other parts of the program.

Generally you cannot access these registers directly.<br>
slide14. 14 Inside the CPU<br>
slide15. MOV instruction The MOV instruction: copies a word or byte of data from a specified source to a specified destination.

MOV Destination, Source<br>
slide16. These types of operands are supported:

MOV REG, memory
MOV memory, REG
MOV REG, REG
MOV memory, immediate
MOV REG, immediate

REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP.
memory: [BX]
immediate: 5, 3Fh, 10001101b, etc... MOV instruction<br>
slide17. For segment registers only these types of MOV are supported:

MOV SREG, memory
MOV memory, SREG
MOV REG, SREG
MOV SREG, REG

SREG: DS, ES, SS, and only as second operand: CS.
REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP.
memory: [BX] MOV instruction<br>
slide18. MOV instruction Notes:
The source and destination cannot both be memory locations.
They must both be of the same type (bytes or words).
MOV SREG, SREG
MOV SREG, immediate
MOV instruction does not affect any flag.<br>
slide19. Notes: Binary numbers must have "b" suffix, example: 00011011b
Hexadecimal numbers must have "h" suffix, and start with a zero
when first digit is a letter (A..F), example: 0ABCDh<br>
slide20. MOV instruction MOV CX, 037AH ; Put immediate number 037AH to CX
MOV CX, 03H
ret<br>
slide21. MOV instruction MOV [437AH],55h ;
MOV BL,[437AH] ; Copy byte in memory at offset 437AH to BL
; remove h only 55<br>
slide22. MOV instruction MOV BX, 5F4Fh
MOV AX, BX ; Copy content of register BX to AX<br>
slide23. MOV instruction MOV [BX], 88h
MOV DL, [BX] ; Copy byte from memory at [BX] to DL
ret<br>
slide24. MOV instruction MOV BX, 5F4Fh
MOV [BX], 88h
MOV DL, [BX]<br>
slide25. MOV instruction MOV AX, 1234h
MOV [2351h], AX ; Copy AX to two memory locations<br>
slide26. MOV instruction MOV AX, 1234h
MOV [2351h], AX ;
mov cl,[2352h] ; try without h
ret<br>
slide27. MOV instruction MOV [1234h], [2234h]
ret<br>
slide28. MOV instruction MOV Al, 1234h
MOV AH, 34h
Ret<br>
slide29. MOV instruction MOV CH, 01011111b ; set CH to binary value.
Ret ; remove b
; try only 0101 MOV CH, 0101<br>
slide30. MOV instruction MOV SI, 01011111b ; set SI to binary value.
MOV DI, 1234H
Ret<br>
slide31. MOV instruction MOV AX, 4563H
MOV BX, 56H
MOV SS,AX
MOV DS,BX<br>
slide32. MOV instruction MOV AX, 4563H
MOV BX, 56H
MOV SS,AX
MOV DS,BX
MOV AX,DS
MOV BX,SS<br>
slide33. MOV instruction MOV AX, 4563H
MOV BX, 56H
MOV [BX],AX
MOV SS,[BX]<br>
slide34. MOV instruction MOV SS, 56H
MOV DS,SS
RET<br>
slide35. MOV instruction MOV AX,67H
MOV SS, AX
MOV DS,SS
RET<br>
slide36. MOV Instructions Q: write a program in Assembly language to swap the contents of AX 5555h and BX 4242h using general register
MOV BX, 5555h
MOV AX, 4242h ;
mov dx,ax
mov ax,bx
mov bx,dx
ret<br>