Posts

8086 program Write an ALP to perform 16-bit and 32-bit multiplication.

Image
Code :- 16-bit multiplication org 100h          MOV AX,1234H MOV BX,1111H  MUL BX MOV [2000H],AX MOV AX ,DX MOV [2002H],AX ret Output :- 32-bit multiplication org 100h            MOV AX,1234H MOV BX,1111H MOV CX,1234H MOV DX,1111H  MUL BX MUL DX ret Output :-

8086 program Write an ALP to perform 16-bit and 32-bit addition and subtraction.

Image
 Code :- 16 bit addition org 100h MOV AX,0A235H MOV BX,8564H ADD AX,BX ret Output :- 32 bit addition   org  100h MOV AX,1111H MOV BX,1111H MOV CX,9999H MOV DX,9999H ADC  AX,CX ADC BX,DX ret Output :- 16 bit subtraction org 100h MOV AX,0A235H MOV BX,8564H SUB  AX,BX ret Output :- 32 bit subtraction org  100h MOV AX,1010H MOV BX,1010H MOV CX,0909H MOV DX,0909H SUB  AX,CX SUB  BX,DX ret Output :-

8086 program Write an ALP to exchange block of data bytes.

Image
Code :- org 100h MOV SI,2000H MOV DI,2004H MOV CX,02H L1:    MOV AL,[SI]    MOV BL,[DI]    MOV [SI],BL    INC SI    MOV [DI],AL    DEC DI LOOP L1 ret Output :-

8086 program write an ALP to move block of data bytes from one location to another location.

Image
Code :- org 100h MOV SI,2000H MOV DI,2010H MOV CX,05H L1:     MOV AX,[SI]     INC SI     MOV [DI],AX     INC DI LOOP L1 ret Output :-

Identify bugs and resolve it to fulfill following objective. Interface 3 LEDs and 4 SWICHES with Arduino. Develop a program that by pressing 1st switch it will ON LED1, by pressing 2nd switch it ON LED2 and same for 3rd switch and LED3. By pressing 4th switch it will reset (OFF) all LEDs.

Image
  Here i am using online IDE  Tinkercad  . If you don't know what is tinkercad then refer my blog  HERE  or else you can use offline IDE also. Code :- const int LED1 = 7; const int LED2 = 6; const int LED3 = 5; const int BUTTON1 = 2; const int BUTTON2 = 3; const int BUTTON3 = 0; const int BUTTON4 = 1; int Buttonmodel = 0; int Buttonmode2 = 0; int Buttonmode3 = 0; int Buttonmode4 = 0; void setup () { // put your setup code here, to run once: pinMode(LED1,OUTPUT); pinMode(LED2, OUTPUT); pinMode(LED3, OUTPUT); pinMode(BUTTON1,INPUT); pinMode(BUTTON2,INPUT); pinMode(BUTTON3,INPUT); pinMode(BUTTON4,INPUT); } void loop(){ //First LED interface Buttonmode1 == digitalRead(BUTTONl); if(Buttonmode1 = HIGH) { digitalWrite(LED1,HIGH); } //Second LED interface Butonmode2 = digita1Read (BUTTON2); if(Buttonmode2 = HIGH) { digitalWrite(LED2,HIGH);  } //Third LED interface Buttonmode3 = digitalRead(BUTTON3); if(Buttonmode3 = HIGH); { digitalWrite(LED3,HIGH); } //Fourth...

Interface Potentiometer and dc motor with Arduino Uno. Develop an Arduino sketch to control speed of DC motor using Potentiometer.

Image
Here i am using online IDE  Tinkercad  . If you don't know what is tinkercad then refer my blog  HERE  or else you can use offline IDE also. Code :- int c1 = 0; int c2 = 0;   void setup()  {   pinMode(12, OUTPUT);   pinMode(A0, INPUT);  } void loop() {   c2= analogRead(A0);   c1= 1024-c2;           digitalWrite(12, HIGH);   delayMicroseconds(c1);     digitalWrite(12, LOW);    delayMicroseconds(c2);  } Output :-

Interface Potentiometer and servo motor with Arduino Uno. Develop an Arduino sketch to control angle of servo motor using potentiometer.

Image
Here i am using online IDE  Tinkercad  . If you don't know what is tinkercad then refer my blog  HERE  or else you can use offline IDE also. Code :- #include <Servo.h> int val; Servo servo_9; void setup() {   servo_9.attach(9); } void loop() {   val = analogRead(A0);              servo_9.write(val/4);                    delay(15); } Output :-