Similar documents

MSC-51

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

Microcontroller Intel [Instruction Set]

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue

Digital Blocks Semiconductor IP

Instruction Set Of 8051

Q. Classify the instruction set of 8051 and list out the instructions in each type.

Digital Blocks Semiconductor IP

SN8F5000 Family Instruction Set

Programming of 8085 microprocessor and 8051 micro controller Study material

Dodatak. Skup instrukcija

Digital Blocks Semiconductor IP

8051 Overview and Instruction Set

8051 Microcontroller Assembly Programming

Chapter Family Microcontrollers Instruction Set

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO.

Embedded Controller Programming

DR bit RISC Microcontroller. Instructions set details ver 3.10

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

8051 Microcontroller

Introduction to uc & Embedded Systems

Assembly Language programming (3)

Microcontroller. Instruction set of 8051


Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller


Module Contents of the Module Hours COs

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

CHAPTER 3 JUMP, LOOP, AND CALL INSTRUCTIONS

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS


Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

Dragonchip. Instruction Set Manual

Highlights. FP51 (FPGA based 1T 8051 core)

UNIT-III ASSEMBLY LANGUAGE PROGRAMMING. The CPU can access data in various ways, which are called addressing modes

Principle and Interface Techniques of Microcontroller

8051 Microcontrollers

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors

Lecture Instruction Set

Application Brief D-005

JUMP, LOOP AND CALL INSTRUCTIONS

AL8051S 8-BIT MICROCONTROLLER Application Notes

TUTORIAL Assembly Language programming (2)

ELEG3924 Microprocessor

NAME as31 - An Intel 8031/8051 assembler. SYNOPSIS as31 [-h] [-l] [-s] [-v] [-Aarg] [-Ffmt] [-Ofile] infile.asm


8051 Core Specification

ELEG3923 Microprocessor Ch.3 Jump, Loop, and Call

~: Simple Programs in 8051 assembly language :~

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen

MCS -51 Programmer s Guide and Instruction Set

Application Brief D-002

ET355 Microprocessors Friday 6:00 pm 10:20 pm

8051 Addressing Mode and Instruction Set

C51 Family. Architectural Overview of the C51 Family. Summary

8051 Programming using Assembly

Assembly Language programming (2)

What Registers are available? Programming in Assembler. Assembler Programming - like early Basic. Assembler Data Movement Instructions

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000,

Y51 Microcontroller. Technical Manual

UNIT MICROCONTROLLER AND ITS PROGRAMMING

a) Peripheral Interface = Interface Adaptor = Interface Controller

Legacy documentation refer to the Altium Wiki for current information. TSK51x MCU

D: arc SRC KUT51 KUT51LCD.LST KUT51LCD PAGE 1

System & Program Developments of 8051

Legacy documentation refer to the Altium Wiki for current information. TSK52x MCU

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

8051 Instruction Set

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary

CIDESI Minimal Configuration of a Microcomputer System

دستور خروجی. :cout این شی ء در فایل سرآیند iostream.h قرار دارد نکته: در 2008 این شی ء با افزودن ; std using namespace قابل دسترسی است.

1. Write A Program to move a block of data within the internal RAM

Lab-Report Microprocessors

Introduction To MCS-51

International Journal of Digital Application & Contemporary research Website: (Volume 1, Issue 2, September 2012)

Principle and Interface Techniques of Microcontroller

ET2640 Microprocessors

CPEG300 Embedded System Design. Lecture 3 Memory

UNIT MICROCONTROLLER

Interfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller

MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM

Microcontroller and Applications

MICROPROCESSOR LABORATORY MANUAL

Lecture 5. EEE3410 Microcontroller Applications Department of Electrical Engineering Assembly Language Programming (1)

8051 Addressing Modes

Question Bank Microprocessor and Microcontroller

;~~~~~~~~~~~~ ;P4-6-1.ASM ~ ;~~~~~~~~~~~~ SYMBOLS RS REG P2.0 EN REG P2.1 PICK REG P3.0 RELAY0 REG P3.1 RELAY1 REG P3.6 RELAY2 REG P3.

MODULE-1. Short Answer Questions

لیست پیوندی- 2 سید مهدی وحیدی پور با تشکر از دکتر جواد سلیمی دانشکده مهندسی برق و کامپیوتر

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU

MicroConverter Technical Note - uc007 User Download (ULOAD) Mode

2. Write an 8051 program to generate a square wave of 25 khz at pin P2.3 using XTAL = 12 MHz. Solution:

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

Figure Programming model

پردازش لوله ای و برداری

Alexandria University Faculty of Engineering Communications & Electronics Department.

S.J.P.N Trust's. Hirasugar Institute of Technology, Nidasoshi.

Transcription:

اصول ميکروکامپيوترها استاد درس: دکتر http://eeiustacir/rahmati/indexhtm rahmati@iustacir ا درس Email و Website برای تکاليف و : http://eeliustacir/rahmati/ ١ /١۴ هفدهم فصل ا شنايی با دستورالعمل ها وMode های ا درس دهی ميکروکنترولر 8051 ٢ /١۴ ١

