8086 micro processor programs-1

18
8086 PROGRAMMING: 1 Dr vinita Kumari

Upload: sayyed-amir-hussain

Post on 23-Jan-2018

150 views

Category:

Education


5 download

TRANSCRIPT

Page 1: 8086 micro processor programs-1

8086 PROGRAMMING: 1Dr vinita Kumari

Page 2: 8086 micro processor programs-1

7-4

Overview of Assembly Language

Advantages:

Disadvantages:

Faster as compared to programs written using high-level languages

Efficient memory usage

Control down to bit level

Need to know detail hardware implementation

Not portable

Slow to development and difficult to debug

Basic components in assembly Language:

Instruction, Directive, Label, and Comment

Page 3: 8086 micro processor programs-1

DATA TYPE

Constant

Variable- byte, word, double word

Page 4: 8086 micro processor programs-1

DIRECTIVES

SEGMENT and ENDS directive (logical segment)

END directive

ASSUME directive

Page 5: 8086 micro processor programs-1

DIRECTIVES FOR NAMING DATA AND

ADDRESSES

DB

DW

DD

EQU

Page 6: 8086 micro processor programs-1
Page 7: 8086 micro processor programs-1
Page 8: 8086 micro processor programs-1
Page 9: 8086 micro processor programs-1

EQU directive is used for defining constant

Page 10: 8086 micro processor programs-1

ASSEMBLER DIRECTIVES(CONTD.)

• EQU Directive: used to assign names to constants.

• CORRECTION_FACTOR EQU 07H

• DB, DW and DD Directives: used to assign names to variables.

• OVEN_TEMPERATURE DB 27H

• TARE_WEIGHT DB?

• CONVERSION_FACTORS DB 27H, 48H, 32H, 69H

• MULTIPLICAND DW 204AH

• PRODUCT DW 2 DUP (0)

Page 11: 8086 micro processor programs-1
Page 12: 8086 micro processor programs-1
Page 13: 8086 micro processor programs-1

• SEGMENT and ENDS Directive:

• The SEGMENT and ENDS directives are used to identify a group of data items or group of instructions that you want to be put together in a particular segment.

DATA_HERE SEGMENT

-----------

----------

DATA_HERE ENDS

Page 14: 8086 micro processor programs-1
Page 15: 8086 micro processor programs-1
Page 16: 8086 micro processor programs-1

• The ASSUME Directive

• 4 physical segments: code, data, stack and extra segment

• tells which logical segment to use for each of the physical segment at a given time.

• ASSUME CS: CODE_HERE, DS: DATA_HERE

Page 17: 8086 micro processor programs-1

• The END Directive

• Tells the assembler to stop reading

• instruction or statements that are written after END will be ignored.

LABEL

Used to give the name to the current value in the location counter.

The LABEL directive must be followed by a term which specifies the type you want associated with that name.

Page 18: 8086 micro processor programs-1