1 / 5

Chapter 3

EE314 Microprocessor Systems. Chapter 3. Objectives: The style of source files written in 80x86 assembly language The different addressing modes of the 80x86 The operation and use of the processor flags Data transfer and string instructions.

Télécharger la présentation

Chapter 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EE314Microprocessor Systems Chapter 3 Objectives: The style of source files written in 80x86 assembly language The different addressing modes of the 80x86 The operation and use of the processor flags Data transfer and string instructions 80x86 Instruction, Part 1: Addressing Modes, Flags, Data Transfer, and String Instructions Based on "An Introduction to the Intel Family of Microprocessors" by James L. Antonakos

  2. 3.2 Assembly language programming Source file (TOTAL.ASM) Assembler Object files ... Object file (TOTAL.OBJ) List file (TOTAL.LST) Linker Library Final object file or executable file

  3. 3.2 Assembly language programming A Sample Source File 8000 B8 8001 00 8002 70 Begin of Data segment DATA SEGMENT PARA ‘DATA’ ORG 7000H POINTS DB 16 DUP (?) SUM DB (?) DATA ENDS CODE SEGMENT PARA ‘CODE’ ASSUME CS:CODE, DS:DATA Data name End Segment Label Begin of Code segment 1 8000 2 8000 B8 7000 3 8003 8E D8 4 8005 B0 00 5 8007 B3 10 6 8009 BE 0000 7 800C 02 04 8 800E 46 9 800F FE CB 10 8011 75 F9 11 8013 88 04 12 8015 CB 13 ORG 8000H TOTAL: MOV AX,7000H ;load address of data area; MOV DS,AX ;init data segment register MOV AL,0 ;clear result MOV BL,16 ;init loop counter MOV SI,0 ;init data pointer ADDUP: ADD AL,[SI] ;add data value to result INC SI ;increment data pointer DEC BL ;decrement loop counter JNZ ADDUP ;jump if counter not zero MOV [SI],AL ;save sum RET ;return END CODE ENDS END TOTAL Start execution address End Source file

  4. 3.2 Assembly language programming A Sample Source File .MODEL SMALL .DATA ORG 7000H POINTS DB 16 DUP (?) SUM DB (?) .CODE 1 8000 2 8000 B8 7000 3 8003 8E D8 4 8005 B0 00 5 8007 B3 10 6 8009 BE 0000 7 800C 02 04 8 800E 46 9 800F FE CB 10 8011 75 F9 11 8013 88 04 12 8015 CB 13 ORG 8000H TOTAL: MOV AX,7000H ;load address of data area; MOV DS,AX ;init data segment register MOV AL,0 ;clear result MOV BL,16 ;init loop counter MOV SI,0 ;init data pointer ADDUP: ADD AL,[SI] ;add data value to result INC SI ;increment data pointer DEC BL ;decrement loop counter JNZ ADDUP ;jump if counter not zero MOV [SI],AL ;save sum RET ;return END TOTAL

  5. 3.2 Assembly language programming Predefined .MODEL types 3.3 Instruction Types

More Related