MPMC Lab

You might also like

You are on page 1of 75
Department of Electronics L Communication Engineering Microprocessors and Microcontrollers Lab INTRODUCTION TO ESA MICROPROCESSOR TRAINER KIT ESA 86/88E is an economical and powerful general-purpose microcomputer system that can be operated with 8086 or 8088 CPU that may be used as an instructional and learning aid and also as a development tool in R & D labs and industries. 8086 and 8088 are third generation CPUs from INTEL that differ primarily in their external data paths, 8088 uses an 8-bit wide data bus while 8086 uses a 16-bit wide data bus. ESA 86/88E can be operated with either CPU and the only is possible difference would be in the speed of execution (with 8088 CPU, a small speed degradation occurs because of the 8-bit wide data bus). In either case, the CPU is operated in maximum mode. ‘The basic system can be easily expanded through the system Bus connector. Powerful features like monitor resident Symbolic One-line assemble and Disassemble simplifies the programmer's task of entering Assembly language programs. On-board provision for 8087 Numeric Data Processor makes ESA 86/88E useful for number-crunching applications also. Onboard battery backup provision for RAM is made to retain the user programs in the event of a power failure or when the trainer is powered OFF. The trainer also features onboard Programmable Peripheral Interfaces, Programmable Interval Timers, USART (for serial communication), PC keyboard controller and parallel printer interface. Further, ESA 86/88E firmware also supports ESA EPROM Programmer interface. ESA 86/88E can be operated on single +5 Volts power supply in stand-alone mode using LCD and optional PC/AT keyboard, or in serial mode with a host computer through its RS-232C interface. User-friendly Widows and DOS Driver packages supplied with ESA 86/88E provide for a powerful and versatile Assembly level programming/debugging environment. © Scanned with OKEN Scanner ARCHITECTURE OF 8086 MICROPROCESSOR: Address/status Address/data AtelSs~Arg/Se ADg~ ADi5 Memory address and data bus interface intemal data bus 8 U s ‘Address conversion 1 mechanism (adder) N Instruction byte i fT fe cue R cs F A os c ss E uv N 1 Th ~ Internal data bus F Decoding x circuit E Cl AX | ex 1 | ox Dee ALU (16) SP u BP " si TL Ol Register bank Flags (16) Timing and contro! ‘circuit Glock and controt signals Raghu Institute of Technology (Autonomous), Dakgmarr, © Scanned with OKEN Scanner Maximum moda Minimum modo eno] 1 40 {—] vee ADi (| 2 30 [—) Adis AD}; (_| 3 38 |") Atd/Ss AD (| 4 37 [7] Ane ADy | 5 36 |] Aw/Ss AD» [_] 6 35 |] Atg/So AD (| 7 34 [7] SHES; AD. (] 8 93 [=] MNAIX Ao, 9 af) ADs [7] 10 8086 af (HOLD) Ads CC] 1 30 =) Ra (HLDA) AD, ([] 12 2) wR) ADs (13 2{9 (id) AD, (| 14 27 (OTR) AD, [7] 15 2 [4 (DEN) ADs (] 16 237 (ALE) Nmt (| 17 24 [7 (INTA) INTREC] 18 23 [7] Test CLK [| 19 22 [—) READY GND |_| 20 21 |] RESET SYSTEM CAPABILITIES: * Assemble 8086/8088 Instruction Mnemonics using ESA 86/88E Symbolic One-Line Assembler. * Disassemble HEZ bytes from memory into 8086/88 BPU instructions using monitor resident Disassembler, © Perform fast numerical computations using the optional 8087 Numeric Data Processor. © Execute the user program at full speed or debug the program through Single Step and Breakpoint facilities. * Examine/Modify the contents of memory locations in byte or word format. ‘© Examine/Modify the content of CPU registers. * Write or read data to or from /O ports (byte or word format). a a oe ee Raghu Institute of Technology (Autonomous), Dakamarn, Visakfapatnam 3 © Scanned with OKEN Scanner ‘* Operations on blocks of memory such as filling a block of memory with a constant byte or word data, comparing a block of memory with another block, copying a block of data or program within the memory and displaying memory blocks in byte or word format. * Communicate with a Host PC serially through RS232C interface at a baud rate of up to 19200 and develop/debug applications using the user-friendly Windows or DOS driver packages. ‘* Supports for downloading user programs into ESA from a host computer system in Intel HEX as well as Intel Extended HEX format. * Support for uploading user programs to Host Computer system and saving them as HEX files ona system. * Read, Program, verify and Blank check of popular EPROM s Programmer interface module. * Use the monitor resident Centronics compatible Parallel printer driver software and obtain hard copies of Serial mode operations. SPECIFICATIONS: Central Processor: 8086 or 8088 CPU operating at 5 MHz in maximum mode. (Supplied with 8086 CPU) Co-Processor: On-board 8087 Numeric Data processor. Memory: ESA 86/88E provides a total of 128 Kbytes of onboard memory. 1, 64K Bytes of ROM using two 27256 EPROMS. 2. 64K Bytes of RAM using two 62256 Static RAM s. ONBOARD PERIPHERALS AND INTERFACING OPTIONS: 8251A: Universal Synchronous/Asynchronous Receiver/Transmitter supporting standard baud rates from 110 to 19,200. Baud rate is selected through on-board DIP switch setting. 8253-5: Programmable Interval Timer; Timer 0 is used for Baud clock generation. Timer 1 and Timer 2 are available to the user. 8255A: 3 Programmable Peripheral Interfaces provide up to 72 Programmable I/O lines, One 8255 is used for controlling LCD and reading DIP Switch. Two 8255s are for the user, of which one is populated by default and the other is optional. 8288 - Bus Controller used for generating control signals in Maximum Mode operation. 8042/8742 UPI (Universal Peripheral Interface) Interrupts: External: ee © Scanned with OKEN Scanner Department of ‘blectronics & (umnumenion cnyeneenings 1. re ee NMI: 8086/8088 Type 2 Interrupt connected (0 KBINT key on the trainer, The vectoring information for this interrupt is fully user-defined. INTR: Available to user on system expansion connector J6. Internal: Interrupt Vectors | (Single step Interrupt) and 3 (Breakpoint Interrupt) reserved for monitor. CPU Bus: De-multiplexed and fully buffered, TTL compatible, Address, Data and Control signals are available on two 26-pin ribbon cable connectors. Parallel 1/0: 48 programmable parallel VO lines (TTL Compatible) through two 26-pin ribbon cable connectors. Note that only one 8255 and its corresponding 26-Pin ribbon cable connector is available as default factory installation, which may additionally be used as a parallel printer interface. Further, ESA 86/S8E firmware uses this 8255 for operations with ESA EPRON Programmer interface also, Serial 1/0: RS 232C through on-board 9 pin D-type female connector. PC Keyboard: PS/2 connector is provided for interfacing PC Keyboard. 20 x 4 LCD: 15-Pin flow-strip for interfacing the 20x4 LCD. Timer Signals: Timer I and Timer 2 signals are brought to a header. Power Supply: + SV @ 1A (approx.) Battery backup: 3,6V Ni-Cd battery as power backup to RAM (optional). 8086/88 ESA Trainer kit Commands: Single Step: Executes single IN[,],[/] * Help Command: Lists Monitor H commands with their valid I [] syntax. Invoke Programmer Software: P* Invokes the software for ESA P EPROM Programmer Interface Enter Assembler: A‘e* Invokes EAS 86/88E Symbolic A [address] One-line Assembler List Labels: LL** | Lists all labels defined in the LL symbol table Label Clear: LC** | Clears all previously defined label | LC from the Symbol Table Disassembly Command: Disassemble Hex code into 8086 mnemonics fora specific memory | 2 [, ]} "Raghu Institute of Technology Clutonomous) Dakenart ‘sakfiapatnam 5 Zu © Scanned with OKEN Scanner — range | Substitute Memory bytes: ei Displays/ Modifies memory S [
] [, / [],]* Substitute Memory Words: SW [
][, /[],]* sw Displays/modifies memory Words. Display Memory bytes: Displays | 0 sare address>{,] D block of memory in word format. Display Memory words: Displays DW block of memory in word format DW[,] Examine/modify registers: i 5 x Displays modifies 8086/8088CPU | «sos /,JI registers. Move Memory: Copies a block of Mm memory from one location to the | M,, Fill Memory (Byte):Fills a block of | Festart address>,, Fill Memory (Words): Filla block _ | FWestart address>,, Input byte: Accepts and displays the | IL,]* I data byte at the input port Input Word: Accepts and displays Iw the data word at the input port. IW[,]* Output byte: Outputs a data byte oO to the output port. Osport address>[/,]* [ow Output word: Outputs a data word to the output port OW{: /,]* Compare Memory: Compares a block of memory with |C,, © Scanned with OKEN Scanner ESA 86/88E MICROPROCESSOR TRAINER KIT PROGRAM EXECUTION STEPS BAL © Press the Reset key on the ESA 86/88E trainer kit © ESA 86E will appear on the display * Give A space starting address to give the starting address~ A 2000 * Press Enter © Type the program line by line by pressing Enter for every line of program © Press Enter * After the program, press Shift +1 (!) to save the program © Press Enter Inputs: © Type SW space SI address — SW 3000 Press Enter then give 1 Input, Ex: 1521 0000:3000- 1521 © Press Enter © Type SW space SI+02 address — SW 3002 © Press Enter then give 2" Input, Ex: 1234 0000:3002- 1234 © Press Enter Execution: * Give G space starting address to execute the program ~ G 2000 * Press Enter then the result will be displayed as follows (For Addition) AX= 2755, BX=1234 © Scanned with OKEN Scanner Department of Electronics munication Engineering Microprocessors and Microcontrol. CX= 0000, DX=0000 ete e Press Enter Outputs: © Type DW space DI address — DW 5000 then the output will be displayed as 0000:5000- 2655 © Type DW space DI+02 address ~ DW 5002 then the 2 output will be displayed as 0000:5002-0000 (If there is no Carry) Machine Codes: © To see the Machine Codes/Hex Codes, type A space starting address — A 2000 © Note down the Machine Codes/Hex Codes by pressing Enter for every line of program Note: One Memory Location will store One Byte of data. © Scanned with OKEN Scanner “SW 2000 +t 0000 : 3000 15a “Skt 30092 +! 0000 : 300.2 lade Executions +G 2000 Dseplays Atatur of all AX = 2455, cX 20000 SP = o100 ST > 9102 De = 6000 ES 2 OCOD Te: Dols aes “pw 6000 aoe np BX 212384 Dx = 0000 BP = 0000 pn) = 2900 SE = 0000 Cg 5 0000 FL = F008 C000; 5000 A455 “Du 5008 6000! 5002 0000 © Scanned with OKEN Scanner Department of Electronics of Communication Engineering Microprocessors and Microcontrollers L EXPT-1(a): MULTI BYTE ADDITION AIM: To write an Assembly language program to perform addition of two 16-bit numbers using E’ 86/88 Microprocessor Trainer Kit. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV 3. KEYBOARD ALGORITHM: 1. Get 1* operand from memory that is pointed by source index [SI] register and store it in AX register. 2. Get 2" operand from memory and store it in BX register. 3. Add contents of AX and BX registers and the result will be in AX register. 4, Store the result in memory location pointed by DI. PROGRAM: MOV AX,0000 MOV SI,3000 MOV AX,SI] ADD SI,02 MOV BX, [SI] ADD AX, BX MOV DI,5000 MOV [DI], AX MOV CL,00 INC LI INC CL Li: ADD D102 MOV [DI],CL INT 03 © Scanned with OKEN Scanner oot 8 m= Ol © Scanned with OKEN Scanner PROGRAM TABI Program starts at (starting offset address) memory location. Memory | Machine/ | Mncmonics ~ ‘Comments Address | Hex Codes | Label Opeode | Oper sdecoing Acumulater: 2000 |B& CO CO fopv [AX 0000 5 ST pointed -fo 3000 2603, 00 80 pioy |ST2000 meray Jocations Get a umber tte 2606 | BP OF pov | xy (St) accumulator QCO® Sf CG 02 Oc pr | ston 4 Tncre ment s by tao by yMove second numer : Bx, [st |” aco; | SP Ic mov ( [st] ee segs 3 Add teu rumbats arch po | Ax, Bx |” aoe ADD | AGES) spe seul is to the aX. 5p? pdinted to 5000 AO1O <0 ov a i D1,See0 memoly Socatiory 5 stole the Sosult % do 83 & wov | imax |? the Sosult “uy mem ay Socation. panted to pb. 7 ov co to ct regi ston aos |p © tov | CL,00 / damp td Peefjeok label oat ga 02 One | 4) ihe is ey _. § - ——————— Ragha Tnstieut of Technology (Autonomous) Dakgmarn, Wsakfapatnam Tt © Scanned with OKEN Scanner Department of Electronics &£ Communication Engineering Microprocessors and Microcontrollers Lab Sen ee ee ED sotherustse. Increment soiq |Fe PNe | eb CL segites. si © pb ty tevo aoe cree) 4 | anv | oao2 | 4 SS the Sesultin air |B OD hou | (a,c memoiy Docation potntel 4 we. Deis 2 Loftenrte “inkessupt” 0d) we INT | 03 “alech. tells the process to end the. propa. RESULT: The mmattibyte addition fecteoean too mumbtas 6 Paasfpimed by ubng ESA 86/39 micie Proesey rbaines HE © Scanned with OKEN Scanner Department of Electronics s& Communication engineering EXPT-1(b): MULTI BYTE SUBTRACTION |AIM: To write an Assembly language program to perform subtraction of two 16-bit numbers using ESA 86/88 Microprocessor Trainer Kit. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV 3. KEYBOARD ALGORITHM: 1. Get 1" operand from memory, which is pointed by source index [SI] register and store it in AX register. 2. Get 2™ operand from memory and store it in BX register. 3. Subtract contents of AX and BX registers and the result will be in AX register. 4. Store the result in memory location pointed by DI. PROGRAM: MOV AX,0000 MOV _ SI,2100 MOV AX, [SI] INC SI INC SI MOV BX, [SI] SUB AX, BX MOV BL,0O INC LI INC BL Li:MOV _DI,4000 MOV DI, [AX] ADD DI,02 MOV [DI], BL INT 03 © Scanned with OKEN Scanner Ski 100 anna 6000: aloo 4913 ‘SN Aloo ad bov0: ator 1834 Exceution +G aooo replays Stotus of all rogheteas AX = SF DF BX = 1900 CX = 045 Dx = FFEq SP = O10 Be = 030A ST = DlW”A PT = A002 Dg = e000 $s = 0000 eS = 0000 Ce = 0000 Ip - Solr FL = FOOD Oscepacts + Dw A000 + 0000; 4.000 SFDF DAL A002 + C00 + 44008 4800 © Scanned with OKEN Scanner Vaifpeation + Sepals + Are 4a13 4 BX=1924H % Ax —— > 4Al3 Bx —> 1834 —__—_ An —s AF DF Ax —> C100 cO!O 600! Ol) Bx 000! 6010 coll o100 To wii yior uttl Ax —? Co A ~ Beo0wd =O a & BD £ outputs Aw 2 QePP an cx: 400 + © Scanned with OKEN Scanner Department of Electronics PROGRAM TABLE: Program starts at Communication Engineering sprocessors and Microcontrollers Lab (starting offset address) memory location. Memory | Machine/ : ‘Comments Address | Hex Codes | yahet Se Opcode } Operand ; labo acco | BX wo trv | Ax, ood eal oan 5a pornket +0 2100 2003 |pE OA) mov | STAI0O| memcty Jecaton. sGet 8 numa nto A06 | 8B or mo [ASC veumulater Eee ane | op 4 Dncrement SP hy ene 200! P aod | AG lane | op 5, Tnexement” SP by one a0ok | Sp Pe mov | ex tei)’ Move Aecond number 3 Tinto BX -tagistes. i Gubtrect ftoco Nurde\ a00c |38 3 SOB | AY PX od the aetute & in AX ecot: P32 © mov | e400 L Mov doto BL agi ste 4 jTurnp % dpettied (abd doo | O- Ine | A) chase ig no aos a f ae sotherustic “nearent sce | FE a OL Fagilos L ite Tnstitute of Technology (Autonomous) Dakamarr, Visakfapatnam 4 © Scanned with OKEN Scanner Department of Electronics & Communication Engineering ‘Microprocessors and Microcontroflers La6 : 3 bP pointed to 400 mend aclly ler cdo} 4) | mov | pt cco Sy Locofion- 3 Ctote Re AasilE tn mem| aol |S} OS” Wov ce, fax] ey Jocofien pointe boy vy 3 Document vr lag teoo Aaolq SiGoe Ap | Pero2 5 Ste the Sault fn do1p | && ID Mov | (J, BL mamosy daation péaintidk | On. je a Aoftzvase, ‘entexsp| aor ae INT | 02 whith tells re Process| rot to end +he progiamn. RESULT: The omutibye cAubsbraction between two numbus : . . tiotnan KEE. is perfdrmed lay wsrg ESN 86/36 aMioieps cass © Scanned with OKEN Scanner EXP’ 2(a); MULTI BYTE MULTIPLICATION AIM: To write an Assembly language program fo perform multiplication of two words using ESA 86/88 Microprocessor Trainer Ki. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV 3. KEYBOARD ALGORITHM: 1.Get Ist operand from memory that is pointed by source index [SI] register and store it in AX register. 2.Get 2nd operand from memory and store it in BX register. 3.Multiply contents of AX and BX registers and the result will be in AX&DX registers. 4.Store the result in memory location pointed by DI. PROGRAM: MOV AX,0000 MOV Dx,0000 MOV 81,2100 Mov DI,2200 MOV AX, [SI] INC sl INC sl MOV BX, [SI] MUL BX MOV (pq, AX INC DI INC DI MOV (DI, DX INT 03 © Scanned with OKEN Scanner Fpl! Sh) a100 Poo 0000: A100 0004 slow Sh 0000" sibs. 0007 Eqeeuthon: «G 5000 +! Dic plays Ktahu of all ougstias Ax = 003) BX = 0007 BX 5 O45e Dx = 0000 Sp = O100 BP = 02PA SL = F102 pl - 5902 Bs = 0C0O 8S = 0000 &E& = C000 CS = 0000 Tp = Sola FL cs F002 Out pubs? “DN 2200 bb00? 2200 0041 DI ad0d a 000072802 0000 © Scanned with OKEN Scanner &X = OoOOF 44 2x - 00 Decimal - Aa AX ——_ a4 Hexadecimal + 314 4 + a orl ix oils oll) Olle O1iixx 0 0 OOXX Xx Oo 1 10001 ae a 3 \ Outples a Ar= OOZIH CX = 0000 © Scanned with OKEN Scanner Department of Electronics SL Lommuracarion wenyincer sy a PROGRAM TABLE: Program starts at (starting offset address) memory location. Memory Machine/ Mnemonics Comments Address | Hex Codes Label Opcode | Operand elena Seco |88 woo mov | Ax0000] ° Cleasiivng Re accurulotay 5 Cleasiing px steqistesy "5002 | IBA 00 CO mov |19x, 0000} coe, |pe 09) ere ee | antaece 0 D100 see | , remaiy Jocation: 2 mov | 93,2200) 5 OF pcimted to A400 cow a , mmemdcy location. 5 Get 4% number into 8 Mov jax, [st ae ail , 4 accummulaber, 50e INe at 3 Incsement <1 by ome: 51 tC Sur |46 ONC or 5 In@emente <2 by Ore | 3 Mov Accord number, ov ‘st S10 | BB IC ™ BCS] tty ax agit, soa «| FB mut| ex - Muléiply “200 mums ark Soult & inthe AX Mov @) ax 5 Sebo the Asse in memoy 54 |8) OF IM | Socaction on pointe a by pt, Raghe Testitute of Tecnokgy (Autonomous) Dagmar, VisaRfapatnam 7 © Scanned with OKEN Scanner Department of Electronics Communication Engineering eS Microprocessors and Microcontrollers Lab 5 Tmeement DE by tire Solb | 44 tNe 2 - Tacrement DL hy one Sort | INC ol Stoic the Asal im mem sue | 8415 mov | {0% |. ay texation poked by OL. 5 Ft is & Kotfeoasie nb aaupe ‘ow | INT | 03 — [eoWich tells the protesscd to end the progiem. RESULT: Te mul hy emultiplteation — leckwean foo Numbes cs Pesfmecl by ead Esa &/% rAi@op 10cssot bates Ait: © Scanned with OKEN Scanner EXPT- 2(b): MULTI BYTE DIVISION ‘AIM: To write an Assembly language program to perform division of 16-biv/8-bit using ESA 86/6 Microprocessor Trainer Kit. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV 3, KEYBOARD ALGORITHM: 1. Get 1* operand from memory, which is pointed by source index SI register and store it in AX register. 2. Get 2 operand from memory and store it in BL register. 3. Divide contents of AX with BL register and the results will be in AX register. 4, Store the result in memory location pointed by DI. PROGRAM: MOV AX,0000 MOV $1,2100 MOV DI,2200 MOV AX, [SI] INC st INC sI MOV BL, [SI] DIV BL MOV [DI], AX INT 03 © Scanned with OKEN Scanner AX = 000A cx = FFA sp = 0100 St 2 3al0e BS = 0000 ES=0000 phe vote Oukputs: -DW dO 00007 d&CO s Atabu & all stegistens Bx = 000c Dx = 0000 Bp = 3305 DI = 2200 S$ = 0006 C& = 0000 FL= F043 = 0608 © Scanned with OKEN Scanner Bus OCH a iY £ 1100) Goo! Hoo (00016 coool Ca —— Guobert (ard 0000 # ——Pemindr (aH) ones ° output? AX = COOLH. © Scanned with OKEN Scanner Program starts at (starting offset address) memory location. Memory | Machine’ Mnemonics Comments Address | Hex Codes | papel Opcode | Operand 5 leasing Aceumulaker OO | RL 00 CO mov | A%, 2000 5 SE pointed to A100 Qo03 |BE Cod Mov |ST,aloo remedy Bocation. 90 5 DL pointe “te 8800 : 03,3200 ; 2006 | PP ooo Mov | 0% memaig Location. sGet- asF ‘ 2009 | 88 oF roy] sy (en}] 7O6E 2 memes Ute Accumake pee rue | $2 5 Imecement si hy one acoc | Ab gnc | ex |Pomaement Et Basoptroare entear aos | CC INT | 03 -upt cohich bells the yrous ; Sk 1 end the psogram- Raghu Institute of Technology (Autonomous), Dakamarn, Visakfiapatnam 20 © Scanned with OKEN Scanner Department of Electronics «L Communication Engineering ‘Microprocessors and Microcontrollers Lab EE RESULT: The orm teloy te vison lbectween te00 numbers & Pefpimedt hy wimg ESA s6/fF onicacprcassch, bainer Kit @ scanned with OKEN Scanner Vepariment uy Ewe EXPT- 3(a): SUM OF SQUARES OF N NUMBERS |AIM: To write an Assembly language program to find out the squares of 8-bit n-numbers using ESA 86/88 Microprocessor Trainer Kit. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV 3. KEYBOARD . ALGORITHM: L. Store SOOOH to ST and Load the count of numbers in CL register and set register BL t0 00. 2. Load first number from offset (i.e 5000) to register AL. 3. Multiply the value in register AL by itself. 4, Add the data of AL and BL registers and then move the data from AL register to BL register. Increase the value of SI by 1. Store the result (value of register AL ) to memory offset SI Jump to Label L1 tll register CX gets 0. Store 7000H to DI and move the data of BL register into DI offset. ema PROGRAM: MOV SI, 5000 MOV CL, 04 MOY BL, 00 L :MOVAL, [SI] MUL AL ADD AL, BL MOV BL, AL INC SI LOOP L1; Jump to Label L1, If CX!=0 and CX=CX-1 MOV DI, 7000 MOV (DI), BL INT 03 © Scanned with OKEN Scanner sco! -! 00005001 - 6002 sSW S008 =! 60007 5b68 - 0003 D splays Abate of all sugrelens AX = OOIE Bx = cole CX = 0000 DX = 0000 Sp +0100 RP = COCO ST = 5004 OJ = 4000 PS =UC0O &$ - COCO ES > 0000 “CK = COCO IP = 2014 FL> fF002. Output * DA F000 00CO! 4000 OIE © Scanned with OKEN Scanner Ln puli s $1 5 5000 Soo! 5002 5003 ] 1 Poof ol Ow o% oH Lod + (02 Ye (02) + (oey = (20),., : OOD). output Bes IEH. © Scanned with OKEN Scanner PROGRAM TABLE: Program starts at (starting offset address) memory location. Memory | Machine/ Comments Address | lex Codes | paper |} Opcode | Operand 382 poimted fo S00 2000 | BE 050 Mov | $3) 5000) mnchy tocation: shoad com to ce Aeqistes| 2003 | Roy mov | ce ,04 3 Move co to BL Register Boos |R2 co Mov | BL,0O 5 hoad {Gest nembevy 200} [gh OF | AL | Mov [AL,LST)] sor opfact “te Regi SE AL SMU pl. tee mums coy |Fb ED Mbue | Ac ana the Acsult %S to AL Aegister- 4 Badd feo Humbts and 8008 [02 C3 App [AL BL |the Acsutt 6 “un the AC pstes Move the data ftom AL aoop | SA be Mov | Be, ar | seqrster “to BL Aegis > Imuement so by one aoor | 46 INC st Dump to leet U1, Th ex= doo | EX FS Aoop | AL | o amd exeex-! 7 PD poimted to Acoo a0ja | BF 60 Fo Mov | 21,7000) . omomesy Jocation- —_—_—_—_————— "Rashu Institute of Technology (Autonomous), Dakamamt, Visakfapatnam 23 © Scanned with OKEN Scanner Department of Electronics & Communication Engineering Microprocessors and Microcontrollers Lab 1 Cee the wesalt aols | Ss ww Mov | (pT), BL] memety tecation poimbect boy DF sTt Ga Aopteoane tovtlectayt es : oa AOIF | ce ant | 03 — |eohich betlt the psoas Ho end the progam. RESULT: The hum oh Sayraser Nemambery i Perfpimect log sing Esp 2s ri Creprocess Troknes kit. © Scanned with OKEN Scanner AIM: To write an Assembly language program to find ou EXPT- 3(b): UM OF CUB! 86/88 Microprocessor Trainer Kit. APPARATUS: 1, ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-5SV 3. KEYBOARD ALGORITHM: 'S OF N NUMBERS tthe cubes of 8-bit n-numbers using ESA 1. Store 5000H to SI and Load the count of numbers in CL register and set register BL, DL to 00. won . Multiply the value in register AL by itself. . Multiply the value in DL register with AL register. register. 6. Increase the value of SIby 1. 7. Jump to Label L1 till register CX gets 0. 8, Store 7000H to DI and store the result value of BL register to DI offset. PROGRAM: Li MOV SI, 5000 MOV CL, 04 MOV BL, 00 MOV DL, 00 : MOV AL, [SI] MOV DL, [SI] MUL AL MUL DL ADD AL, BL MOV BL, AL INC SI af Torlinolnay (Autonomous), Dakamami . Visakhavatnam . Load first number from offset (i.e 5000) to register AL and DL. . Add the data of AL and BL registers and then move the data from AL register to BL 25 © Scanned with OKEN Scanner 0000: 500 ~ ! 500 0000: 5002 +S 5003 = 0000! 500% - +G do00 +t Display ufotus of all AX = 1608 £x = 0000 Sp 2 0100 $1 2 5004 Ds = 0000 ES = C000 Ip = 401d butput? DUAL 4000 0000”, 4000 ) a -05 06 at 16c8 ougstus Bx = 00Ce DK = 000§ Be > 0000 DL = 4000 Ss = 0000 cs 2 0©COO ve = Foor © Scanned with OKEN Scanner Tope * SI S000 500! 5002 i f 1 of 04 oS (oa) + (ow ye (os)” ne (oy 7 te] 9%32 IG 264 > 6 Ie aa se (6 ——__ Output + RL=CRH ($632),, = (see), © Scanned with OKEN Scanner LOOP LI; Jump to Label LI, If CX’ Department MOV DI, 7000 MOV [DI], BL INT 03 PROGRAM TABLE: Program starts at Aeetronics L Communication Engineering Microprocessors and Microcort iyi! (starting offset address) memory location. Memory | Machine! ent ‘Comments Address | Hex Codes | pabel Opeode | Operand 3S1 pointed ‘to 5000 Qoco | RE tO” Miov | $1,500) onemoiy Woca hon 5 Zoacl og tcl seqrstar Qaco% | BI OF Pov | CL, O4¢ 5 Move co to Bu Aegistay acos |23 0 Mov |BL,0O , A004 | BA CO mov | pL,00 |” mov 00 to BL Aegis 6% + Load -fisse offack +o 009 | sa o% | al | mov jac cst) _ oe load 4frse m 008 | 8A + mov | 04 C829] ‘4.0m aie Page ae PL. J Male ply eo numbers 32000 | Pb EO mor | AC lana -the vuesule & im the AC egistin. ;Mutiply troo ard door |e & Mot | OL ee aa Aogs sos © Scanned with OKEN Scanner Department of Electronics &L Communication Engineering Microprocessors and Microcontrollers Lab 3 PAA two num | ao} | or c3 app |-Ac, BL | the | ech SR S Mave the data tom Ac| aoe {SA oe Mov | QL, AL | sxqisie ep BL Segist > Imeserrent AT oy ore. S015 | 46 INe | ¢2 dyerep to label WU S06 | Er FI dcop | 14 Cx120 amd exsex-I 3 D1 pointe +o F000 Sols [PF CO4D Mov | pT,7000 memeiy Location. State the Resale tm men] aon | ID Mov | [19 BL|-ciy Location Poimbed Joy DT. _ 5 Tt & a Anproate inteuupt] AOID | ce INT | 6% ushich Cells the procs} to end the progiam. RESULT: The Aum pf cubs of m-numbux is pestermect boy sing ESA uabich © a: tRe rite do end the Progiaum: RESULT: C000 $1: 8006 1 = 2000 Ds = 0000 $$ 2 0000 —e = 0000 CS = 6000 1P > Bold fl = FOG oufpub s Dr ooo, a00¢ 6000: 3000 - obbo OOO! CLO Obb2 aLb4. © Scanned with OKEN Scanner Witt 2002 2004 Ax = 2000 00o 4 0003 0002 000! 0000 * — 0003 0004 0002. O00! 0000 — wact a0 -! Coos —-OHO2.-- «OOOOH! 000 ca > 0002 002000 0004 60 eae 0003. «0062 OOO! 0000 o00y ep03 0002 O00! 0000 0004 _— cco 0003 000! 0000 ©0004 | , ; tea ation -L 0002. 000! 900% = 0000 0004 —— Besa OCONEE OOOO Mae Clo Rms ctor 000) ©0006 0003 0004 — 000! 0002 C000 0063 0004 Bteation-3 ae 000! 0006 0002 = 004 6001 0000 C02 000% ocoy > Z Iteration - 4 0000 000! 9©Or ©00% e004 ouskpat: ”x* peo O00! C002 0002 000%. © Scanned with OKEN Scanner i nd Microcontrollers Lab iment of Electronics &L Communication Engineering Microprocessors and Mit PROGRAM TABLE: Program starts at (starting offset address) memory location. : ts Memory | Machine! Mnemonics Comm Address | Hex Codes | papel Opcode | Operand JDK i loaded with e009 3000 | BA65cO mov | 0x,ccoT y Transfer Content ob 3003 | 3B ca Ay | mov | C%DX | px into sugps ie . S82 povimted by 2000 3005 |e oo 40) mov | &2,a000) rremoty Aocatom: [2 Get ASU number imto aooe [8804 | 2a | mov | AL (J) accumulator sCompate Content 6 AX 200A | 3B 44 a2 CMP | Ax, [siJao] and content 06 Leation (sos. S Jump b lahl @ &6 3000 | 4c oF se | AB x20. JEachange the coments Boor [84 Ae py xCHG [Ax,Csio2] 6 ax Location (sil . O22. - 2 Bchenge the Corten& 301g |8+Or KOU | Ax,(53] | eg px and tocakion prin ated bow [sx). 51 tb imcomented by -two. Spry [sree or09, 23 | APP | ST,0% a Sump to lalect @ tp og [Fa EF oop | A® XK} sdand Ck = ox-) © Scanned with OKEN Scanner Department of Electronics & Communication Engineering Microprocessors and Microcontrollers Lab —————————eE————————— eee 31DX & dewoumented by 2014 AA pec DX one sJump to Calecl 21 Sf 3018 FS €6 UN | dy OX), =0 33 ha hoptrocae Srbeagudt S01D ee INT 028 tds procrcer to enol te] PRogiam, + RESULT: “The Asconding Bde of a Gren aAbdong boy atemlly Lomquoge. Peopierming. On ESA t/q MILCLEPrOCL Les halvus, ft & petoimed and Veritieds @ scanned with OKEN Scanner EXPT - 6(b): SORTING: DESCENDING ORDER AIM: To write an Assembly language program to perform the Descending order of a given string using ESA 86/88 Microprocessor Trainer kit. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV 3. KEYBOARD ALGORITHM: 1. Load DX register with a length of array and move it to the CX register. . Store 2000 as SI offset address. . Get 1* number from memory to AX register. 3 4. Compare AX register contents with the contents of next memory location, w . Check for no carry condition if there is a carry, exchange the contents of AX register and [SI] 02 memory location. |. If there is no carry, increment SI by two times to get next number. . Decrement counter If counter is not zero go to step 4, else continue wenn . Decrement the contents of CX, if CX is not zero go to step 3, else continue. PROGRAM: MOV DX, 0005 : MOV CX, DX MOV SI,2000 L2: MOV AX, [ST] CMP AX, [S1]02 INLL3 XCHG AX, [S1]02 XCHG AX, [SI] L3: ADD SI,02 LOOP L2 DEC DX Li Ragin Institute of Technology (Autonomous), Dakgma 36 © Scanned with OKEN Scanner opts sia) BUD 0000; 2000 - +S SOD C000" 2003 -Shl 2004 _ o000: 2604-0003 ssi) a006 + ovoo: 2006 — 0004 Sil QOS oogDs aco’ ~ 0005 Epeerhon* »6 “4000 + Dicploys toh ef of! sugistonst AX = 0OOS Px =0000 cx = 00CO DX = 0006 SP + O100 Pp = 0CCO $2 = 3008 PI = 00CO bs = 0000 38 > OOOO ES = o0CO «$= 0000 Ip = 501D Fes FOG output: Dl 000 ,d008 o 0000 + 2000 00S ac0% Co032 e602 woo! © Scanned with OKEN Scanner Verificatar AX Lvo 1 1 1 1 7 000! O00 0003, oan Q00* — 0002 000! 003 = 0094 =~ G008 é 6002 = 0003. 000! O00 0005 Tteston-} — ©6002 6002 600% 6601 00S os 2002 0003 600% 6005 C00) 0002 6003 0004 0605 600! — C0003 6002 600% CO0S 4600)! 7 Therction-d o0bv03 coo4u coor C008 000) > ©0002 C004 OLOsS 0002 0002 C064 OOO 0002 000} e— 0004 =—0003.- O00S 0002 CCD! ( ateaton-S —- 0004 coos 0003 e002 = 00) 0002 = =00!} e004 =§=—0008 = 6003 Bee 2002 cops 0004 = 00% Sukput Ax: ©0005 ©0904 0003 0002 OOd!. © Scanned with OKEN Scanner swepartment yy “ce JNZLI1 INT 03 PROGRAM TABLE: Program starts at (starting offset address) memory location. Memory | Machine/ Comments Address | Hex Codes | y abet Mnemonics Opcode | Operand Ox & leaded wht Aono | BK 0500 mov |bx,0005] 00s. 5 Toanster the Content 4003 | KR CA 4} Mov | cx,DX leg ox into eq SCL - 3 pantecl 0 2000 Aoos |®E & a Mov | $7, 8000 | enamedy doeation. SQ@et 186 number ‘nto A008 | SB OF 4a. | MON | ax Pst] | accomeletck jtompere Content a 400A | 20 44 0a emp | ax,{ctJod Ax ard content ef toca -ton [sTo2. Sgump to label 2, tb Awop |4P 5 JNO B CAY = Lond Cx=ex-) 3 Eachange ube Content Aooe [84 44 0a] XCHG JAX, (813024 of Ax anol Locatiun poor} ated by [ea joa. SEnchange ute conten aota | SF OF XCHE | A, C9)] of tagrstin AX and Locot| in _primted by (s2). 2 SE ib \mteenented by -to0 . Api |S! 660200) AS App | St,0a © Scanned with OKEN Scanner Microprocessors and Microcontrollers Lab Department of Electronics L Communication ‘Engineering _ 3 Jump to leleel b>, St Avie | E& CE AooP} tx CX!=0 and Cxscx-) )DX ch decremented by 4OIA | 4A Dec | PX one Sgump to label Ln tf 4o1B | aS EG JINZ AI PK! =O Be & & Sefbacse inter AO 1D ec INT 03 rAupl tells Prowrsot to end Pe pLogsam, RESULT: The Deseending Oacda of o qe toing by assembly Language programming en ESA 86/%¥_ aMioepsocexdol tvoimer Kit ce pafrmect amd Verified © Scanned with OKEN Scanner Department of Electronics &L Communication Engineering Microprocessors and Mic EXPT — 7(a) STRING OPERATIONS - MOVE A BLOCK AIM: To write an Assembly language program to move string of bytes from one location to the other location in thememory using ESA 86/88 Microprocessor Trainer Kit. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV 3. KEYBOARD ALGORITHM: 1. Make SIas a pointer to the source block. 2. Make DI as a pointer to the destination block. 3. Store the number of bytes to transfer from one block to another block in CX. 4, Using MOVSB transfer byte from one location to another location. 5. Repeat Step 4, till the count of times in CX. PROGRAM: MOV SI, 2100 MOV DI, 2200 MOV CX, 000A CLD REP MOVSB INT 03 ee © Scanned with OKEN Scanner apt 1S A100 BOO; AID 42 “6 ator O00! BIOY OG 6§ Alb2 000: D162 of +S S102 ovoo: A102 oS A0§ copo: aot = OF +S BOT 0000: AOS 0% +S alUG opw: 9106 04 +§ at04 0000. S1I0T OA & aloe 0000: 910% OB +S 3104 0v00; 9104 0 Suelo -G %00 +! Dicplaus srolin Of a Angela, AK 2 OOF Bx = COO eX = 0000 10x 70000 © Scanned with OKEN Scanner Sp: VI100 BP= 0000 St: AlOA DI - 290k 0% = 0000 S$ = 0000 ts = 0000 cg = 0000 ap = 800c FL + F002 Oukpuls: “Dp 2200, I20A 6000: 2900 290A Ak 0% 04 05 06 OF Of OF DA OB OC © Scanned with OKEN Scanner jcroprocessors and Microcontrollers Lab Department of Electronics L Communication Engineering PROGRAM TABLE: Program starts at (starting offset address) memory location. Memory | Machine/ Mnemonics ‘Comments Address | Hex Codes | pabet Opeode | Operand 262 poimted hy 100 BccO | BE cody Mov ] £12100 | mrernesy Location j pr poimtedt ay 2200 Boo |BP 00 2a Mov | 27,2200) mumdy lecaban 5 doad tooA en cx 2006 |B9 0A CO Mov. | CX, 0004 ; ¢ agp ster eth Cont 3 Clea, clivection 3009 | Fr cu cater 9 5 Moves Re Sti x cena | F® ‘ a) BCOA REP Locetio +0 ng te ES SImucasks: st location ard 200B | AG MovsB OF Location & sepeats this loop until_ =O jit & oe 4ofboae ‘mtesrsupt| ce goo; | c INT 03 which tells the proces to tnd the psogiarn, RESULT: The Sting Opactions ove Block & Pertgimed and Veifed by rising ESA 86) 86 reiieaPsocessAL tains ib © Scanned with OKEN Scanner Department of Electronics SL Communication Sngineering ticroprocessors and Microcontrollers Lab TRING OPERATIONS ~ REVERSAL OF A STRING EXPT - 7(b): S ‘AIM: To write an Assembly language program to obtain the reverse ofa given string Using ESA 86/88 Microprocessor Trainer Kit. APPARATUS: 1. ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-5V 3. KEYBOARD ALGORITHM: 1. Load CX register with the count, SI with 2100 and DI with 2209 memory location. 2, Clear the direction flag, get data using SIto AL. 3, Set direction flag and store AL content into a location pointed out by DI. 4. Decrement the count and check for zero condition. If it is not zero go to step 2, else continue. PROGRAM: MOV CX, 000A MOV _ SI, 2100 MOV DI, 2209 L1:CLD LODSB sTD STOSB LOOP LI INT 03 © Scanned with OKEN Scanner pats: +8 AN00 O00: A100 oF -S alo! ob: 910} 02 +S aor OCCO'aI02 04 + Alod 0000: 2103 OA +S B04 ovo: atoy = OB +S BOS 0000: aS = Ot +S 2106 0000: 3106 OD +f alOF 000! 9107 OE +S DOS open: aOR OF ~$ OF boo: a0 10 Execution: +G 4000 —! Displays the Alatus a all Aegpstins AX = 0000 x5 0000 (x = 0000 Dx =0060 © Scanned with OKEN Scanner S&P = 0100 RP = 0000 41 = 310A DI + 9Aled DS = 0000 £& =0000 Es =0000 cs p000O Tp =SdOP PL = Foo yep sD 2809, dadID at 0000: 2904, DIA ‘oO oF o& ob of OB oA 104 O82 OF © Scanned with OKEN Scanner Department of Electronics ol Communication Engineer a _ PROGRAM TABI ing offset address) memory location. Program starts at (star Memory | Machine/ en Comments Address | Hex Codes | janet Opcode | Operand 4000 5 Load the Counter ity PAon oo Mov | %,0@0A| BX Regs 5ST poimted by 100 Aoos E ca Yo03 JRE co al Mov | 81,2100 omemeasy Aecation 5 DI poimtect by 9904 Ao BF 07 aa “1 “6 WV] 2.2707) srernccy Locectior A009 | Fe 4) | eco » Clear, the dinection opp sgetr the data weing- Aooa | AE ODS q eng st AL. 5 Sek dinection tag 5 Aoop, | FD STD 3 Store ARe aL cata ben) oc | AA STOSB Ae AL te D7. j Decrement dhe Coun Ee Avop | FA cop | 4) “hetk JX Zero Condi bin ie no pero jump lo the Label ah PU & a tojhoate nteraupe 4ooF | ce INT 02 which urells ect o the PRoquasm. RESULT: ard Nesified — by aUsin Raghu Institute of Technology (Autonomous), Dakamarn, Visakhapatnam LOO Cs 0000 Bos Fo4e © Scanned with OKEN Scanner Query | .D a2a00 +t OBO + 2 200 06. © Scanned with OKEN Scanner ‘Microprocessors and Microcontrollers Lab Department of Electronics & Communication Engineering PROGRAM TABLE: Program starts at (starting offset address) memory location. Memory | Machine/ F ‘Comments Address_| Hex Codes | y aber —— Opcode | Operand 3 Clean cx Ragistr with Ao0cD | BA 00.00 Mov | CX, 060) coe. 32 poimbecl by aloo 2003 | BE 00 24: Mov | sT, alco ety docation. 5 Clean “Be accurate Qooe |BE CO Mov | Ax, 0000. 5 Ged Content to AL 2009 | Ac Al | AopsB aegis & jreaemeent $2 mumo\y docation by ons. Compare AL contents 00% | 3c CO emp | ALCO | Lith oo. + chede th ual Condi bie avoc | 74 03 ve Aa ip ae content aie equals dummy FD Spectffeck label C2 > Tnercrment % agp ste: ace | 4) Inc | & 3 yurnp to dhe Specified avor | 68 FR op | 4 (oct Ls 5 DD pointed by 2800 Bot! | BF co 2a} 4a | MOV | PT, 2200 roma location 3 Gtotle Ue Resulf “in the acy | 4 00 wow | (sel,ca memdy Secation of PL —_—_— ‘Raghu Institute of Technology (Autonomous), Dakamarn, Visakfiapatnam “4 © Scanned with OKEN Scanner Department of Electronics &L Communication Engineering Microprocessors and Microcontrollers Lab Bole cc INT 03 1Pt Ka Agptunte mbes eh tells poutiel “TO enc Hie psogsam. RESULT: The ting Operation oleng th fa Boing & pafermed amd Vested by using ESA {6/88 miowpsecersot hair Hit © Scanned with OKEN Scanner Microprocessors and Microcontrollers Lab Department of Electronics & Communication EXPT —7(d): INSERTION OF A SUBSTRING INTO MAIN S RING AIM: To write an Assembly language program to insert a sub string in to main string using ESA 86/88 Microprocessor Trainer Kit. APPARATUS: 1, ESA 86/88 MICROPROCESSOR TRAINER KIT 2. ADAPTOR-SV. 3. KEYBOARD ALGORITHM: 1. Make SI as pointer to 3003 memory location . Make DI as pointer to 3006 memory location. . Load CX with 0003 and clear the direction flag. . Repeat the loop until CX is not zero. . Move a byte from SI to DI and increment SI & DI memory locations . Make SI as pointer to 4000 and DI as pointer to 3003 memory locations. Load CX register with 0003 and clear direction flag. . Repeats the loop until CX is not zero. eer awaywn Moves the substring from SI to DI and increment SI & DI memory locations. PROGRAM: MOV SI, 3003 MOV DI, 3006 MOV CX, 0003 cLD REPE MOVSB MOV SI, 4000 MOV DI,3003 MOV —CX,0003 cLD © Scanned with OKEN Scanner 006: 2000 06 -$ 300! 6000 *. 200] os oS 3002 bobo: 3002 Oy +S %002 dopo. %b% OB +S Bop obco: 2004 OL +3 3005 pO0O: 2c65— Ol +f boo ev00:4000 OA eS Guo] L000. 4001 «OB -S Goor po00. 4002 Oe Encauly or 6 000 w+ Deplays Stott Of atl Aeprelin, AX = 0020 Bx= OW tx = 0006 DX =0000 SP = 0100 BP = 0000 © Scanned with OKEN Scanner &T = 3003 DI = 2006 bs = 0000 “$6 50000 ex = O0000 *CS 50000 Tp + ole PL > FOOL outpld: _ =p 3000 , 2008 0000: 2000,3008 0 O65 oF OA OB OC 03 O2 OO] © Scanned with OKEN Scanner tment of Electronics Communication Engineering Cape REPE MOVSB INT 03 PROGRAM TABLE: Microprocessors and Microcontrollers Lab Program starts at (starting offset address) memory location. Memory | Machine/ Mnemonics (Comunenté Address | Hex Codes | p abet Opcode | Operand 5 SE poimte oy 3003 2000 | GE 0% 0) Mov | $3, 3003 marche Seca Bony 5 2 poimted ny 3006 2003 | BF 06 30 Mov | D2, 8004 memey Location. lead cx sugister with 2006 |87 03 00 How | ¢x,2003) “coos 3 Clear dinection leg acy fe cup 3 Repeat the Soop until acon | £3 (hie x jy Mot Bho 3 Move a byG fem SI to pt acog | Ay MovsB ard femoxement SF & PT mer nay locations: 5 S83 poimbed Yay 4-000 A0E | BE CO 40) Mow | SI,4000 a ete PPL pointed ey 3003 BOE |BF 0% 30 etl herconaee remedy docation. 2 lead Cx register ust 201k [8403 00 Mov | Cx,0008) gas “ Be —————————— Raghu Institute of Technology (Autonomous), Dakamarn, Visakhapatnam a7 © Scanned with OKEN Scanner Department of Electronics & Communication Engineering Microprocessors and Microcontrollers Lab ) "Clear alisection plea, als Fe euD beg eon 5 Repeats the sloop antl F3 REPE Pe eigie: 3 Mower the substring (A0m| aolt | Ky MovsB st top7 and increment SP Sor -memay focation- pT Ba-sobbuare Enbeasupl 201g cc “INT O38 wshich tel che processet| to end We psogiam RESULT: The insertion of 2 Sulestating ferto main string & Perpermed ley wing E8A Me/ae micoprocersot baines Kib- © Scanned with OKEN Scanner

You might also like