Home

Program - Pantech Solutions

image

Contents

1. 8251 Uart I O Address SOCKET NO FUNCTION ADDRESS CONNECTOR NO 8251 CONTL FF10 U15 REG FF12 D2 SKT 8251 DATA 5 LCD Interface LOD D LCD Ed 10K 2 QUUD Ug zu ey wo g g ER JO J o J 4 N a DOO O00 1 16 216100 Device used 16 x 2 20 x 4 LCD module System Mapping I O mapped 1 0 SOCKET NO FUNCTION ADDRESS CONNECTOR NO LCD COMMAND FF40 LCD DATA 42 6 RESET This key is located the main 8086 board depressing this key the program starts executing from the beginning or reset address 0000 On power on reset it Display PS 86 in local LCD display 2 3 POWER SUPPLY DETAILS PS trainer kit will work at O 5v 1 amp from the PS power supply Provision is made in PS power supply to bring out on the front panel DC regulated voltage output for interfacing with add on cards 5V 1 amp a Supply Turned OFF wan Supply Turned ON POWER SWITCH 2 4 KEYBOARD DETAILS 101 PC type keyboard is interfaced to Microcontroller through its port pin Communication between keyboard and Microcontroller takes place using 2 wires one for serial clock and serial data P1 6 and P1 7 CHAPTER 3 COMMANDS AND KEYS 3 1 Reset This key is located in the
2. YES Store the result into Memory ALGORITHM 1 Initialize the pointer to the memory where data to be transformed 2 Load the AL register with the data from memory 3 Initialize destination pointer to the memory where data to stored 4 Store data from AL register INPUT e Input data from address 1500 which is pointed Sl transferred to the desired Location e Number of byte in CL Output e Output data in address 1550 is the moved data PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 B1 08 MOV CL 08 Load 08 value into CL 1102 00 14 MOVSI 1500 Load 1500 into SI 1105 50 14 MOV DI 1550 Load 1550 into DI 1108 AC LODSB Load the data in AL Register 1109 88 05 MOV DI AL Store the result in specified Location 110B 47 INC DI Increment the pointer 110C FE C9 DEC CL Decrement the pointer 110E 75 F8 JNZ 1108 Loop continues until the counter is zero 1110 CC INT 3 Break point 6 6 SEARCHING A BYTE Flow Chart Initialize the memory pointer CL Count DL search byte Load the data into AL register Store searched byte amp location Algorithm 1 Initialize the pointer to the memory for storing data and result 2 Load DL with search byte 3 Load CL with count 4 Load AL with data from memory Compare AL with DL if its equal store the result else decrement counts go to step2 5 Store the re
3. J R MANYA SAHNIGA onl Amen asti zd Mess PS 8086 Trainer Kit MICRO CONTROLLER BOARDS US Contents CHAPTER 1 INTRODUTCTION 2 nnn nnn nun ununi 4 1 1 INTRODUCTION va svindvevdeanduGasS eeseeivawducesdedsewiseeds 4 1 2 PS 8086 BOARD 5 1 3 PS 8086 SPECIFICATIONS ccc 6 CHAPTER 2 SYSTEM DESCRIPTION nnn 7 2 1 7 1 20 PIN EXPANSION CONNECTORS 9 The 20 Pin FRC connector is used to interconnect with the Interface cards like ADC DAC SWITCH LED RELAY buzzer Interfaces etc Pin details are given below 9 2 50 PIN EXPANSION CONNECTOR 10 The 50 Pin FRC connector is used to interconnect with the Interface cards like 8255 8279 8253 8251 8259 8257 and the pin details are given below 10 24 KEYBOARD DETAILS ret eis 14 CHAPTER 3 COMMANDS AND 14 NN I 14 9 2 H HELP MENU 14 CHAPTER 4 OPERATING INSTRUCTIONS 15 AE POWER ON 15 2 2 WINS EPC UO 16 1 PROGRAM ENTRY USING ASSEMBLER 16 ENTERING MNEMONICS 16 ENTE
4. 3 4 PAM 6 6 PAS 5 6 PCa 5 6 PC5 7 8 PA07 PA6 7 8 PA7 7 8 PC7 PBO 9 10 g TO PBT g 10 PCO1 PB02 Ti 12 PBOS PB2 Ti 12 PB3 Ti 12 PCOS PB04 T3 T4 PB05 PB4 13 14 PBS 13 14 PCOS 15 16 PB07 PB6 15 16 PB7 15 16 PCO7 17 18 GND 17 18 GND 17 18 GND i He 9 20 GND svi 19 20 GND svd 3 20 PN 20 PIN FRC 20 PIN FRC 20 PIN FRC 2 50 PIN EXPANSION CONNECTOR The 50 Pin FRC connector is used to interconnect with the Interface cards like 8255 8279 8253 8251 8259 8257 and the pin details are given below J7 1 1 2 02 5 6 03 04 7 8 05 06 9 0 D7 A0 2 Al A2 3 4 A3 A4 5 6 A5 A6 7 8 A7 A8 g 20 A9 A10 2 22 A11 A12 23 24 A13 A14 25 26 15 27 28 INTR 3 32 NMI 35 36 RD ALE 39 40 4 42 43 44 CS8 CS9 45 46 CS10 5V 50 GND t HEADER 25X2 3 KEYBOARD CONNECTOR 2 PC7 K B data 4 GND 1 PC6 K B CLK 5 4 9PIN D TYPE FEMALE NC NC CTS TXD NC NC NC GND 8251 Universal Synchronous Asynchronous Receiver Transmitter RS232 Bridge Converter BAUD CLOCK Baud clock for 8251 is programmable provided by Channel 2 of 8253 INPUT CLOCK FOR 8251 3 072 MHz DRIVERS USED MAX 232 is used for transmitting receiving of characters
5. Press the B Cur BAUD 2400 150 ur BAUD 2400 9600 NORMAL Enter the Space Bar Key Enter Key al SET the 9600 baud rate Baud rates 150 300 600 1200 2400 4800 9600 When using the serial Communication 4 10 S Serial Mode Key When this key is depressed the system start communicating through connector All keys are disabled except reset Serial Mode The system displays the message SERIAL MODE To come back to LCD mode Normal Mode user has to press the N key in the computer keyboard otherwise press the Reset button 4 11 Programming The 8086 Trainer Kit PROCEDURE 1 TO ENTER THE MNEMONICS 1 Initially connect the 9V adaptor to J10 connector 2 Switch ON the PS 8086 kit using slide Switch SW1 3 PS 86 will be displayed on the LCD 4 Connect the Keyboard in PS 2 connector 5 Depress A starting address of the program for Ex A1100 For ex A1100 enter key Type the mnemonics MOV AX 1212press Enter key the mnemonics MOV 1212 press Enter key and continue the same procedure till the end of the program ADDRESS OPCODES MNEMONICS 1100 B81212 MOV AX 1212 1103 1212 MOV BX 1212 1106 01 D8 ADD AX BX 1108 BE0012 MOVSI 1200 110B 89 04 MOV SI AX 110D FA HLT 6 To verify the code depress D starting address and depress space bar to see next memory location For Ex D1100 and press
6. 5 PROGRAMMING DETAILS PROGRAMMING 8086 OVERVIEW The 8086 Microprocessor uses a multiplexed 16 bit address and address bus During the first clock of machine cycle the 16 bit address s sent out on address data bus These 16 bit addresses may be latched externally by the address latch enable signals ALE 8086 Microprocessor can access 1024kb of external memory using its 20 bit address and memory read write signals gt The 8086 provide sO 1 and 2 signals for bus control The 8086 Microprocessor has a 16 bit program counter IP and 16 bit stack pointer sp It has following set of 16 bit Registers AX Accumulator CX DX These four register can be used as two 8 bit register individually Index Register 51 Source index DI Destination index pointer index Segment Register CS Code segment register 05 Data segment register ES Extra segment register SS gt Stack segment register FL Flag register Interrupts The 8086 have two interrupt External mask able interrupt INTR gt Non mask able interrupt NMI BREAK POINT DISPLAY IN LOCAL MODE When break point is encountered all the register values are saved and the Acc Value is displayed in the LCD display Now use SPACE key to check register values one by one CHAPTER 6 EXAMPLE PROGRAMS 6 1 Addition Of Two Bytes Of Data FLOW CHART ALGORITHM 1 Initialize the pointer
7. 3 Move the higher nibbles in to lower nibbles position 4 Multiply AL by 10 5 Add lower nibbles 6 Store the result into Memory INPUT Data in AL register OUTPUT Result in AL register PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 BO 10 MOV AL 10 Load register AL with the data 10 1102 88 C4 MOV AH AL Load AL value into AH 1104 80 E4 OF AND AH OF Mask higher bits 1107 88 E3 MOV BL AH Load AH value into BL 1109 24 FO AND AL FO Mask lower bits 110B B1 04 MOV CL 04 Load 04 value into CL 110D D2 C8 ROR AL CL Rotate the data from last 4bits to first 4 bits 110F B7 OA MOV BH 0A Load 10 value into BH 1111 F6 E7 MUL BH Multiply by 10 1113 00 D8 ADD AL BL Add lower nibble to the multiplied data 1115 CC INT3 Break point 6 11 DECIMAL TO ASCII CODE FLOW CHART Load AL register with the input data AL AL 7 Add AL register with 30 Store the result into Memory ALGORITHM 1 Load AL with the input data 2 Check If AL lt 9 then add 30 with AL register 3 Else add 7 with AL register 4 Result stored into AL register INPUT Data in AL register OUTPUT Result in AL register PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 BO OA MOV AL OA Load register AL with the data 10 1102 3C 09 CMP AL 09 If data less than 9 add 30 to the data 1104 74 04 JZ 110A If count is zero then go t
8. 6 14 FIBONACCI SERIES 56 6 15 FACTORIAL OF A NUMBER 58 6 16 FIND THE LARGEST NUMBER IN AN ARRAY 60 6 17 AVERAGE OF AN ARRAYError Bookmark not defined 6 18 GENERATE SQUARE 64 6 19 DESCENDING ORDER ener 65 6 20 68 CHAPTER 1 INTRODUCTION 1 1 INTRODUCTION The PS 8086 board which demonstrates the capabilities of the 40 pin 8086 various families Sample programs are provided to demonstrate the unique features of the supported devices The PS 8086 Kit comes with the following 1 PS 8086 Board 2 Sample devices INTEL 8086 NEC 8086 3 Cross cable RS232 4 CD ROM which contains a Sample programs b PS 8086 Board User manual 5 Keyboard 101 keys Note If you are missing any part of the kit please contact our support executive 1 2 PS 8086 BOARD OVERVIEW Power Supply 20 Pin Header 8255 PPI 50 Pin Bus Header 8086 Reset EEPROM LCD 8251 8253 CPU 27C256 16 2 USART Timer The PS 86A board is based on Intel 8086 Microprocessor which operates at 6 144 MHz using the crystal of 18 432 The board can operate using the 101 104 PC keyboard supplied along with the trainer kit and 2 Line by 16 character LCD display or from the PC using the Terminal Emulation Software Microprocessor s Address D
9. BL Increment BL 110A FE C9 DEC CL Decrement CL 110C 75 F8 JNZ 1106 Loop executes until the desired value of n is reached 110E 00 20 MOV 01 1600 Store the result 1600 1111 89 05 MOV DI AX Load AX value into DI 1113 CC INT3 Break point 6 9 ASCII TO HEX CODE CONVERSION FLOW CHART Load AL with the input data Subtract AL with 30HEX Algorithm 1 Load the input data in AL register 2 Subtract 30 from AL register value 3 data is less than or equal to 16 terminate the program 4 Else subtract 7 from AL register value 5 Result stored in AL register INPUT Data input in AL register OUTPUT Data output in AL register PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 BO 31 MOV AL 31 Get data 31 into AL 1102 2C 30 SUB AL 30 Subtract 30 with the AL 1104 3C 10 CMP AL 10 If data is less than or equal to 16 go to 110C 1106 72 04 JB 110C If 1 operand is below the 2 operand then short jump into 110C 1108 74 02 JZ 110C If count zero then jump into to 110C 110A 2C 07 SUB AL 07 Else subtract 7 from AL register value 110C CC INT Break point 6 10 BCD TO HEXA DECIMAL CONVERSION FLOW CHART Load at with the data mask higher lower bits Multiply by 10 and add lower bits to it Move higher bits into lower bits ALGORITHM 1 Load the data in AL register 2 Separate higher nibbles and in lower nibbles
10. MOV AL FF Load LSB count in the AL 1108 04 MOV DX FF04 Port address in DX 110B EE OUT DX AL Output the AL contents to CLK 2 110C BO 00 MOV AL 00 Load MSB count in the AL 110E BAOAFF MOV DX FF04 Load 4 into DX 1111 EE OUT DX AL Output the AL content to CLK 2 1112 CC INT3 Break point 6 19 DESCENDING ORDER ALGORITHM 1 Get the first data and compare with the second data 2 1 the two data are in descending order then no swap 3 Else swap the data byte by descending order and then again compare the other data bytes up to the count 4 Do the above the array is a ranged in descending order 5 Finally the array is arranged in ascending order INPUT Enter the count in location 9000 Enter the data location starting from 9001 OUTPUT Result in descending order in the location 9001 FLOW CHART starr gt Load the counter with the number of elements in the array Move the data from the memory pointer to a register 1 Increment the memory pointer SI Move the subsequent data to register 2 NO Swap regl amp reg2 Is regl lt reg2 YES Increment the memory pointer Store reg1 data to memory pointer address Increment the memory pointer Decrement the counter in one time NO Can PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 BEO090 MOV SI 9001 Load 9000 into SI 1103 8A OC MOV C
11. in 1501 Lookup Table Start from 1600 The look up table is provided by hex or of two bits in a byte the value ranges from 00 to Of 1600 00 01 03 02 06 07 05 04 Oc Od Of Oe Oa Ob 09 08 Program ADDRE OPCODE MNEMONIC COMMENTS SS S 1100 0012 MOV Load 1200 into BX 1600 1103 BE5011 MOV SI 1500 Load 1500 into SI 1106 AC LODSB Load the accumulator with the data 1107 D7 XLAT Check gray code for that data 1108 BF5111 MOV DI Load 1501 address into DI 1501 110B 88 05 MOV DI AL Store the gray code of the given data 110D CC INT3 Break point 6 8 SUM CONSECUTIVE NUMBERS FLOW CHART Initialize the memory pointer SI Load the data as BL 1 CL count 1 2 1 t n YES Store the result into Memory address 1600 ALGORITHM 1 Load the value of n 2 t n t n 1 t n 2 3 t n 1 2t n 2 1 n n 1 if n gt continue else go to step2 Initialize the pointer to memory for storing the result ou Store result INPUT Load the value of n into CL OUTPUT Result is stored in 1600 PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 B1 04 MOV CL 04 Load CL with value 04 1102 BO 00 MOV AL 00 Initialize 00 value into AL 1104 B3 01 MOV BL 01 Initialize O1 value into BL 1106 00 D8 ADD AL BL Add previous and next value 1108 FE C3 INC
12. main PS 86A board On depressing this key the programs Starts executing from the beginning or reset address 0000 On power on reset it Displays PS 86A in local LCD display 3 2 H HELP MENU This key is used go PS 86A help menu and it will display the following commands FUNCTIONS A lt BEG gt ASSEMBLE B BAUD RATE D lt BEG gt DISASSEMBLE E lt BEG gt lt END gt EXAMINE G lt BEG gt EXECUTE H HELP COMMANDS INSERT INTERNAL RAM L OFFSET DOWN LODE M lt ADDR gt MODIFY N NORMAL MODE Q QUIT R REG REGISTER DISPLAY S SERIAL TRANSFER T BLOCK TRENSFER lt START gt lt END gt lt DS gt U lt BEG gt lt END gt UP LODE X DELETE BLACK MEMORY INSTRUCTIONS CHAPTER 4 OPERATING INSTRUCTIONS 4 1 POWER ON Connect the PS 8051 board to the power having the following specifications 9V DC 1Amp Switch the power supply after ensuring the correct voltages Following message will appear on the LCD display PS 86 On power on or after reset the display shows PS 86 as a sign on message The prompt character is displayed in the next line informing the user that the board is ready to accept the commands 4 2 Instruction 1 PROGRAM ENTRY USING ASSEMBLER ENTERING MNEMONICS Example Press for Enter the starting Address help A1100 Enter Key i User program
13. t n CL count 1 1 Decrement the CL register by one time Store the result into Memory address 2000 ALGORITHM 1 Initialize the pointer to memory for storing result 2 Number of the counts loaded into CL register 3 T n 1 t n t n 1 4 Repeat the above process until count is O INPUT OUTPUT Load number of terms in CL Result in 2000 clear the memory from 2000 by 00 before executing the program PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 B1 10 MOV CL 10 Initialize 10 into CL register 1102 B3 00 MOV BL 00 Initialize 00 into BL register 1104 B2 01 MOV DL 01 Initialize O1 into DL register 1106 BF 00 20 MOV DI 2000 Load 2000 into DI 1109 88 DO MOV AL DL Move DL value into AL 110B 00 D8 ADD AL BL Add BL value with AL register 110D 88 05 MOV DI AL Store AL value into DI 110F 47 INC DI Increment DI 1110 88 D3 MOV BL DL Move DL value BL register 1112 88 C2 MOV DL AL Move AL value DL register 1114 FE C9 DEC CL Decrement CL 1116 75 F3 JNZ110B If count is zero then go to 110B 1118 CC INT3 Breakpoint 6 15 FACTORIAL OF A NUMBER FLOW CHART Initialize the memory pointer SI Load data in BL 1 AL 1 CL count 1 n 1 t n BL BL 1 Decrement the CL register value YES Store the result into Memory address 2000 ALGORITHM 1 Load the counter
14. to the memory for data and result 2 Load the data into AX BX 3 Add the two data of AX and registers 4 Store the result into Memory from AX registers INPUT gt Input data s 2 byte are loaded into Memory address 1500 2 LSB in 1500 MSB in 1501 1 data 3 LSB in 1502 MSB in 1503 2 data Output 1 Result stored in Memory address 1520 2 LSB in 1520 MSB in 1521 Program ADDRESS OPCODE MNEMONICS COMMENTS 1100 00 15 MOV SI Move 1500 into SI pointer 1500 1103 AD LODSW Load the first data into AX 1104 89 C3 MOV Move AX value into BX AX 1106 AD LODSW Load the second data into AX 1107 01 C3 ADD BX AX Add BX and AX registers 1109 BF 20 15 MOV DI Load 1520 address 1520 location into DI 110C 89 1D MOV DI BX Store value into memory 110E 74 HLT HALT 6 2 SUBTRACTION OF TWO BYTES OF DATA FLOW CHART ALGORITHM 1 Initialize the pointer to the memory for data and result 2 Load the two data s into AX BX 3 Subtraction of these two bytes of data 4 Store the result into Memory address 1520 1 Input data s 2 byte are loaded into Memory address 1500 2 LSB 1500 MSB 1501 1 data 3 LSB in 1502 MSB in 1503 2 data OUTPUT 1 Result stored in Memory address 1520 2 LSB in 1520 MSB in 1521 Program ADDRESS OPCODE MNEMONI
15. with value of n into CL register 2 1 2 3 Repeat the process until becomes to store result 4 Initialize the pointer to memory to store result 5 Store the result into Memory address 2000 INPUT Load the value of n into CL register OUTPUT Result stored in Memory address 2000 PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 B1 04 MOV CL 04 Load the value of 04 in CL 1102 BO 01 MOV AL 01 Initialize O1 into AL 1104 B3 01 MOV BL 01 Initialize 01 into BL 1106 F6 E3 MUL BL Multiply previous value by next Value 1108 FE C3 INC BL Increment BL 110A FE C9 DEC CL Decrement CL 110C 75 F8 JNZ 1106 Loop continues until count is Zero 110E 00 20 MOV DI 2000 Load 2000 address into DI 1111 89 05 MOV DI AX Store AX value into DI 1113 CC INT3 Break point 6 16 FIND THE LARGEST NUMBER IN AN ARRAY Move the start address to a memory pointer Initialize the counter with number of elements in array Move the data pointed by the memory to register1 Increment the memory pointer SI Decrement the counter in CL register Compare regl data with data pointed by the memory NO YES Is register1 data greater Store the data NO YES ext 5 ALGORITHM 1 Take the first number of the array 2 Compare with next number 3 Take the bigger one of the them 4 Decrement the count in CL register 5 If the
16. zeros and vice versa It is one way of representing negative numbers All negative numbers start with a 1 at the For instance considering the hex number 5600 For ex 5600 0101 0110 0000 0000 One s complement 1010 1001 1111 1111 EXAMPLE The example given is to find the one s complement of 1234 and store it in memory location 1400 Input Data AX 0001 0010 0011 0100 1234 Result 1400 1110 1101 1100 1011 EDCB MEMORY ADDRESS OPCODE MNEMONICS 1100 C7 CO 34 12 MOVAX 1234 1103 F7 DO NOT AX 1106 89 06 00 14 MOV 1400 AX 110A F4 HLT PROCEDURE i Enter the above mnemonics into RAM memory from 1100 using the assembler command ii Using GO command execute the program and enter 1100 This is the address from where execution of your program Starts iii Press ENTER key to start execution iv Reset the kit using RESET key 4 MASKING OFF BITS SELECTIVELY OBJECTIVE To clear 8 selected bits the 2nd HN and the HN 16 bit number THEORY The logical AND instruction is used for masking off bits The bits which have to be cleared are to be AND with a logical zero and the other bits are to be high Hence to achieve the above objective AND with OFOF EXAMPLE The 16 bit number is at location 1200 and the result is at location 1400 Input 1200 FF 1201 FF Result 1400 OF 1401 OF MEMORY ADDRESS
17. 1100 8 12 12 MOV AX 1212 Enter the Space Bar Key 1103 BB 12 12 MOV AX 1212 Enter the space bar key 4 5 M Modify External Memory Using this command the user can display modify any external memory address Modify External memory Press for Enter the starting Address help M1100 4 6 R Register Display Example Press for Enter the starting Address help R Enter Key zd AX 1104 Enter the Space Bar Key BX 1204 Enter the space bar to see the remaining registers 4 7 T Transfer Command Example Press The source segment addresses 0000 The above command transfer the memory content starting from source start address 1100 to destination start address 1200 till source end address 1500 is reached Src seg address 0000 Starting address 1100 End address 1200 Destination 1500 address Block Transfer Src seg 0000 Enter Key start 1100 Enter the 1100 address end 1200 Enter the 1200address Enter Key for exit command dest 0 1500 Enter Key Transfer Complete Enter Key J for exit command 4 8 N Local Mode When this key is depressed on PC keyboard the PS 8051 Kit starts working through local 101 keyboard Serial communication is disabled Following message will appear in the LCD display MODE 4 9 B baud rate
18. 9001 OUTPUT Result in ascending order in the location 9001 FLOW CHART Load the counter with the number of elements in the array Move the data from the memory pointer to a register 1 Increment the memory pointer SI Move the subsequent data to register 2 NO If regl gt reg2 Swap regl amp reg2 YES Increment the memory pointer SI Store register1 data to memory pointer address Increment the memory pointer SI Decrement the counter value NO YES ADDRESS OPCODE MNEMONICS COMMENTS 1100 00 90 MOV SI 9000 Load 9000 into SI 1103 8A OC MOV CL SI Load SI value into CL 1105 00 90 MOV SI 9000 Get second data 1108 8A 14 MOV DL SI Load SI second data into DL 110A 46 INC SI Increment SI 110B 8A 04 MOV AL SI Load SI value into AL 110D FE CA DECDL Decrement DL 110F 74 16 JZ 1127 If count is zero then go to 1127 1111 46 INC SI Increment SI 1112 8A 1C MOV BL SI Load SI value into BL 1114 38 D8 CMP AL BL if AL BL go to jump1 1116 7207 JNB 111F 1118 4E DEC SI Decrement SI 1119 88 04 MOV SI AL Load AL value into SI 111B 88 D8 MOV AL BL Load BL value into AL 111D EB 03 JMP 1122 111F 1 Decrement SI 1120 88 1C MOV SI BL Load BL value into SI 1122 46 INC SI Increment 1 1123 FE CA DEC DL Decrement DL 1125 75 EA JNZ 1111 If count is no
19. CS COMMENTS 1100 00 15 MOV SI 1500 Load 1500 into SI 1103 AD LODSW Load the first data 1104 89 C3 MOV AX Move AX value into 1106 AD LODSW Load the second data 1107 01 C3 SUB BX AX subtract AX from BX 1109 20 15 MOV DI 1520 Load 1520 address into DI 110C 89 1D MOV DI BX Load BX value into DI 110E CC INT 3 Break point 6 3 MULTIPLICATION OF TWO BYTE DATA FLOW CHART Initialize the Memory pointer SI Load the two data s into AX BX Multiply of these two data s Store the result into Memory ALGORITHM 1 Initialize the pointer to the memory for data and result Load the multiplier value into AX register Load multiplicand value in BX register Multiply of these two data s wm BW N Store the result into Memory address 1520 INPUT 4 Input data s 2 byte are loaded into Memory address 1500 5 Load the multiplier value 1500 6 Load the multiplicand value in 1502 OUTPUT 1 Result stored in Memory address 1520 Program ADDRESS OPCODE MNEMONICS COMMENTS 1100 00 15 MOVSI 1500 Load 1500 into 1 1103 AD LODSW Load the multiplicand value 1104 89 C3 MOV BX AX Load AX value into BX 1106 AD LODSW Load the multiplier value 1107 7 MUL BX Multiply two data 1109 5 15 MOV DI 1520 Load 1520 address into DI 110C 89 05 MOV DI AX Store AX value into
20. DI 110E 47 INC DI Increment the DI 110F 47 INC DI Increment the DI 1110 89 15 MOV DI Store BX value into DI 1112 CC INT 3 Break point 6 4 DIVISION 2 BYTE 1 BYTE FLOW CHART ALGORITHM 1 Initialize the pointer to the memory for result 2 Load the dividend value into AX register 3 Load the divisor value into BX register 4 Divide these two data s 5 Store the result into Memory address 1520 INPUT 1 Dividend value loaded into AX register 2 Divisor value loaded into BX register Output 1 Result stored into 1520 address 2 Quotient stored into 1522 address 3 Remainder stored into 1523 address Program ADDRESS OPCODE MNEMONICS COMMENTS 1100 00 00 MOV DX 0000 Clear DX registers 1103 B8 FD FF MOV AX FFFD Load the dividend in AX 1106 B9OFOO MOV Bx OF Load the divisor value in BX 1109 F7 F1 DIV BX Divide the two data s 110B BF0015 MOV DI 1520 Load 1520 address into DI 110E 88 05 MOV DI AL Load AL value into DI 1110 47 INC DI Increment DI 1111 88 25 MOV DI AH Load AH value into DI 1113 47 INC DI Increment DI 1114 89 15 MOV DI DX Load DX value into DI 1116 CC INT3 Break point 6 5 BLOCK MOVE FROM ONE LOCATION TO ANOTHER FLOW CHART Initialize the memory pointer CL of count loaded into AL Transfer data to the desired location CL CL 1 Load next data in AL
21. L SI Load SI value into CL 1105 00 90 MOV SI 9000 get the count 1108 8A 14 MOV DL 51 Load SI count value into DL 110A 46 INC SI Increment the pointer 110B 8A 04 MOV AL SI first data in AL 110D FE CA DEC DL Decrement DL 110F 74 16 JZ 1127 If count is zero then jump into 1127 1111 46 INC SI Increment SI 1112 8A 1C MOV BL SI Load SI count value into BL 1114 3A C3 CMP AL BL if al gt bl go to jump1 1116 7207 JB 111F 1118 4E DEC SI Decrement SI 1119 88 04 MOV SI AL Load ACC value in SI 111B 88 D8 MOV AL BL Store the greatest data 111D EB 03 JMP 1122 Jump into 1122 111F DEC SI Decrement SI 1120 88 1C MOV SI BL Store the smallest data in memory 1122 46 INC SI Increment SI 1123 FE CA DEC DL Decrement DL 1125 75 EA JNZ 1111 If count is not zero then jump into 1111 1127 88 04 MOV SI AL Load AL value into SI 1129 FE C9 DEC CL Decrement CL 112B 75 D8 JNZ 1105 If count is not zero then jump into 1105 112D CC INT3 Break point 6 20 ASCENDING ORDER ALGORITHM 1 Get the first data and compare with the second data 2 If the two data are in ascending order then no swap 3 Else swap the data byte by ascending order and then again compare the other data bytes up to the count 4 Do the above the array is arranged in ascending order 5 Finally the array is arranged in ascending order INPUT Enter the count in location 9000 Enter the data location starting from
22. OPCODE MNEMONICS 1100 8B 06 00 12 MOV BX 1200 1104 81 EO OFOF AND AX OFOF 1108 89 06 00 14 MOV 1400 AX 110C F4 HLT PROCEDURE The procedure outlined for previous exercises is to be followed for this program also 5 COMPUTING A BOOLEAN EXPRESSION OBJECTIVE To obtain a Boolean expression F which has 4 terms and 8 variables A B C D E F G H F AB CDE A BCD BCD EFGH THEORY Evaluation of Boolean expressions through minimization procedures is customary But this example seeks to do the same using the 8086 registers The 4 minterms are in FOUR 8 bit registers Use of logical instructions to perform this is consequential Don t care variables are represented by set bits The correspondence is ABCDEFGH D7 D6 05 D4 D3 D2 D1 DO EXAMPLE Input AL 10110111B B7 01111111B 7 BL 11111111B FF 11111111B FF Result 1100 11111111B FF MEMORY ADDRESS OPCODE MNEMONICS 1100 C6 CO B7 MOV AL B7 1103 C4 7F MOV AH 7F 1106 C6 C3 FF MOV BL FF 1108 C6 C7 FF MOV BH FF 110C 08 FB OR BL BH 110E 20 DC AND AH BL 1110 08 EO OR AL AH 1112 88 06 00 12 MOV 1200 AL 1116 F4 HLT Pantech solutions creates information packed technical documents like this one every month And our website is a rich and trusted resource used by a vibrant online community of more than 1 00 000 members from organization of all shapes and
23. RING G EXECUTING COMMAND 19 4 3 ENTERING RESULT 19 4A DISASSEMBLER 20 4 5 M Modify External 21 4 6 Register 21 4 7 T Transfer Command eese 22 4 8 N Local 4 23 4 9 B baud anes 24 4 10 S Serial Mode Key 24 1 Initially connect the 9V adaptor to J10 connector 25 CHAPTER 6 EXAMPLE PROGRAMS eene 30 6 1 Addition Of Two Bytes 30 6 3 MULTIPLICATION OF TWO BYTE DATA 34 6 4 DIVISION 2 BYTE 1 BYTE 36 6 5 BLOCK MOVE FROM ONE LOCATION TO ANOTHER38 6 6 SEARCHING A 4 6 7 GRAY CODE CONVERSION Look Up Table 43 6 8 SUM OF N CONSECUTIVE NUMBERS 45 6 9 ASCII TO HEX CODE CONVERSION 46 6 10 BCD TO HEXA DECIMAL CONVERSION 48 6 11 HEXA DECIMAL TO ASCII 50 6 12 MATRIX 51 6 13 SEPERATING ODD AND 54
24. RITHM 1 Add the bytes one one up to the count CL 2 Then divide the total with the count INPUT e Size of array count in CL 6 see the program e Enter the data starting from 9000h OUTPUT e Average is stored in AX register e Quotient in AL and the reminder in AH PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 BB0000 MOV BX 0000 Load 0000 into BX 1103 BE 00 90 MOV SI 9000 Array start address 1106 B80000 MOV AX 0000 Load 0000 into AX 1109 B1 06 MOV CL 06 Initialize 06 into CL register 110B 88 CD MOV CH CL Load the count value into CH 110D 8A 1C MOV 51 Get the data byte 110F 00 D8 ADD AL BL Add the data byte 1111 46 INC SI Increment the SI pointer 1112 FE C9 DEC CL Check the count 1114 75 F7 JNZ 1100 If count is not zero then go to 110D 1116 F6 F5 DIV CH Find the average by sum count 1118 CC INT3 Break point 6 18 GENERATE SQUARE WAVE I O ADDRESS FOR 8253 8254 CounterO FFOO Counter1 gt FFO2 Counter2 FFO4 Counter reg gt FFO6 FLOW CHART Initialize 8253 with counter2 in mode 3 Load data FF in LSB of counter2 Load data 00 in MSB of counter2 PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 BO B7 MOV AL 36 Load 36 into AL for generating SQUARE 1102 06 FF MOV DX FFO6 Load FFO6 into DX 1105 EE OUT DX AL Send the data to the timer 1106 BO 02
25. YTE ALLOCATION OF RAM START END ADDRESS SOCKET IC TOTAL ADDRESS NO USED CAPACITY 0000 FFFF U10 62256 32 K BYTE U11 62256 32 K BYTE PARALLEL INTERFACE 8255 Programmable peripheral interface SYSTEM MAPPING 1 0 mapped 1 0 The following are the I O addresses for 8255 GPIO 1 SOCKET NO FUNCTION ADDRESS CONNECTOR NO CONTL REG FF26 U22 PORTA FF20 J8 PORT B FF22 GPIO I PORTC FF24 J9 GPIO I amp GPIOII The following are the I O addresses for 8255 GPIO II SOCKET NO FUNCTION ADDRESS CONNECTOR NO CONTL REG FF36 U16 PORTA FF30 J6 PORT B FF32 GPIO II PORTC FF34 J9 GPIO I amp GPIOII TIMER INTERFACE 8253 Programmable Interval Timer SYSTEM MAPPING 1 0 mapped 1 0 CHANNEL 2 Input clock 3 MHz Output clock Depends on selection of baud rate Used for Baud rate generation for 8521 USART I O ADDRESS SOCKET NO FUNCTION ADDRESS CONNECTOR NO CONTL REG FFO6 U12 CHENNAL O FFOO J2 CHENNAL 1 FFO2 CHANNEL 2 FFO4 2 2 CONNECTOR DETAILS 1 20 PIN EXPANSION CONNECTORS The 20 Pin FRC connector is used to interconnect with the Interface cards like ADC DAC SWITCH LED RELAY buzzer Interfaces etc Pin details are given below J6 J8 J9 PA00 1 2 PA01 PAO 1 2 PA1 1 2 1 PA02 3 4 2 3 4
26. ata and Control bus pins are brought to the 50 pin FRC connector PS 86A is equipped with powerful software monitor in two 27C256 EPROM The monitor supports Video terminal RS232C interface local 101keyboard and LCD display The board has 64KB CMOS static RAM type 62256 PS 86A works on 9V DC 1 3 PS 8086 SPECIFICATIONS 8086 Microprocessor operating at 18 432 MHz 16KB powerful software monitor two 27C256 EPROM Three 16 bit programmable timers from 8253 48 programmable 1 0 lines from two nos of 8255 Serial interface using 8251 50 FRC connector for system bus expansion 20 pin FRC connector for user interface from 8255 9 pin D type connectors for RS 232 interface A WO N F amp F Six different selectable baud rates from 150 to 9600 10 101 PC type keyboard for entering user address data and for commands 11 Built in line by line assemble and disassemble 12 User friendly software monitor for loading and executing programs with break point facility CHAPTER 2 SYSTEM DESCRIPTION 2 1 HARDWARE PROCESSOR CLOCK FREQUNCY 8086 operates at 18 432 MHz clock MEMORY Monitor EPROM 0000 FFFF SEGMENT System RAM 0000 FFFF SEGMENT 1000 3FFF Reserved For Monitor program User RAM Area 1100 3FFF ALLOCATION OF EPROM START END ADDRESS SOCKET IC TOTAL ADDRESS NO USED __ CAPACITY 0000 FFFF U9 27256 32 K BYTE U8 27256 32 K B
27. count is not zero then continue from step 2 6 Store the result into Memory address 9500 INPUT Enter the size of array count in 9000 Enter the data starting from 9001 OUTPUT Result is stored in 9500 PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 00 90 MOV 1 9000 Load 9000 address into SI 1103 8A OC MOV CL SI Load SI value into CL 1105 46 INC SI Increment SI 1106 8A 04 MOV AL SI Move the first data in AL 1108 FE C9 DEC CL Reduce the count 110A 46 INC SI Increment SI 110B 3A 04 AL SI if AL gt SI then go to jump1 no swap 110D 73 02 JNB 1111 If count is zero then jump into 1111 110F 8A 04 MOV AL SI Else store large no in to AL 1111 FE C9 DEC CL Decrement the count 1113 75 F5 JNZ 110A If count is not zero then jump into 110A 1115 00 95 MOV DI 9500 Else store the biggest number at 9500 1118 88 05 MOV DI AL Store the AL value into DI 111A CC INT3 Break point 6 17 FLOW CHART Move the start address to a memory pointer Initialize register1 with zero Initialize counter with number of elements in an array Save the count in register3 Move the data from the memory pointer address to register2 Add register1 to register2 and store into register1 Increment the memory pointer amp Decrement the counter Divide register3 from register2 and store into register2 E n ALGO
28. ecrement CL 1114 75 F2 JNZ 1108 Loop continues until all elements of Matrix to added 1116 CC INT3 Break point 6 13 SEPERATING ODD AND EVEN FLOW CHART Initialize the memory pointer Load the data in AL register Rotate the data in AL register gt gt YES Store the result NO YES ALGORITHM 1 Initialize the pointer to memory for data and result 2 Loaded the data in AL register from memory 3 Rotate the AL register by one bit 4 If carry flag is set then go to step2 5 Store the even number as a result into the Memory INPUT Data in 2000 mixer of odd and even numbers Count number of bytes in CL OUTPUT Even numbers stored in 3000 PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 B1 08 MOV CL 08 Initialize 08 into CL 1102 BEOO20 MOV SI 2000 Load 2000 address into SI 1105 BF0030 MOV DI 3000 Load 3000 address into DI 1108 AC LODSB Load the counter value 1109 DO C8 ROR AL 1 Rotate AL in one time 110B 72 FB JB 1108 If carry occurs go to L1 odd Data 110D DO CO ROL AL 1 Else rotate by left to get original data 110F 88 05 MOV D1 AL Store the even data 1111 47 INC DI Increment DI 1112 FE C9 DEC CL Decrement CL 1114 75 F2 JNZ 1108 Loop executes until counter is zero 1116 CC INT3 Break point 6 14 FIBONACCI SERIES FLOEW CHART Initialize the memory pointer SI Load data BL t n 1 AL
29. o 110A 1106 72 02 JB 110A If 1 operand is below than 2 operand then short jump into 110A 1108 04 07 ADD AL 07 Else Add AL with 07 110A 04 30 ADD AL 30 add 30 with AL 110C CC INT3 Break point 6 12 MATRIX ADDITION FLOW CHART Initialize memory pointer for the two matrix SI and DI Load the input data s into CL Count AL data Add AL register with BL register Store the result into Memory Decrement the count value in CL register YES ALGORITHM 1 Initialize the pointer to memory for data and result 2 Load CL with count 3 Add two matrices by each element 4 Process continues until CL is O 5 Store the result into Memory INPUT Data in 2000 consecutive location as rows and columns for first matrix Data in 3000 consecutive location as rows and columns for second matrix OUTPUT Data in 3000 with 9 entries PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 B1 09 MOV CL 09 Initialize 09 into CL register 1102 00 20 MOV SI 2000 Load 2000 into SI for 1 matrix 1105 00 30 MOV DI 3000 Load 3000 into DI for 2 matrix 1108 8A 04 MOV AL 51 Load AL with data of first matrix 110A 8A 1D MOV BL DI Load BL with data of second matrix 110C 00 08 ADD AL BL Add two data of AL and BL 110E 88 05 MOV DI AL Store AL with data into DI 1110 47 INC DI Increment DI 1111 46 INC SI Increment SI 1112 FE C9 DEC CL D
30. sizes What do we sell Our products range from Various Microcontroller development boards DSP Boards FPGA CPLD boards Communication Kits Power electronics Basic electronics Robotics Sensors Electronic components and much more Our goal is to make finding the parts and information you need easier and affordable so you can create awesome projects and training from Basic to Cutting edge technology
31. spacebar till the end of the program 7 To execute the program Depress G staring address for Ex G1100 8 To see the result depress M result address for Ex M1200 9 To view the output in the Register depress R and press enter key in keyboard PROCEDURE 2 ENTER THE OPCODE Follow the same procedure till step 4 1 Depress starting address of the program for Ex M1100 For ex M1100 press enter Type the opcode B8 space bar Type the opcode 12 space bar and continue the same till the end of the program ADDRESS OPCODES MNEMONICS 1100 B81212 MOVAX 1212 1103 1212 MOV BX 1212 1106 01 D8 ADD AX BX 1108 BE0012 MOVSI 1200 1108 89 04 MOV SI AX 110D F4 HLT 2 view the code depress D starting address and depress space bar to see next memory location For D1100 and press spacebar till the end of the program 3 To execute the program Depress G staring address for Ex G1100 4 To see the result depress M result address for Ex M1200 5 view the output in the Register depress R and press enter key in keyboard Note 1 is used for displaying the result for Ex M8500 2 is used to entering the Opcode 3 is used for entering the data Note There are two ways to enter the program 1 Mnemonics method 2 Opcode method Sample program is given to enter the program in both the methods CHAPTER
32. starts from address 1100 and displays the following and waits for the user data to be typed in the second line Example 0000 1100 MOV AX 1212 Enter the mnemonics Enter Key 0000 1103 Enter the mnemonics MOV BX 1212 Enter Key Program end Exit Command Double Enter you get the main menu PS 86 2 PROGRAM ENTRY USING OPCODE Modify Memory Press for Enter the starting Address help M1100 Enter Key al 0000 1100 18 _ 0000 1100 Enter the opcode 18 B8 Enter the Space Bar Key 0000 1101 Enter the opcode 34 12_ Enter the Space Bar Key Program end Exit Command Double Enter you get the Main Menu ENTERING G EXECUTING COMMAND PS Enter starting address 86 G1100 Enter key After executing display PS Executing display 86 G1100 To EXIT Execution PRESS RESET Switch 4 3 ENTERING RESULT COMMAND Press for Enter the Memory Location help M Enter Key al lt address gt 0000 1200 24 You get the output 8 bit Data 4 4 DISASSEMBLER Disassemble converts the hex byte stored in the memory into equivalent mnemonics To enter into disassemble mode type D in the command mode followed by the memory address Example Press for Enter the starting address help D1100 Enter Key
33. sult INPUT 1 Search the byte A 50 locations from 1500 Output 1 Store the result byte in 1600 PROGRAM ADDRESS OPCODE MNEMONICS COMMENTS 1100 00 13 MOV DI 1600 Load 1600 into DI 1103 00 12 MOV SI 1500 Load 1500 into 1 1106 B1 50 MOV CL 50 Load 50 into CL 1108 B2 OA MOV DL Load 10 into DL 110A AC LODSW Load CL register with the count 110B 38 C2 CMP DL AL Compare DL and AL register values 110D FE C9 DEC CL Decrement CL register 110F 7505 JZ 1114 If count is zero then jump into 1114 1111 75 7 JNZ 110A If count is not zero then jump into 110A 1113 F4 HLT 1114 88 05 MOV DI Load AL value into DI 1116 4E DEC SI Decrement SI register 1117 89 F3 MOV BX SI Load SI value into BX 1119 47 INC DI Increment DI 111A 88 1D MOV DI BL Store BL value into DI 111C 47 INC DI Increment DI 111D 88 3D MOV DI BH Store BH value into DI 111F CC INT 3 Break point 6 7 GRAY CODE CONVERSION Look Up Table Flow Chart Load data into AL register Convert AL into gray code Store the result into Memory ALGORITHM 1 Load the memory with truth table of gray codes 2 Initialize the pointer to the memory for data and result 3 Load AL with the data from memory 4 Convert gray code for that data 5 Store the result into Memory INPUT Data in 1500 OUTPUT Result
34. t zero then goto 1111 1127 88 04 MOV SI AL Load AL value into SI 1129 FE C9 DEC CL Decrement CL 112B 75 08 JNZ 1105 If count is not zero then go 1105 112D CC INT3 Breakpoint ADDITIONAL PROGRAMS ON 8086 1 COMPARE STRING ADDRESS MNEMONICS 1100 LEA SI 1200 1104 LEA DI 1300 1108 MOV CX 0003H 110b CLD 110c REPE CMPSB 110e JNZ NOTEQUAL 1110 MOV AL 01 1112 MOV 1400 AL 1115 HLT 1116 NOTEQUAL MOV AL 00 1118 MOV 1400 AL 111b HLT CONDITION 1 SAME STRING IN DATA1 AND DATA2 1ST INPUT 2ND INPUT 1200 11 1300 11 1201 22 1301 22 1202 33 1302 33 OUTPUT 1400 01 CONDITION 2 DIFFERENT STRING IN DATA1 AND DATA2 1STINPUT 2NDINPUT 1200 11 1300 44 1201 22 1301 55 1202 33 1302 66 OUTPUT 1400 2 MOV STRING PROGRAM ADDRESS OPCODE 1100 MOVCX 1500 1104 LEA 11600 1108 LEA DI 1700 110c CLD 110d REP MOVSB 110f HLT INPUT LOCATION COUNT INPUT DATA INPUT 1500 03 1601 22 1601 11 1602 33 OUT LOCATION OUTPUT 1700 11 1701 22 1703 33 3 ONE S COMPLEMENT OF A 16 BIT NUMBER OBJECTIVE To find the one s complement of the data in register pair AX and store the result at 1400 THEORY In the one s complement of a binary number the ones are changed to

Download Pdf Manuals

image

Related Search

Related Contents

[消防1・2課(西)]総括表(PDF形式:24KB)  SUUNTO ELEMENTUM TERRA Guide d`utilisation  Samsung UN55JU6700FXZA User's Manual  manual de instrucciones  Downloads - Shturman  Fujitsu LIFEBOOK E733  Manual de instalación y mantenimiento Triton Riel Par  CASIO CP-NW110 ユーザーズマニュアル  Modecom MC-825  Lustre 1.6 Operations Manual  

Copyright © All rights reserved.
Failed to retrieve file