Assembly language code for the Conversion of ascii to binary using 8085 microprocessor?
Org 1000
mov si,1100
mov di,1400
cld
mov bl,20h
next: lodsb
cmp al, bl
je exit
sub al,30h
cmp al,0ah
jc store
sub al,07h
store: stosb
jmp next
exit: hlt
What are the differences between Macros and Functions in C Language?
Subroutine:
1.When a task is to be done repeatedly then it is written as subroutine and this subroutine will be called each time to perform that task.
2.Subroutine program will be stored in some memory location and program control will be transfered to that location each time.
3.where as in macro the number of instructions will be less than subroutine.Here each time u call a macro that set of instructions will be inserted in that location.
4.macro doesn't have return statement while subroutine has.
5.memory requirement for macro is higher.
6.execution time of macro is lesser than subroutine.
What are some of the different types of software programming languages?
High level languages
Mid Level Languages
Low level languages
High level languages: cobol, fortran etc
Mid level languages: C, C++
Low level languages: assembly language
Programs to implement operations on doubly linked list in C?
Stack is an abstract data type that allows you to input and output data in a way that the first data which was placed in the stack will be the last one to get out. We use physical examples of stack in our daily lives such as the stack of dishes or stack of coins where you only add or remove objects from the top of the stack.
You can see the whole source code implementing the stack in related links, below.
What is the difference between machine dependent and code optimization?
Machine dependent code is in contrast to machine-independent, or portable, code.
Optimized code is in contrast to non-optimized code.
The two terms do not contrast each other; machine dependent code can be optimized or not optimized, and so can machine independent code.
Machine-dependent code relies on specific characteristics of the device it was written for. For example, it might depend on an integer variable to be 16 bits in size, or on a specific memory address to gain access to special hardware features (such as, for example, a ratl-time clock or serial port). Machine-dependent code is common in embedded software, which is generally written to suit small and specialized computer systems. It can be difficult to transport this code to a different machine due to these machine dependencies.
Machine independent or "portable" code contains fewer and, ideally, no such dependency. In theory, such code can be freely moved from one machine to another, provided all share support for the same programming language such as, for example, ANSI-C.
In reality however, no code is truly independent. Portable code may not depend on the size of an integer variable or the memory location of a serial port chip, but will instead depend on other factors. For example, it will depend on an ANSI compliant implementation of the C programming language, and an operating system with a standard POSIX API.
Code optimization, by contrast, does not necessarily introduce machine dependency. Many forms of machine dependence introduced by optimization are introduced by automated optimization steps. For example, the C compiler for machine A may be able to optimize code for this particular machine for fastest excution or smallest size (or a compromise of both). Since this hardware-dependent optimization occurs at a lower level than the C programming, it is not a concern for portability.
Other optimization steps can introduce machine dependency into the source code. For example, accessing a time-critical I/O device through operating system device drivers may lead to unacceptable latencies in some application. One might then decide to accept the disadvantage of machine dependencies on this occasion in order to meet the required timing constrains.
It is generally advisable to introduce such dependencies with great care and only after careful consideration, and to the smallest amount possible.
Name three examples of secondary storage devices?
The most popular secondary storage devices are hard disks, CDs, DVDs, USB Flash drive and floppy disks.
Examples of high level computer languages?
Java and C# are all examples of high-level programming languages. High level programming languages separate the programmer from the machine through abstraction, allowing them to focus more upon the software rather than the underlying hardware, which is taken care of by a compiler and/or interpreter. The higher the level of abstraction, the less interaction there is with the machine itself. Java, for instance, has no low-level functionality whatsoever as all code is written against a virtual machine. This makes the language extremely portable as programs can be run on any machine with a Java virtual machine implementation, without any modification to the compiled byte code. The Java virtual machine is essentially an interpreter that translates the byte code to machine code.
Assembly and machine code are low-level languages. Before there were any languages, all code had to be written in machine code (long sequences of 1s and 0s), which was highly prone to error. Assembly language was the first programming language, and was used to make it easier to produce machine code. As such, every platform has its own version of assembler. As such, programs written in assembler or machine code are non-portable.
Mid level languages include C and C++. Both are really high-level languages as they can both be used to write portable code, but the amount of abstraction in C is almost non-existent because much of C can be mapped almost 1:1 with the resulting assembly, but with enough abstraction to make it much easier to work with. C++ is backwardly-compatible with C but is more flexible because the programmer can use as much or as little abstraction as required, giving the best of both worlds.
What does mean selection in c program?
selection Also called a decision, one of the three basic logic structures in computerprogramming. The other two logic structures are sequence and loop.
In a selection structure, a question is asked, and depending on the answer, the program takes one of two courses of action, after which the program moves on to the next event.
This structure is sometimes referred to as an if-then-else because it directs the program to perform in this way: If Condition A is True then perform Action X else perform Action Y.
All logic problems in programming can be solved by forming algorithms using only the three logic structures, and they can be combined in an infinite number of ways. The more complex the computing need, the more complex the combination of structures.
You can get the detailed answer on P29-31 ,Problem_Solving & program_design_in_c.
First the source files must be pre-processed. This handles all the precompiler directives (such as #include which pulls in headers) and macro definitions (such as #define statements which perform text replacements). This creates intermediate files known as translation units, which are then passed to the compiler. Each translation unit is compiled into machine code to create an object file. Finally, all the object files are linked together along with any precompiled static library functions to create the executable.
There are three stages to the translation process: preprocessing; compiling and linking
Write an algorithm for the implementation of a circular doubly linked list?
For an example of implementation see: How_you_insert_a_newnode_in_singly_circular_link_list
Program that implements breadth first search algorithm?
#include <stdio.h>
#include <conio.h>
#include <malloc.h>
#define TRUE 1
#define FALSE 0
#define MAX 8
struct node
{
int data ;
struct node *next ;
} ;
int visited[MAX] ;
int q[8] ;
int front, rear ;
void bfs ( int, struct node ** ) ;
struct node * getnode_write ( int ) ;
void addqueue ( int ) ;
int deletequeue( ) ;
int isempty( ) ;
void del ( struct node * ) ;
int main( )
{
struct node *arr[MAX] ;
struct node *v1, *v2, *v3, *v4 ;
int i ;
v1 = getnode_write ( 2 ) ;
arr[0] = v1 ;
v1 -> next = v2 = getnode_write ( 3 ) ;
v2 -> next = NULL ;
v1 = getnode_write ( 1 ) ;
arr[1] = v1 ;
v1 -> next = v2 = getnode_write ( 4 ) ;
v2 -> next = v3 = getnode_write ( 5 ) ;
v3 -> next = NULL ;
v1 = getnode_write ( 1 ) ;
arr[2] = v1 ;
v1 -> next = v2 = getnode_write ( 6 ) ;
v2 -> next = v3 = getnode_write ( 7 ) ;
v3 -> next = NULL ;
v1 = getnode_write ( 2 ) ;
arr[3] = v1 ;
v1 -> next = v2 = getnode_write ( 8 ) ;
v2 -> next = NULL ;
v1 = getnode_write ( 2 ) ;
arr[4] = v1 ;
v1 -> next = v2 = getnode_write ( 8 ) ;
v2 -> next = NULL ;
v1 = getnode_write ( 3 ) ;
arr[5] = v1 ;
v1 -> next = v2 = getnode_write ( 8 ) ;
v2 -> next = NULL ;
v1 = getnode_write ( 3 ) ;
arr[6] = v1 ;
v1 -> next = v2 = getnode_write ( 8 ) ;
v2 -> next = NULL ;
v1 = getnode_write ( 4 ) ;
arr[7] = v1 ;
v1 -> next = v2 = getnode_write ( 5 ) ;
v2 -> next = v3 = getnode_write ( 6 ) ;
v3 -> next = v4 = getnode_write ( 7 ) ;
v4 -> next = NULL ;
front = rear = -1 ;
bfs ( 1, arr ) ;
for ( i = 0 ; i < MAX ; i++ )
del ( arr[i] ) ;
getch( ) ;
return 0;
}
void bfs ( int v, struct node **p )
{
struct node *u ;
visited[v - 1] = TRUE ;
printf ( "%d\t", v ) ;
addqueue ( v ) ;
while ( isempty( ) -1 )
return TRUE ;
return FALSE ;
}
void del ( struct node *n )
{
struct node *temp ;
while ( n != NULL )
{
temp = n -> next ;
free ( n ) ;
n = temp ;
}
}
Difference between field and local variable?
Well, hehe its quite simple. You must be a dumb little nerd if you cant find it out. I suggest taking Pre IB computers and eating cherrios for breakfast to clear your mind. Maybe after a hot shower with your rabbit youll be able to brainstorm through the ultimate collage of confusion!
List the advantages of dynamic RAM compared with static RAM?
Static RAM and dynamic RAM are two available types of computer RAM, or Random Access Memory. One advantage of static RAM is speed, while a disadvantage is cost. An advantage of dynamic RAM is storage space, while a disadvantage would be speed.
Give a good name forcollege newsletter?
The Bugle, The Observer, The Report, The Scoop, Sentinel, Herald, Times, Chronicle, Journal, Inquirer, Post, Enterprise, Daily, Daily Chatter Box , (school ' s name ) Journal , Courier , Talk City , Post , News Are Us , Gazette , Press , Express . :)
What is an object oriented program?
The term "object-oriented program" is essentially meaningless. Object-oriented programming applies to high-level source code, not to programs.
High-level source code does not create a program as such because because the high-level instructions are far too abstract for the machine to understand. In order to create an actual program, the high-level symbolic code must be converted to native machine code, the only language the machine actually understands. This is achieved through compilation or interpretation or a combination of the two. Machine code is an entirely procedural language; there is no such thing as object-oriented machine code.
Machine code is non-portable. To overcome this, a compiler may convert the source code to an intermediate form such as byte code. Byte code is usually portable but it still needs to be converted to native machine in order to execute. This is achieved by an interpreter. The interpreter handles the execution, converting byte code to machine code while the byte code is executing within the interpreter. Although portable, byte code has to be interpreted every time it is executed, so it is much slower to execute than native machine code. However, like machine code, byte code is entirely procedural.
Although it is (theoretically) possible to execute high-level object-oriented instructions through interpretation, it makes no sense to do so as this would only reduce performance even further. The whole point of compiling to byte code is to produce code that can be efficiently interpreted in order to keep performance as high as possible.
Raster-scan:-q1) Raster displays have less resolution.
q2) The lines producced are ziz-zag as the plotted values are discrete.
q3) High degree realism is achived in picture with the aid of advanced shading and hidden surface technique.
q4) Decreasing memory costs have made raster systems popular.
Random scan:-q1) Random displays have high resolutions since the picture definition is stored as a set of line drawing commands and not as a set of intensity values.
q2) Smooth lines are produced as the electron beam directly follows the line path.
q3) Realism is difficult to achieve.
q4) Random-scan system's are generally costlier.
What is the Advantage of method overloading?
Suppose that you have a class that can draw various types of data (strings, integers, and so on) and that contains a method for drawing each data type. In other languages, you have to think of a new name for each method, for example, drawString, drawInteger, drawFloat, and so on. In the Java programming language, you can use the same name for all the drawing methods but pass a different type of argument to each method. Thus, the data drawing class might declare three methods named draw, each of which takes a different type of argument.
Microsoft had its own version of DOS (Disk Operation System) which is a command line operating system (well sorta, it bought it originally and improved it) For more information try using a search engine and searching up the history of microsoft. (Try google)
What are the 2 basic functions used in encryption algorithm?
Two basic functions used in Encryption Algorithms are * Substitution * Transposition
A variable that is declared inside a method is called variable?
It is called a local variable since it only exists inside the method.
Write a program in c language to accept 10 strings as input and printthem in lexicographic order?
#include <stdio.h>
#include <string.h>
void main()
{
char a[4][25],temp[25];
int i,j;
clrscr();
printf("Enter the names\n");
for (i=0;i<4;i++)
gets(a[i]);
for (i=0;i<3;i++)
for (j=i+1;j<4;j++)
{
if (strcmp(a[i],a[j])>0)
{
strcpy(temp,a[i]);
strcpy(a[i],a[j]);
strcpy(a[j],temp);
}
}
printf("Sorted strings are \n");
for (i=0;i<4;i++)
puts (a[i]);
getch();
}
What are the types of error that occur in programming?
There are some types of errors, eg:
1. Compile Errors
1.1. Syntax Errors
2. Run time Errors
2.1. Segmentation fault (or: invalid page fault)
2.2. Division by zero
2.3. Value out of range
syntax error refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language.
x=1;
y=x++;
y=++x;
give me answer and how work it.
What is the name given to the programming-code patterns of viruses?
signature? What is the name given to code patterns of viruses?