Posts

Showing posts from April, 2013

8086 Programs for SUB, ADD, MUL, DIV

  ADDITION:MOV AX,04MOV BX,06ADD AX,BXMOV SI,9000MOV [SI],AXMOV AH,4CHINT 21HSUBTRACTION:MOV AX,04MOV BX,06SUB AX,BXMOV SI,9000MOV [SI],AXMOV AH,4CHINT 21HMULTIPLICATION:MOV AX,04MOV BX,06MUL BXMOV SI,9000MOV [SI],AXMOV AH,4CHINT 21HDIVISION:MOV AX,04MOV BX,06DIV BXMOV SI,9000MOV [SI],AXMOV AH,4CHINT 21H  

8086 Program to add two numbers using console screen.

Image
Emulator Used:    emu8086 (Version 4.08) Click Here To Download data segment    msg1 db 10,13,'adition for 2 no$'    msg2 db 10,13,'enter a first no$'    msg3 db 10,13,'enter a second no$'    msg4 db 10,13,'addition is$'    a DW 0000h    b DW 0000h    c dw 0000h    data endsassume cs:code,ds:datacode segment    start:    mov ax,data         ;initilise data segment    mov ds,ax    lea dx,msg1         ;load offset of msg1    mov ah,09h          ;print the msg to console    int 21h             ;intrrupt call    lea dx,msg2        ;  load offset of msg2    mov ah,09h          ;print the msg to console    int 21h              ;intrrupt call                    mov ah,01h           int 21h           sub al,30h           MOV CH,AL           mov ah,01h           int 21h           sub al,30h           MOV CL,AL           MOV a,CX              ;get the no from consol              ;enter a no in askii form we need to conver into                        ;dec no and th

8086 Program for swapping the contents two arrays (16-bit) in assembly language.

Image
Instruction Set:  Intel 8086 Microprocessor . Emulator Used:    emu8086 (Version 4.08) Click Here To Download ;SWAPING ARRAY ELEMENTS OF TWO GIVEN ARRAYSDATA SEGMENTARRAY1 DW 1000H,2000H,3000H,4000H,5000HARRAY2 DW 6000H,7000H,8000H,9000H,0000HDATA ENDSCODE SEGMENTSTART:MOV AX,DATAMOV DS,AXLEA SI,ARRAY1LEA DI,ARRAY2MOV CX,05SWAP:MOV AX,[SI]MOV BX,[DI]MOV [SI],BXMOV [DI],AXINC SIINC SIINC DIINC DILOOP SWAPMOV AH,4CHINT 21HCODE ENDSEND START     Output: 8086 Related Book    

Simple Calculator in Javascript

Image
<html> <title> </title> <head> <script type=”text/javascript” > document.write(“<center><div style=’background-color: Green;color:wheat;text-align:center;position:relative;left:0%;top:0%;width:60%;height:50%;z-index:1′>”); document.write(“<h1>Simple Calculator</h1><br>” ); document.write(“A = <input type=’text’ id=’001′ ><br><br>”); document.write(“B = <input type=’text’ id=’002′><br><br><br>”); document.write(“<input type=’button’ value=’Adition’ onclick=’add( )’>”); document.write(“<input type=’button’ value=’Subtract’ onclick=’sub( )’>”); document.write(“<input type=’button’ value=’Multiply’ onclick=’mul( )’>”); document.write(“<input type=’button’ value=’Divide’ onclick=’divide( )’>”); document.write(“<input type=’button’ value=’Mod’ onclick=’mod()’>”); document.write(“<br><br><input type=’button’ value=’Clear All’ onclick=’clear1()’>

Java Programming Question.

Q. String Matrix Write an Application while will accept a algebraic expression of variables (without limit in variable numbers) and equivalent number of matrices of any order n of square matrix. The output should be the corresponding operation on matrix element as specified in equation. Java Code: import java.io.*; import java.util.Stack; import java.util.Vector; public class que3ans { /** * @param args */ static int[][] calculate(int a[][],int b[][],int mat_size,String op) { int[][] c=new int[mat_size][mat_size]; switch(op) { case “+”: return(c = add(a,b,mat_size) ); case “-“: return(c = sub(a,b,mat_size) ); case “*”: return(c = mul(a,b,mat_size) ); case “/”: return(c = div(a,b,mat_size) ); default:return c; } } static int[][] mul(int a[][],int b[][],int mat_size) { int[][] c=new int[mat_size][mat_size]; int sum=0; for(int x=0; x<mat_size; x++) { for(int i=0; i<mat_size; i++) { for(int j=0;j<mat_size; j++) { sum =

Java Programming Question.

Q.  A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You are to write an application to assign seats on each flight of the airline’s only plane (capacity: 10 seats). Your application should display the following alternatives: 1. Please type 1 for First Class and 2. Please type 2 for Economy. If the user types 1, your application should assign a seat in the first-class section (seats 1–5). If the user types 2, your application should assign a seat in the economy section (seats 6–10). Your application should then display a boarding pass indicating the person’s seat number and whether it is in the first-class or economy section of the plane. Represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding elements of the array to true to indicate that the seat is no longer available. Your