You are on page 1of 19
Appendix A: 8085 Instruction Set by Opcode The information in this appendix is reproduced by kind permission of the Intel Corporation, The symbols and abbreviations used are listed below. ® Symbol Meaning Accumulator \ One of the internal registers Represents the flag register The 16-bit memory address currently held by the register pair H and L ‘An 8.bit data quantity A 16-bit (two byte) data quantity A 16Dit address ‘An 8-bit 1/0 port address One of the registers A, B,C, D, E, H, L One of the following register pairs B represents the register pair Band C D represents the register pair D and E H represents the register pair H and L PSW represents the register pai A and F a SP represents the 16-bit stack pointer Pc The 16-bit program counter cy Carty flag P Parity flag AC Auxiliary carry flag Zz Zero flag s Sign flag 2 Microelectronics and Microprocessor-based Systems Data Transfer Group, ‘These instructions transfer data between registers and memory Flags - none affected by instructions in this group Move ok op BA 47 CA 4F AB O78 Bp 40 cha ee ne 4 ce 49 So aDe ah 42 CD 4A MOV 4 AL 2B MOV 43 MOV Cr 4B AH 7c 44 cH 4c AL 7D 45 cL 4D AM TE 46 CM 4E DA 57 SF HA 67 DB 50 58 HB 60 DC St 59 HC 61 : DD 52 SA HD 62 MOVE pe 5 ae ees DB 54 EH 5c HE 64 DL 55 Ey 5D HL 65 DM 56 EM SE HM 66 Move Immediate LA 6F MA 77 Ajbyte 3E LB 68 MB 70 B,byte 06 re 69 Mc 71 Coyte OE a MD 72 Dobyte 16 MOV pee op MOY Ve 7 EV ebye 16 Lu 6c MH 74 Hbyte 26 LL 6D ML 75 Lyte 2E LM 6b Mbyte 36 Load Immediate (Reg, pair) LoadjStore A direct Bdble Ol LDAXB OA bg J Dadble iH LDAXD 1A Hdble 21 STAXB 02 SPdble 31 STAXD 12 Load)/Store A direct Load/Store HL direct LDAwddr 3A LILDaddr 2A STA addr 32 SHLD addr 2 Appendix A: 8085 Instruction Set by Opcode 205 Exchange HL with DE XCHG EB metic Data Manipulation Group — Ari Instructions in this group perform arithmetic operations on data in the regis the memory Add* A 87 A BF B 80 B 88 Cc 81 Cc 89 Dd 82 4 Dd BA ADD E 83 ADC E 8B H 84 H 8c L 85 L 8D M 86 M 8E Subtract* A 97 A oF B 90 B 98 4 a1 Cc 99 D ae D 9A SUB E 93 SBB BE OB H 94 H 9C i 95 L 9D M 96 M 9E Add/Subtract Immediate* Double Length Add*** ADI byte C6 B 09 ACI byte CE D 19 SUI byte D6 a u 29 SBI byte DE sp 39 Increment/Decrement®* A 3c A 3D B 04 B os Cc oc c oD D 14 . Dd 1S DC! INR Aye ie ly Ib H 24 H 25 L 2c L 2» M 34 M 35 226 Microelectronics and Microprocessor-based Systems Increment/Decrement Register Pairt*** B 03 B OB . D 13 7 D 1B eh 2 Dasa ee 2B SP 33 SP 3B Decimal Adjust A* Complement A**** DAA 27 CMA QF Complement/Set CY*** Arithmetic Immediate* cmc 3F ADI byte co sTC 37 ACI byte cE SUI byte D6 SBI byte DE Notes * All flags may be affected ** All flags except CARRY may be affected *** Only CARRY FLAG affected ***™ No flags affected. Data Manipulation Group — Logical Instructions in this group perform logical operations on data in the registers and the memory. AND* OR* Exclusive-OR* A OAT ‘A BT A AF Bo AQ BBO BAB C iAl cB c Ag D A2 DBZ D AA ANAS 43 ORATE py XRAY DAO HAG HO Ba Hac LAS LBs LAD M46 MBG MAE Appendix A: SO8S Instruction Set by Opcode Compare* Rotator Logical h (A BE RLC 07 ANT byte £6 BD BB ORRC | OOF XR byte Eb CBO RAL 17 OORT byte Fo De BA RAR lis Clio FE CMP eM > BB HBC L BD MBE No! * All flags may be affected. *** Only the CARRY flag may be affected. Transfer of Control Group or Branch Group This group of instructions alters the sequence of program flow by testing the condition flags. Jump Call Return IMP addr C3 CALLaddr = CD RET co INZ addr c2 CNZ addr c4 RNZ co JZ addr CA CZ addr cc RZ ca INC addr pz CNC addr pa RNC bo JC addr DA CC addr pc RC bs JPO addr 2 CPO addr 4 RPO EO JPE addr EA CPE addr EC RPE BS JP addr F2 CP addr Fa RP FO JM addr FA (CM addr FC RM FS Jump Indirect PCHL £9 Input/Output Group This group of instructions performs 1/0 instructions between the accumulator and a specified port. IN port DB OUT port DB 228 Microelectronics and Microprocessor-based Systems Stack and Machine Control Group ‘This group of instructions maintains the stack and inte Stack operations B ce B cl So D bs nae ED; DI PSee itl ES roe i BI psw FS psw FI XTHL E3 SPHL F9 Interrupt Control Processor Control EL FB NOP 00 DI BB HLT 7% RIM 20 SIM 30 Restart cr CF RST FF aausunro Wf EC 3.2.6 — Microprocessor and Microcontroller Laboratory Microprocessor and Microcontroller Laboratory CODE : - EC 3.2.6 LABORATORY MANUAL & ASSIGNMENTS INSTITUTE OF RADIO PHYSICS AND ELECTRONICS UNIVERSITY OF CALCUTTA @ EC 3.2.6 ~ Microprocessor and Microcontroller Laboratory Microprocessor -8085 GENERAL INFORMATION [eR [8085 operating a 3.072MITZ— aa MEMORY a ory is pro EPROM Two JEDEC compatible 28 pi | bytes using 2827128/27256 ae RAM TIEDEC compatible sockets are provided for 8/32K RAN SKB of RAM will be will be supplied PARALLEL WO | 48 1/0 Tines using two 82555 SERIAL 10 One RS 232C compatible interface using USART 8251A, with programmable baud rate using one channel of $253 timer MAX 232C IC, [TIMER Three 16 bit counter/timers using 8253 timer. I'counter is used for serial VO baud rate generation. oF | PIC Programming Interrupt controller using 8259A provides interrupt | vectors for 8 jumper selectable Internal/external sources [KEYBOARD ___| Consists of 28 numbers of computer grade keys or equivalent__| DISPLAY Six numbers of bright seven segment displays for address and data | display | INTERRUPTS | UM Provision for connecting NMI to a key switch NTR Programmable Interrupt controller using 8259A provides interrupt vectors for 8 jumper selectable internal/external sources. Onboard sources include 8251A,TXRDY and RXRDY,8255 and 8087 INTERFACE BUS i SIGNALS | All address, data and control lines are TTL compatible and are * | terminated in 50 pin berg strip header | > | All signals are TTL compatible and terminated in 26 pinberg, headers for PPI expansion. It’s compatible with all of our experimental interface modules | > | Serial port signals are terminated in standard 9-pin “D* type connector, MONITOR 6k bytes monitor(27128A) that allows program entry verily and SOFTWAR debug user programs including onboard Assembler and Disassembler commands is POWER 4+5V DC with 2.5 Amps current rating (max) 7 REQUIREMENTS JEDEC: Joint Electron Dei e Engines ig counci EC 3.2.6 ~ Microprocessor and Microcontroller Laboratory PROCEDURE DR EI TERING USER PROGRAM Execution of program through keyboard P1: Conneet the S-volt power supply from th SMPS (o the microprocessor kit STEP2: The word ‘SDA 85° should be displayed in the integral display of the kit after power is switched on, If not, press “RESET” key. STEP3: To write the program in the kit, follow the instructions given below. * Press “RESET” key Press ‘SUBST MEM’ key Enter the initial address Press ‘NEXT’ key Enter the hex code Press ‘NEXT’ key Enter the next hex code Press ‘NEXT’ key Continue in this way till all the hex codes have been entered. Do not forget to press the ‘next’ key after the last hex code has been entered STEP4: To execute the program follow the instructions given below: - Press ‘RESET’ key PRESS ‘GO” KEY Enter Starting address Press ‘EXEC’ key STEPS: To view the contents of accumulator (or any other register B,C, D, E, H, Ly F): = Press “EXAM REG" afier that Reg ‘A’ key (OR Reg ‘B', Reg °C’, Reg *D", Reg “BY, Reg ‘H’, Reg ‘L? EC 3.2.6 — Microprocessor and Microcontroller Laboratory STEP6: To view the contents of any memory location: - * Press “SUBST MEM’ key * Enter the address of the memory location + Press “NEXT” key EC 3.2.6 ~ Microprocessor and Microcontroller Laboratory 85-ME TRAINER INSTALLATION PROCEDURE OF. “ements Power Supply Req ‘The trainer requires a DC regulated power supply with SV at 1.5Amps outputs for its basic operation. The power connections are made through 9-pin D type connector Pind = #5V Orange/Blue/ White Pin 4.5 - IND Black/yellow Keyboard Operation As soon as +5V and GND are connected and power supply is switched on, the sign on message ” SDA 85” should appear on the display. The labeling of the keys clearly indicates their function. ("KEY LABEL DESCRIPTION a RESET Transfer control to the monitor at location OFT Key is connected to the RESET input pin ee i ee ‘A user interrupt key connected to the RST 7.5 input of the CPU. transfer control to location FFB! in RAM if the interrupt is unmasked and interrupts are enabled NEXT “The monitor interrupts this Key as @ delimiter EXEC The command terminator BLOCK MOVE __| Select the block move command z = EXAMREG __| Select the Examine/Modify CPU register Select the GO command(program execution) Select the Insert data bytes funetion A delimiter key : SINGLE STEP | Seleci the single step funetion STEP ‘SUBSET MEMORY | Select memory Examine/Modify function DEL Select the delete data bytes function { C COMP Hex key C_Select the memory complement command L SH Hex key 8 The contents of the H register to be displayed 4 SPH Hex key 4 The content of high byte stack pointer to be displayed o Hex key 0 D Hex key D The contents of the D register to be displayed 9L Hex key 9 The contents of the L register to be displayed [ 5_SPL Hex key 5 The content s of the low stack pointer register to be displayed { ECRT HEX E, Select the CRT mode when pressed afler Reset = A Hex key A 7 6 PCH Hex key 6 The high byte of the program counter to be displayed 2 Hex key 2 FO FILL Hex key F. Select the memory fill Command B Hex key B. 3.2.6 ~ Microprocessor and Microcontroller Laboratory /O MAPPING INFIGURATIO fe RAINE! Memory Configuration JUMPER PIN 27128(029) 27128(U27) (264023) JP14 OPEN 0-3FFFH 4000-7F FFU IPI CL | 0-7FFFH | JPISC JP12 OPEN Be RAM configuration 1/0 Device VO Address TIMER C8 Timer 0 8253(UI1) C9 Timer 1 CA Timer 2 CB CONTROL KEYBOARD | D0 DATA DISPLAY DI CONTROL, CONTROLLER 8279 (US) | ppl, 8255 (Ua) [ D8 PORTA D9 PORTB DA PORTC peer DB CONTROL __| PPI, 8255 (U3) [FO PORTA FL PORTB F2PORTC F3 CONTROL 8251(06) CO DATA CLCONTROL, Programmable ‘Timer 8253 ‘Timer 0 of the 8253 has been used on card for the single step function. To enable this capability ensure that the jumper JP9(1-2) should be close. ‘Timer! of the 8253 has been used on card for generation of the TXD and RXD baud clock required by USART(8251A). To enable this short JP9(3-4) should be close. A\ll timer gate, clock and out lines are terminated at 26 pin connector PS Serial /O 82514, We can operate the serial 1/O port for RS232C using DB9 connector PI EC 3.2.6 ~ Microprocessor and Microcontroller Laboratory ECTOR PIN DETAILS, CON BUS EXPANSION CONNECTOR CNI (50 pin berg, male) | Signal Description PIN Signal Description Gnd : Gnd Address line AO Address line AT Address line A2 Address line A3_—__| Adkulress line AS Address line AT Address line AD Address fine AL Address line A13 Adulress line Ad Address line AG Address line AR Address line A10 INTA line 12P pin? a fine DO_ Data line D3_ Data line 29 | Data line Do Data line D7 [731 cru si tine Bus clock to inverter [33 4 INTR. RST 6.5 RST 5.5, RST7.5, [ [HOLD HLDA | | vec vec RD line WR line NC TO/M line ALE line READY line GND RESET signal ‘GND CLK signal Auxiliary Connector (26 pin) PS. PIN Signal Description IP of timer 8253 AP of tin VP of 8259AURQS) 8259AIKQO) 24 UP of 8259AURQ7) 23 uw EC 3.2.6 — Microprocessor and Microcontroller Laboratory CTOR P2.& P3 (26 pin male) PPI CONNES The port ines of 8551 and II (U14, UES) are terminated in this connector, as shown below: No. | Sig description MIC pin 3 IC pin 16 IC pin 14 PBO, IC pin 24 —_PC3.IC pin 17 PCI, IC pin 15 PBI, IC pin 25 —PBSLIC pin 23 —PB3IC pin 21 PRIAC pin 19 ~ PAA, IC pin 40 PA2.IC pin 2 PAO. IC pin 4 S iC pint | + SV IPI Serial 1/0 connector -P1 Pin No Signal description RS-232C_O/P-TXD RS-232C_I/P-RXD RS-232C_O/P-DTR_ RS-232C_O/P-DSR GND EC 3.2.6 — Microprocessor and Microcontroller Laboratory nector PA Colour Code White /Orange/Blue Black/Yellow — To branch to the seria monitor commands the following initialization of baud rat mory is required to seleet the ZC CEESOTEES ISESSORENTE 7, ORES BAUD RATI 0s 00. 19200 “0A 00 : 9000 00 480 _ 00 _ 2400 00 1200 EEE EEE HOO: [600 ol |_ 300 ‘The RESET key is then pressed followed by E CRT & 0 key to transfer control to a CRT terminal or a PC COM port connector to the connector DB9-PI. The above values are based on the 1.536 MHz clock/ip to the 8253. Single Step Command : Syntax: SINGLE STEP <> It is very useful to have a facility where by a program can be executed one instruction at a time..The delimiter NEXT allows a single instruction execution and the delimiter EXEC terminates the command, Whenever the next key is pressed the register contents are updated from their save location, a single instruction in the user program is executed, the registers are once again saved and the monitor returns to the user with the program counter and the byte that it addresses displayed in the address and data fields respectively Insert Command: INS
< number of bytes to be inserted > ‘This is a mini editing command, which allows the user to insert a specified number of bytes into his program at a specified address. Addresses in his program, corresponding to 3 byte memory reference instruetions, are altered to take at which the bytes are to be inserted is not altered, The bytes are to be inserted in a manner similar to the substitute memory command. The terminator EXEC terminates the command. EX: INS F926, 13, [ 19 bytes can be inserted] Delete Command Syntax; DEL <> ‘A mini editing command that allows a portion of a user program to be deleted specified by a starting address and an editing address EX: DEL FE04, FE33 EC 3.2.6 ~ Microproce: sor and Microcontroller Laboratory CRT command Syntax: WER This command allows the mode to be change to serial for communication with a CRT of PC, RAM locations FPA6 and FEAT should be initialized to the values corresponding to the required baud rate, Pressing the EXCRT key followed by *0" invokes serial monitor. Pressing the /CR'T key followed by ‘I” selects ERT/KBD mode of operation, Mode identifier is initialized to O11, Control is transferred to the CRT/keyboard, the system display is cleared and the keyboard is locked out, pressing the RESET key restores the mode to system keyboard/display, Serial Monitor Commands: This section details the commands that are accessible from a serial device like CRT or a PC in terminal mode connected to the serial port. As the command structure and function is essentially the same as that keyboard mode, Help Menu Syntax H On pressing the key “H’ the following menu will be displayed EXDH< Memory Commands Display Examine Register Display Display Mo Assemble Block Move Disassemble Insert EPROM Programmer Delete cassette Save

Block Fill

Cassette Load Block Complement Help EC 3.2.6 — Microproces Institute of Radio Phy: ‘or and Microcontroller Laboratory ics and Electronics Univ rsity of Calcutta Microprocessor and Microcontroller Laboratory (IC3.2.6): Assignment: 1 Assignment Na +: Assembly Language Programming-1 . Problem Statement: Write an assembly language program- 1 2, To store certain data byte (e.g. 4411) in memory location E1001 4a) Store two data bytes in any two registers. Exchange the content of the two registers and observe the result b) Store two data bytes in any two memory locations. Exchange the content of the two memory locations. To fill the memory location E100 to EFF by SSH. To fill the memory location E100 to E1FF by 55u and AAn alternatively Write an assembly language program to add the content of (E150) and (E15!) and store the sum in memory location (E154) and carry in memory location (E155)rt To add the content of (E150)u: and (E151)i: and store in memory location (E154) without using HL register pair. To find out the square of any number from 0 to 9 using look up table. The table is stored starting from memory location (E125)u1 and the data is stored in (E150). Ifthe data in (E150)1 is beyond the range of ook up table an error symbol of “FF” will be displayed in memory location (E131) £050)11 and (E051) and store To perform subtraction of two 8 bit numbers stored in memory location the difference in (£052), and borrow if any in memory location (E0S3)i1 EC 3.2.6 ~ Mi “or and Microcontroller Laboratory roprocs Institute of Radio Physics and Electronics University of Caleutta Microprocessor and Microcontroller Laboratory (EC3.2.6): Assi + Assembly Language Programming-t ent Nai Problem Statement: Write an assembly: languag program for each of the prablems stated below. 50H to E0S3H. Add the numbers and sare stored in memory locations from F Let wo 16-bit numb multiply the result by 4 (decimal) and store the result in memory locations E054H and £053H Add two BCD numbers stored in memory locations E100H and E101H. Place the result in memory Jocation ELH, The result should also be in BCD. Calculate the sum of series of 8 bit numbers. Length of the series is stored in location E100H and the series begins from E101H. The sum will be stored in some separate memory location Write an assembly language program to compute 16 bit sum of N positive entries of a table, The first entry of the table contains the number of elements N. The 16 bit sum will be kept in memory locations SUM-LO and SUM-HI. If the sum requires more than 16 bits, only the lower bits will be kept and the MSB is said to be truncated. ive memory locations starting from EOSOH. Add the odd Fake any 10 natural numbers in cons numbers and store the result in register E and add the even numbers and store the result in register D. a block of data and count how many times a given Write an assembly language program to check ize of the data block to be checked is stored in data (say PPH) is found in the data block, The s EJOOU and the data ure stored starting trom BOLL Write an assembly language program to check a block of data to find out the largest and smallest value stored in the block. ‘The data is stored from E0SOH. 9. 10. EC 3.2.6 — Microprocessor and Microcontroller Laboratory Write an assembly language program to exchange 10 bytes of data stored from location X with 10 bytes of data stored from location Y. Let 10 bytes of data are stored from location E1O0H. Write an assembly language program to transfer the entire block to another memory location starting from E10SH. Write an assembly language program to multiply two unsigned 8 bit numbers using shift and add method. . Store @ block of any ten 8-bit numbers in any order starting from a location of your choice. Write an assembly language program to arrange that block of ten 8-bit numbers in ascending order. Store a block of any ten 8-bit numbers in any order starting from a location of your choice. Write an assembly language program to arrange that block of ten 8-bit numbers in descending order.

You might also like