Question: Please use Emu8086 Thank u. Basic Idea Detailed Explanation Write an assembly program that opens five locks in at most 20 tries. The lock mechanism
Please use Emu8086 Thank u.
Basic Idea Detailed Explanation Write an assembly program that opens five locks in at most 20 tries. The lock mechanism is explained with an algorithm given below. The program must display the text "Locks are not open" and exit if your program cannot open locks in at most 20 tries. 1. Display the number of tries on Seven Segment Display Output in Emulation Kit. If the number of tries is greater than 20, then exit the program. 2. Use the following algorithm to open locks: START: if(Number of tries>20) print("Locks are not open") exit } R=Random Number (Between 0 and 9) key=R and 5 key1 = (keyR+5) mod 5 if (key1==0) print("Lock 1 is open") key2 = key OR R if(key2!=0) print("Leck2 is open") key 3 = SAR (key+R),2 if(key3!=0) { print("Lock 3 is open") key=key XORR if(key4!=0) { print("Locke is open") key5= key*R if(key5==0) print("Locks is open, and I am out") } else jmp START } else jmp START } mp START } jmp START } mp START 3. You can use "INT 1 Ah/AH=00h" to generate a random number (R). See the documentation for further explanations. 4. Create a PRINT procedure that runs the same code block for printing each message. You must print messages on ASCII LCD Output in Emulation Kit. Basic Idea Detailed Explanation Write an assembly program that opens five locks in at most 20 tries. The lock mechanism is explained with an algorithm given below. The program must display the text "Locks are not open" and exit if your program cannot open locks in at most 20 tries. 1. Display the number of tries on Seven Segment Display Output in Emulation Kit. If the number of tries is greater than 20, then exit the program. 2. Use the following algorithm to open locks: START: if(Number of tries>20) print("Locks are not open") exit } R=Random Number (Between 0 and 9) key=R and 5 key1 = (keyR+5) mod 5 if (key1==0) print("Lock 1 is open") key2 = key OR R if(key2!=0) print("Leck2 is open") key 3 = SAR (key+R),2 if(key3!=0) { print("Lock 3 is open") key=key XORR if(key4!=0) { print("Locke is open") key5= key*R if(key5==0) print("Locks is open, and I am out") } else jmp START } else jmp START } mp START } jmp START } mp START 3. You can use "INT 1 Ah/AH=00h" to generate a random number (R). See the documentation for further explanations. 4. Create a PRINT procedure that runs the same code block for printing each message. You must print messages on ASCII LCD Output in Emulation Kit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
