Skip to main content

Posts

Q. Write a program to load the bit pattern 91H in register B and 87H in register C, mask all the bits except D0 from registers B and C, and if D0 is at logic 1 in both the registers, turn on the light connected to the D0 position of the output port 01H; otherwise, turn off the light. MVI B, 91H MVI C, 87H MOV A, B ANI 01H MOV B, A MOV A, C ANI 01H MOV C, A ANA B JNZ LABEL MVI A, 00H OUT 01H HLT LABEL: MVI A, 01H OUT 01H HLT
Q. Write a program for absolute division of two numbers. Assume that the numbers are in register B and C, and the result is to be displayed at output device 50H. MVI B, 12H MVI C, 03H MVI D, 00H MOV A, B LABEL: INR D SUB C JNZ LABEL MOV A, D OUT 50H HLT
Q. What is the task of the following program? Specify the contents of flags, registers used and output port 30H after the execution of the following instructions. 1200:    MVI A, 55H 1202:    ANI 80H 1204:    JNZ 120DH 1207:    OUT 30H 120A:   JMP 1212H 120D:    MVI A, 01H 120F:   OUT 30H 1212:    HLT The task of the program is to check whether the number in the accumulator is positive or negative. The D7 bit of the number determines the sign. In this case the number 55H has D7 bit ‘0’, i.e. the number is positive so the result at the o/p device 30H is zero (00H), denoting positive. If there is any other number with D7 bit ‘1’, the result at the o/p device 30h will be one (01H) denoting negative. Content of flags: Contents of register A: 00H Content of o/p port 30H: 00H

control matlab practice

https://drive.google.com/open?id=1FWno-_4G-tj4foDw57I5PB16EjBjtSHz 1. There are some built in constants in MATLAB; i, j, pi, eps, inf, NaN. Whether a name is a built in constant or not can be checked by the statement ''which -all <name>''. 2. Type the following vector in the command window: a) 𝐴= 123 b) 𝐵= 01−2−3 c) 𝐶= −120410−2106 i) Use MATLAB to find the value in the second row and the third column of matrix C. ii) Use MATLAB to find the second row of matrix C. iii) Use MATLAB to find the third column of matrix C. iv) Use MATLAB to delete the second column of matrix C. 3. You can also perform Element-wise assignment of the Matrix elements. a) >> A(1,1)=1;  b) >> A_r1=[1 2];                     c) >> e_col1=[1;3.7;8]; >> A(2,1)=3.7;        >> A_r2=[3.7 -0.002];             >> e_col2=[2;2e-3;1.3e5]; >> A(1,2)=2;          >> A_r3=[8 13000];                 >> e_col3=[5;1.3e7;
Write a 8086 program to find the factorial of given number.
Write a 8086 program to find the factorial of given number.
Write a 8086 program to add two 8 bit nimbers. soln