answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is procedural fairness?

what is fair procedure? for tom r. tyler

What is the purpose of the program stack?

Its main use is to store local variables, arguments and return address each time a function is called.

When your program calls a function the following happen :
- The function arguments are put on the stack
- The current instruction pointer is put on the stack
- The program jumps to the start of the function
- Space is allocated on the stack to hold local variables
- The function executes
- The space holding local variables is de-allocated
- The instruction pointer is restored and removed from the stack (we are now leaving the function and resuming the calling procedure)
- The arguments are removed from the stack

Write a Program in lisp to find maximum of three numbers?

(defun max3 (a b c)

(cond ((> a b) (cond ((> a c) a) (t c)))

((> b c) b)

(t c)

)

)

What is the difference between multitasking and multiprograming?

Multiprogramming is a method of running several different programs in a computer apparently at the same time.

Usually on a mainframe - the computer has a number of programs loaded into memory and the operating system switches quickly between them, processing a little bit of each one in turn. The high speed of the processor makes it seem like more than one program is being run at the same time.

On a PC it is usually called multitasking.

Answer-multitasking is the process which occur when more than one task(job) are executed by CPU at a time....-.Multitasking should not be confusing with multiple program where by in multiprogram more than one program(task) are in the mein memory but each one are executed by CPU at different time...It is impossible CPU to running more than one program at the same time

How do you transition from user mode to kernel mode?

You would have to be logged in as the administrator.

ANSWER

It depends on your operating system. A kernel is basicaly a line of code, different kernels control different operations for different systems within the computers program.

The closest thing to obtainging a true "kernel mode" is to run an open source Operating system like linux.

With something like windows you can obtain through administrative tools access to operating system programms, you can't truly rewrite (easily) the programs within your system.

A process transitions from user mode to kernel mode usually with some form of software interrupt. On x86 CPU's, the "INT 0x80" instruction is commonly used for running system calls. The kernel traps this software interrupt, processes the request, and returns to user mode by returning from the interrupt. This describes how real operating systems like Linux and FreeBSD work. Windows may work similarly to this, but it's not a real operating system anyway.

A modern symmetrically multi-processing operating system typically, today, consists of millions of lines of code. Most of these, eg Windows, Linux, FreeBSD, NetBSD, OpenBSD among many others, are written in the 'C/C++' programming language.

The above mentions INT 0x80 as being used on x86 CPUs, the author above is absolutely correct, though the answer could be further refined to say that INT 0x80 is specific to the Linux operating system kernel as being the maskable software interrupt used to invoke a system call (whether that be on ring -1, ring 0 or another ring if other rings are available on a given architecture - eg, VMware probably supports ring -1 on architectures supporting ring -1 so that guest operating systems may have free access to ring 0). That may well be the longest sentence I've ever written. :)

As INT 0x80 is a Linux maskable interrupt, it would also be used on other architectures as well such as Sun Microsystems SPARC or Digital Equipment Corporation VAX machines.

System calls (or SysCall/SysEnter) are used for many other purposes, particularly to access various hardware devices such as locally attached disk drives, USB devices, SCSI devices, Network (eg Ethernet [including Arcnet or Token Ring, assuming such things still exist]) cards or other bus attached devices etc.

I must agree with the above author's last sentence as well, though a Rockwell International engineer I once knew classified Windows as a 'virus' as opposed to a 'real' operating system like Linux (probably because Windows tends to proliferate as well as wreak havoc upon it's users).

Written list of the differences between the operations approach and the behavioral sciences approach?

The operations approach is a production oriented area of management. It helps to improve efficiency, improve quality and cut wastes. Behavioral sciences approach is a humanistic approach that deals with human relations movement.

Terminology of front office?

their is lots of terms using in front office, please ask specific terms.

How do you form the union of kalmar?

If you're talking about kingdoms, you get the cities which you get told to take in a message, once u have got them all kill the Norwegian king Are you seriously asking for someone to help you correct the grammar

How do you capture the output of C program in to another C program?

HI

You can first include the 1st program in ur 2nd program using # include<..> and then whatever be the output from frst it can be used in second program.

pankaj

That's what popen is good for. Read the manual.

Why do you have to use the return type for the main function in c language i mean to what does the main function have to return the value to?

It returns the value to the operating system or whatever process launched it. If you launched your program from a batch file then the batch file can detect this return value. If your program is spawned or launched by another program then the return value goes to that parent prgoram or process.

One more thing is that you can write main() without the return type and it will be absolutely correct

How is 0.9999999999999999999999 equals to 1?

Usually some number will have a recuring decimal, such as one third is 0.333333 and the threes go on forever. If the number is 0.9 and the 9's go on forever there is no practical use in using that number when the difference is so incredibly small that its approximated to 1.

What type of data does MOV store?

In x86, a MOV instruction can store bytes (8-bit quantities), words (16-bit quantities), and double-words (32-bit quantities). In AT&T syntax, the type of data being stored is determined by a suffix at the end of the instruction:

movb - move byte

movw - move word

movl - move double-word (also called a long)

In Intel syntax - which doesn't use these suffixes - the data type is determined from context by looking at the names of the registers specified in the operands. A MOV instruction referring to %eax, for example, would store a double-word (since %eax is a 32-bit register).

Real time example for event driven programming?

A Atm it waits for you too put your card it and from then on out it gives you sytep by step instructions on what you can do with your card each button you press is another event.

What is code4green does?

http://www.Code4Green.com is a FREE online code generation website that helps programmers around the world with their repetitive tasks in C#, SQL, ASP.Net, VB.Net, Java and other cool technologies. In doing so, it helps our planet by planting more trees as more and more lines of code are generated.

What is the decimal value of 101110?

The method for converting a base of 2 into a base of 10 is really simple.

Take your number 101110, now start from the right side of the number and assign to each 0 and 1 a power of two, starting from 2^0 (2^0 = 1).

0*2^0 + 1*2^1 + 1*2^2 + 1*2^3 + 0*2^4 + 1*2^5

the value of the number in the base of 10 that you are looking for is the sum

0 + 2 + 4 + 8 + 0 + 32 = 46

Which is the best SCADA software?

Out of all the programs we've used, I think InduSoft Web Studio is the most compatible, most stable, and has the best technical support. It works with OPC, and it comes with a LOT of drivers already included. It also runs on anything with a Microsoft OS.

The best SCADA software is definitely InduSoft Web Studio.

Why you can not use this pointer in static functions?

Because this points to the current object, but static methods don't have a current object (actually this is definition of the static methods).

Among assembly and machine language which is low level language?

They are both low level. Machine code has no abstraction whatsoever so it could be regarded as being no-level rather than low-level. However, there are very few instances where a programmer has to "bang the metal" and write machine code by hand. That's precisely the reason we wrote assemblers and compilers in the first place!

How many bits in a word?

A word typically refers to a 16-bit quantity, where 32-bits is called a longword.