SETBbit ; bit=1 CLR bit ; bit=0 SETB C ; CY=1 SETB P00 ;bit 0 from port 0 =1 SETB P37 ;bit 7 from port 3 =1 SETB ACC2 ;bit 2 from ACCUMULATOR =1 SETB 05 ;set high D5 of RAM loc 20h Note: CLR instruction is as same as SETB ie: CLR C ; CY=0 But following instruction is only for CLR: CLR A ; A=0 دستورالعمل های مربوط به bit ٣ /١۴ دستورالعمل های مربوط به byte DEC byte ;byte=byte-1 INC byte ;byte=byte+1 INC R7 DEC A DEC 40H ; [40]=[40]-1 SETB P00 ACALL UP UP: CLR P00 RET ۴ /١۴ Call instruction ACALL SUBROUTINE1 LCALL SUBROUTINE2 ٢

(Conditional Jumps) JZ Lable1 JNZ Lable2 DJNZ Lable1 DJNZ Rn, Lable1 CJNE A, byte, Lable1 CJNE Reg, data, Lable1 JC Lable1 JNC Lable2 JB bit, Lable1 JNB bit, Lable2 JBC bit, Lable1 دستورالعمل های پرش شرطی Jump if A=0 Jump if A 0 Decrement and jump if A 0 Decrement and jump if Rn 0 Jump if A byte Jump if byte data Jump if CY=1 Jump if CY=0 Jump if bit=1 Jump if bit=0 Jump if bit=1 and then clear bit ۵ /١۴ همه پرش های شرطی کوتاه هستند Jumps) (Short حالت ها ا درس دهی 8051 The 8051Addressing Modes ۶ /١۴ ٣

(ا درس دهی با ثبات) -1 Register Addressing Mode Operand به صورت يک بايت در يکی از رجيسترهای داخلی( Rn ) قرار دارد MOV A, R7 ; Copy the contents of R7 into A ADD A, R7 ; Add the contents of R7 to A MOV MOV R7, A A, R5 INC R0 ; Increment R0 DEC R1 ; Decrement R1 ANL A, R6 ; Logic AND (A+R6) ٧ /١۴ (ا درس دهی مستقيم) 2-Direct Addressing Mode ا درس Operand به صورت يک بايت داده می شود MOV A, P1 MOV A, 90H ; Copy the contents of P1 (90H) into A ; Copy the contents of P1 (90H) into A MOV A, 7FH ; Copy the contents of memory location (7FH) into A INC 7FH ; Increment (internal RAM) memory location (7FH) MOV MOV P1, A A, DPH ADD A, 4 ANL A, 37H ; AND Logically MOV 4, 7 ; Copy the contents of R7 into R4 ٨ /١۴ MOV R4, R7 Invalid Instruction ٤

(ا درس دهی غير مستقيم) Mode -3 Indirect Addressing ا درس در يکی از رجيسترهای R0 يا R1 قرار دارد ٩ /١۴ MOV A, @R1 ; Copy the contents of (R7) into A MOV @R0, A MOV @R1, B MOV A, @R1 MOVC A, @DPTR ; Read from code (ROM) memory MOVX A, @R0 ; Read from external memory MOVX @R0, A ; Write to (external RAM) data memory MOVX A, @DPTR ; Read from external data memory MOVX @DPTR, A ; Write to external memory ADD A, @R0 ; Add the contents of (R0) to A ANL A, @R0 ; AND Logically INC @Ri ; i=0, 1 (ا درس دهی بلافصل) 4-Immediate Addressing Mode Data ا درس يا Operand مقدار ثابتی است MOV A, #12H MOV DPTR, #2000H MOV DPL, #00 MOV DPH, #2O MOV R4, #62 MOV R4, #COUNT ADD A, #25H ANL A, #33 ١٠ /١۴ ٥

(ا درس دهی نسبی) Mode 5-Relative Addressing از اين ا درس دهی برای پرش های نسبی کوتاه (۱۲۷+ تا ۱۲۸-) استفاده می شود JZ AGAIN ; Jump if A=0 JNZ AGAIN ; Jump if A 0 SJMP 5 ; Jump forward 5 locations SJMP 0F6H ; Jump back 10 locations JB P12, LABLE1 ; Jump if the bit is set (P12=1) JC LABLE2 ; Jump if Carry is set (Cy=1) JNC LABLE2 ; Jump if Carry is not set (Cy=0) SJMP START DJNZ Ri, LABLE3 ; Decrement Ri and jump if Ri 0 ١١ /١۴ DJNZ CJNE R7, AGAIN R5, #73H, AGAIN ;Compare and Jump if Not Equal (ا درس دهی مطلق) 6- Absolute Addressing Mode فقط در دستورات ACALL و AJMP استفاده می شود ا درس دارای ۱۱ بيت است به هر خانه ای در صفحه ۲ کيلوبايت حاضر می تواند پرش کند AJMP ACALL THERE ;Absolute Jump THERE ;Absolute call ١٢ /١۴ ٦

(ا درس دهی طولانی) 7- Long Addressing Mode فقط در دستورات LCALL و LJMP استفاده می شود ا درس دارای ۱۶ بيت است به هر خانه ای در حافظه می تواند پرش کند LJMP LCALL THERE ;Long Jump THERE ;Long Call ١٣ /١۴ (ا درس دهی انديس دار) -8 Indexed Addressing Mode فقط در دستورات JMP و MOVC استفاده می شود ا درس حاصل مساوی است با محتويات PC يا DPTR (به عنوان ا درس پايه) بعلاوه محتويات ا کومولاتور (به عنوان ا فست) اين مود ا درس دهی کار با جداول را ا سان می کند MOVC A,@A+PC MOVC A,@A+DPTR ;Read from address (A+PC) ;Read from address (A+DPTR) JMP @A+DPTR Jump to address (A+DPTR) ١۴ /١۴ ٧

پايان ١۵ /١۴ ٨