Pages

Search in This Blog

Showing posts with label processor. Show all posts
Showing posts with label processor. Show all posts

Wednesday, 15 February 2012

interfacing 7 segment display with 8086 processor


Statement: Program to interface 8086 microprocessor kit with Seven Segment Display and make any digit to Blink
Description:
In this program we interface 8086 microprocessor with Seven Segment Display and diaplay a digit.  To interface with Seven Segment Display,we must be familiar with 8255A PPI, which has three ports which can be used as I/O ports. The ports A, B and C are identified using addresses 19H, 1BH, and 1DH respectively and control register address is 1FH. We use Seven Segment Display structure using the following digit



Digit
Hexadecimal
Decimal
Binary
8
0
1
2
3
4
5
6
7
8
9
C0
F9
A4
B0
99
92
82
F8
80
90
192
249
164
176
153
146
130
248
128
144
11000000
11111001
10100100
10110000
10011001
10010010
10000010
11111000
10000000
10010000
code: 

Source program:
 MOV AL,10000000B
 OUT PPI_C, AL
STR:   MOV AL, 10011001B
 OUT PPIA,AL
 MOV CX, FFFFH
DEL:    NOP
 NOP
 NOP
 LOOP DEL
 MOV AL, 11111111B
 OUT PPIA, AL
 MOV CX, FFFFH
DEL1:    NOP
 NOP
 NOP
 LOOP DEL1
 JMP  STR
 HLT

Sunday, 22 January 2012

work with MASM

Here we go with MASM means Macro ASseMbler

download MASM  32 bit here

Installing MASM32

Target OS versions
The MASM32 SDK is designed to install on Windows operating system versions from WIN2000 upwards. It is not designed to install on earlier Win9x systems or Windows ME.

Installation Safety Design
The MASM32 SDK is targeted at experienced programmers who routinely have multiple development environments setup and configured on their development computer.

Safety for the experienced developer is as follows,
(1) The MASM32 SDK does not write any files to the operating system.
(2) The MASM32 SDK is registry safe and writes nothing to the registry.
(3) The MASM32 SDK does not set up any file extensions and does not steal file extensions from existing applications.
(4) The MASM32 SDK does not depend on any other application for its operation.
(5) The MASM32 SDK is free of DLL Hell.
(6) The MASM32 SDK is DEP safe, it runs on a fully DEP enabled computer.

At the end of the installation a choice is offered to set up an icon on the desktop using a simple VBS script, its contents are displayed and you have the option of using it or not. This safety comes at the price that the programmer who wants to use the advanced capacity of the MASM32 SDK must have sufficient technical knowledge to configure their development computer so that the MASM SDK can be installed.

Assumptions Of The Installation
The installation assumes that,
(a) The computer is correctly configured and is completely free on any trojan/rootkit/viral damage or infection.
(b) The installation is being performed with ADMINISTRATIVE RIGHTS that allow software to be installed.
(c) The installation can write files to disk without the process being obstructed or damaged by computer settings or security software.

Secure Origin Of The MASM32 SDK Content
The MASM32 SDK is built in a completely isolated environment from its own source code and is completely free of any trojan/rootkit/viral transmission code. It has been successfully installed on millions of development computers over a period in excess of 10 years and the only problems that have ever occurred come from false positives in downmarket AV software. The contents of the MASM32 SDK are DEP SAFE and were re-written when Microsoft introduced the new security modification to the Portable Executable specifications to protect computers from a variety of stack based exploits.

Common Problems With Inexperienced Users
(1) The computer is infected with either a trojan/root kit or virus and interferes with the installation by obstructing the file write to disk process.
SOLUTION : Either completely repair the operating system installation ensuring it is free from any infection or damage or do a full installation of the operating system to ensure it is working correctly.

(2) The person installing the MASM32 SDK does not have sufficient Administrative rights to install software.
SOLUTION : Change to the Administrative Profile before attempting to install the software.

(3) Anti-virus and/or similar security software obstructs the installation of the MASM32 SDK.
SOLUTION : Configure, change or remove the AV software so that it does not interfere with the installation of the MASM32 SDK.

This has primarily been a problem for inexperienced users who are using free security software downloaded  from the internet. While reputable AV and security software vendors produce commercial products that properly understand the Microsoft Portable Executable specifications, much of the BETA level freeware available on the internet does not properly do this and regularly delivers FALSE POSITIVES on software that is completely free of any infection. At a design level this follows from the AV product using a naive dictionary approach coupled with poorly designed heuristic scanning methods. The result when using this style of junk is that the AV software often silently removes programs that it does not understand without advising the user and damages the installation of the software.

There is no solution to this problem from the installation end without interfering with the operating system, something that the MASM32 SDK does not do by design. To successfully install the MASM32 SDK you must have the appropriate Administrative rights and the computer must be clean from viral/trojan infections and be configured to allow an installation to write to disk. Unfortunately vendors of this CRAP are protecting their commercial interests by trying to appear as if their software is protecting your computer where in fact their lack of experience exposes end users to risks of large scale unrecoverable damage.

Securing A Development Computer
While most experienced users already know how to protect a development computer, for the small developer or student/person learning a programming environment there are a number of basic guidelines that help to protect a development computer without strangling it with security restrictions designed to protect non-technical users.

(1) Configure the DSL or similar router so that it uses the internal firewall, enables "Stateful Packet Inspection" (SPI) and "Network Address Translation" (NAT) and do not use any form of tunneling that bypasses the router setup. This is particularly important as it cannot be altered by the operating system so even if the operating system is compromised, the router is not and its security features still work.

(2) Unless you know exactly what you are doing with the firewall in  late versions of Windows, disable it completely and install a manual setup firewall that allows you to block specific ports and protocols.

(3) Examine the running services on your computer and TURN OFF those that you don't need. Things like remote management, TAPI, FTP and HTTP servers are rarely ever required by a home developer and by turning OFF services of this type, the vulnerable surface area of the computer is reduced. Do not install the IIS internet server option on a development machine as it is subject to new exploits on a regular basis.

(4) NEVER EVER share the boot partition of a development computer. If you need to transfer data from a development computer to another computer in your LAN, set up a directory on another partition on your development computer that has two (2) subdirectories, "upload" and "download". Set up the directories as shared with read only access to the "download" directory  and normal read/write access for the "upload" directory. You are safer if you share nothing and use a shared drive/directory on another computer in your LAN to write data to when needed.

(5) If you must use your development computer to handle email there are a number of steps that reduce your risk.

(a) Install software that reads the available email on the email server you use WITHOUT downloading it. This allows you to check what is there and delete any of the junk you don't want without it ever being on your computer.

(b) If your email software automatically downloads email, TURN THE OPTION OFF, only download email when you choose to do so. Malicious software that is never downloaded onto your computer can never do it any harm.

(c) If you must run AV or similar security software, use proven reliable products. Eset's NOD32 and Kaspersky are professional well written products that can be configured properly. Avoid any form of automatic scanning and only operate the software on a needs basis.

Running Security Risks In A Sandbox
If you know what you are doing and properly secure a development computer you can be free of the virus/anti-virus merry go round and be in full control of your development computer but the weakest point in computer security is you the user, no matter what you installation and configuration may happen to be, if you run something that is dangerous you can damage your computer's operating system installation.

If you must do dangerous things like downloading junk from the internet or email that may contain dangerous attachments, do it in a sandbox, install a Virtual Machine on your computer, set up the browser and email programs you want and if the worst happens, you can just shut it down, replace the virtual hard drive file with a backup and no harm is done.

The Final Solution For Computer Security
Obtain a reliable disk imaging program, Norton Ghost, Acronis True Image and similar and learn how to use it correctly. Make a backup image of your BOOT partition and save that file on another partition on your computer. Software like Acronis has the capacity to create a bootable CD so that you can boot the damaged computer from the CD and restore the disk image file saved on another partition. This approach has two (2) major advantages, it cannot be beaten as it completely overwrites the damaged operating system installation and it usually takes less than five (5) minutes to perform.

for more info click

Thursday, 12 January 2012

8086 processor just glance


1. Define pipelining?
Ans: In 8086, to speedup the execution of program, the instructions fetching and execution of instructions are overlapped each other. This technique is known as pipelining. In pipelining, when the n th instruction is executed, the n+1 th instruction is fetched and thus the processing speed is increased.
2. Discuss the function of instruction queue in 8086?
Ans: In 8086, a 6-byte instruction queue is presented at the Bus Interface Unit (BIU). It is used to prefetch and store at the maximum of 6 bytes of instruction code from the memory. Due to this, overlapping instruction fetch with instruction execution increases the processing speed.
3. What is the maximum memory size that can be addressed by 8086?
Ans: In 8086, an memory location is addressed by 20 bit address and the address bus is 20 bit address and the address bus is 20 bits. So it can address up to one mega byte (2^20) of memory space.
4. What is the function of the signal in 8086?
Ans: BHE signal means Bus High Enable signal. The BHE signal is made low when there is some read or write operation is carried out. ie . When ever the data bus of the system is busy i.e. whenever there is some data transfer then the BHE signal is made low.
5.What are the predefined interrupts in 8086?
Ans: The various predefined interrupts are,
DIVISION BY ZERO -- (type 0) Interrupt.
SINGLE STEP          -- (type 1) Interrupt.
NONMASKABLE        -- (type2) Interrupt.
BREAK POINT         -- (type 3) Interrupt.
OVER FLOW           -- (type 4) Interrupt.
6. What are the different flag available in status register of 8086?
Ans: There are 6 one bit flags are present. They are,
AF - Auxiliary Carry Flag
CF - Carry Flag
OF - Overflow Flag
SF - Sign Flag
PF - Parity Flag
ZF - Zero Flag
7. List the various addressing modes present in 8086?
Ans: There are 12 addressing modes present in 8086. They are,
(a) Register and immediate addressing modes
  • Register addressing modes
  • Immediate addressing mode
(b) Memory addressing modes.
  • Direct addressing modes
  • Register indirect addressing modes
  • Based addressing modes
  • Indexed addressing modes
  • Based Indexed addressing modes
  • String addressing modes
(c) I/O addressing modes
  • Direct addressing mode
  • Indirect addressing mode
(d) Relative addressing mode
(e) Implied addressing mode
8. How single stepping can be done in 8086?
Ans: By setting the Trace Flag (TF) the 8086 goes to single-step mode. In this mode, after the execution of each instruction s 8086 generates an internal interrupt and by writing some interrupt service routine we can display the content of desired registers and memory locations. So it is useful for debugging the program.
9. State the significance of LOCK signal in 8086?
Ans: If 8086 is working at maximum mode, there are multiprocessors are present. If the system bus is given to a processor then the LOCK signal is made low. That means the system bus is busy and it cannot be given of any other processors. After the use of the system bus again the LOCK signal is made high. That means it is ready to give the system bus to any processor.
10. What are the functions of bus interface unit (BIU) in 8086?
Ans:
(a) Fetch instructions from memory.
(b) Fetch data from memory and I/O ports.
(c) Write data to memory and I/O ports.
(d) To communicate with outside world.
(e) Provide external bus operations and bus control signals.
11. What is the clock frequency of 8086?
Ans:
 Microprocessor80868086-28086-4
Internal clock Frequency5 MHz8MHz4MHz
External Clock Frequency 15MHZ24MHZ12MHZ
12. What are the two modes of operations present in 8086?
Ans:
i. Minimum mode (or) Uniprocessor system
ii. Maximum mode (or) Multiprocessor system
13. Explain the process control instructions
Ans:
STC – It sets the carry flag & does not affect any other flag
CLC – it resets the carry flag to zero &does not affect any other flag
CMC – It complements the carry flag & does not affect any other flag
STD – It sets the direction flag to 1 so that SI and/or DI can be decremented automatically after execution of string instruction & does not affect other flags
CLD – It resets the direction flag to 0 so that SI and/or DI can be incremented automatically after execution of string instruction & does not affect other flags
STI – Sets the interrupt flag to 1. Enables INTR of 8086.
CLI – Resets the interrupt flagto0. 8086 will not respond to INTR.
14. Explain REPEAT-UNTIL statements
Ans:  REPEAT-UNTIL statements allow executing a series of instructions repeatedly until some condition occurs. The REPEAT defines the start of the loop & UNTIL the end of the loop. UNTIL has a condition when the condition is true the loop is terminated.
15. What is the purpose of segment registers in 8086?
Ans:There are 4 segment registers present in 8086. They are
1. Code Segment (CS ) register - The code segment register gives the address of the current code segment. ie. It will points out where the instructions, to be executed, are stored in the memory.
2. Data Segment (DS ) register - The data segment register points out where the operands are stored in the memory.
3. Stack Segment (SS ) register - The stack segment registers points out the address of the current stack, which is used to store the temporary results.
4. Extra Segment (ES ) register - If the amount of data used is more the Extra segment register points out where the large amount of data is stored in the memory.
16. What is assembler?
Ans: The assembler translates the assembly language program text which is given as input to the assembler to their binary equivalents known as object code. The time required to translate the assembly code to object code is called access time. The assembler checks for syntax errors & displays them before giving the object code.
17. What is loader?
Ans:The loader copies the program into the computer’s main memory at load time and begins the program execution at execution time.
18. What is linker?
A linker is a program used to join together several object files into one large object file. For large programs it is more efficient to divide the large program modules into smaller modules. Each module is individually written, tested & debugged. When all the modules work they are linked together to form a large functioning program.
19. Explain ALIGN & ASSUME:
Ans: The ALIGN directive forces the assembler to align the next segment at an address divisible by specified divisor. The format is ALIGN number where number can be 2, 4, 8 or 16. Example ALIGN 8.
The ASSUME directive assigns a logical segment to a physical segment at any given time. It tells the assembler what address will be in the segment registers at execution time. Example ASSUME CS: code, DS: data, SS: stack
20. Explain PTR & GROUP
Ans: A program may contain several segments of the same type. The GROUP directive collects them under a single name so they can reside in a single segment, usually a data segment. The format is Name GROUP Seg-name,…..Seg-name PTR is used to assign a specific type to a variable or a label. It is also used to override the declared type of a variable.
21. What are the three classifications of 8086 interrupts?
Ans:
(1) Predefined interrupts
(2) User defined Hardware interrupts
(3) User defined software interrupts.
22. What are the functions of status pins in 8086?
Ans:
S2S1S0Functions
000Interrupt acknowledge
001Read I/O
010Write I/O
011Halt
100Code access
101Read memory
110Write memory
111inactive

S4S3Functions
00I/O from extra segment
01I/O from Stack Segment
10I/O from Code segment
10I/O from Data segment

S5 --Status of interrupt enable flag
S6 --Hold acknowledge for system bus
S7 --Address transfer.
23. What are the schemes for establishing priority in order to resolve bus arbitration problem?
Ans: There are three basic bus access control and arbitration schemes
1. Daisy Chaining
2. Independent Request
3. Polling
24.What are the different types of methods used for data transmission?
Ans: The data transmission between two points involves unidirectional or bi-directional transmission of meaningful digital data through a medium. There are basically there modes of data transmission.
(a) Simplex
(b) Duplex
(c) Half Duplex
In simplex mode, data is transmitted only in one direction over a single communication channel.For example, a computer (CPU) may transmit data for a CRT display unit in this mode.
In duplex mode, data may be transferred between two transreceivers in both directions simultaneously.
In half duplex mode, on the other hand, data transmission may take pace in either direction, but at a time data may be transmitted only in one direction. For example, a computer may communicate with a terminal in this mode. When the terminal sends data (i.e. terminal is sender). The message is received by the computer (i.e the computer is receiver). However, it is not possible to transmit data from the computer to terminal and from terminal to the computer simultaneously.
25.What are the various programmed data transfer methods?
Ans:
i) Synchronous data transfer
ii) Asynchronous data transfer
iii) Interrupt driven data transfer
26. What is synchronous data transfer?
Ans: It is a data method which is used when the I/O device and the microprocessor match in speed. To transfer a data to or from the device, the user program issues a suitable instruction addressing the device. The data transfer is completed at the end of the execution of this instruction.
27. What is asynchronous data transfer?
Ans: It is a data transfer method which is used when the speed of an I/O device does not match with the speed of the microprocessor. Asynchronous data transfer is also called as Handshaking.
28.What are the different inter connection topologies?
Ans:
  • Shared bus
  • Multiport Memory
  • Linked Input/Output
  • Bus window
  • Crossbar Switching.
29. What are the configurations used for physical interconnections?
Ans:
  • Star Configuration
  • Loop configuration
  • Complete interconnection
  • Regular topologies
  • Irregular topologies
30. Give the instruction set of 8087?
Ans:
1. Data Transfer Instructions
2. Arithmetic Instructions
3. Comparison Instructions.
4. Transcendental Operations.
5. Constant Operations.
6. Coprocessor Control Operations.

Sunday, 8 January 2012

One shot 8085

Interview question of 8085



  1. What are the various registers in 8085? - Accumulator register, Temporary register, Instruction register, Stack Pointer, Program Counter are the various registers in 8085 .
  2. In 8085 name the 16 bit registers? - Stack pointer and Program counter all have 16 bits.
  3. What are the various flags used in 8085? - Sign flag, Zero flag, Auxillary flag, Parity flag, Carry flag.
  4. What is Stack Pointer? - Stack pointer is a special purpose 16-bit register in the Microprocessor, which holds the address of the top of the stack.
  5. What is Program counter? - Program counter holds the address of either the first byte of the next instruction to be fetched for execution or the address of the next byte of a multi byte instruction, which has not been completely fetched. In both the cases it gets incremented automatically one by one as the instruction bytes get fetched. Also Program register keeps the address of the next instruction.
  6. Which Stack is used in 8085? - LIFO (Last In First Out) stack is used in 8085.In this type of Stack the last stored information can be retrieved first.
  7. What happens when HLT instruction is executed in processor? - The Micro Processor enters into Halt-State and the buses are tri-stated.
  8. What is meant by a bus? - A bus is a group of conducting lines that carriers data, address, & control signals.
  9. What is Tri-state logic? - Three Logic Levels are used and they are High, Low, High impedance state. The high and low are normal logic levels & high impedance state is electrical open circuit conditions. Tri-state logic has a third line called enable line.
  10. Give an example of one address microprocessor? - 8085 is a one address microprocessor.
  11. In what way interrupts are classified in 8085? - In 8085 the interrupts are classified as Hardware and Software interrupts.
  12. What are Hardware interrupts? - TRAP, RST7.5, RST6.5, RST5.5, INTR.
  13. What are Software interrupts? - RST0, RST1, RST2, RST3, RST4, RST5, RST6, RST7.
  14. Which interrupt has the highest priority? - TRAP has the highest priority.
  15. Name 5 different addressing modes? - Immediate, Direct, Register, Register indirect, Implied addressing modes.
  16. How many interrupts are there in 8085? - There are 12 interrupts in 8085.
  17. What is clock frequency for 8085? - 3 MHz is the maximum clock frequency for 8085.
  18. What is the RST for the TRAP? - RST 4.5 is called as TRAP.
  19. In 8085 which is called as High order / Low order Register? - Flag is called as Low order register & Accumulator is called as High order Register.
  20. What are input & output devices? - Keyboards, Floppy disk are the examples of input devices. Printer, LED / LCD display, CRT Monitor are the examples of output devices.
  21. Can an RC circuit be used as clock source for 8085? - Yes, it can be used, if an accurate clock frequency is not required. Also, the component cost is low compared to LC or Crystal.
  22. Why crystal is a preferred clock source? - Because of high stability, large Q (Quality Factor) & the frequency that doesn’t drift with aging. Crystal is used as a clock source most of the times.
  23. Which interrupt is not level-sensitive in 8085? - RST 7.5 is a raising edge-triggering interrupt.
  24. What does Quality factor mean? - The Quality factor is also defined, as Q. So it is a number, which reflects the lossness of a circuit. Higher the Q, the lower are the losses.
  25. What are level-triggering interrupt? - RST 6.5 & RST 5.5 are level-triggering interrupts.

Friday, 6 January 2012

8085 processor arcitecture

8085 ARCHITECTURE
8085 arcitecture


pin description>>














MICROPROCESSOR:

A microprocessor is a multipurpose, programmable logic device that reads binary instructions from a storage device called memory accepts binary data as input and processes data according to those instructions and provides result as output.

POWER SUPPLY & CLOCK FREQUENCY OF 8085:

The power supply of 8085 is +5V and clock frequency in 3MHz.

Applications of microprocessor-based system:



It is used:

i. For measurements, display and control of current, voltage, temperature, pressure, etc.
ii. For traffic control and industrial tool control.
iii. For speed control of machines.
FUNCTIONS OF AN ACCUMULATOR:


The accumulator is the register associated with the ALU operations and sometimes I/O operations. It is an integral part of ALU. It holds one of data to be processed by ALU. It also temporarily stores the result of the operation performed by the ALU.



16 – BIT REGISTERS OF 8085 MICROPROCESSOR:



Stack pointer (SP) and Program counter (PC).




REGISTER PAIRS OF 8085:

*B-C register pair
*D-E register pair
*H-L register pair

STACK AND STACK RELATED INSTRUCTIONS:

The stack is a group of memory locations in the R/W memory that is used for the temporary storage of binary information during the execution of the program.
The stack related instructions are PUSH & POP.

COMPARISON CALL AND PUSH INSTRUCTIONS:
CAL AND PUSH

COMPARISON RET AND POP:
RET AND POP

PURPOSE OF SID AND SOD LINES:

SID (Serial input data line):       It is an input line through which the microprocessor accepts serial data.
SOD (Serial output data line):   It is an output line through which the microprocessor sends output serial data.


OPCODE:

The part of the instruction that specifies the operation to be performed is called the operation code or Opcode.

FUNCTION OF IO/M SIGNAL IN THE 8085:

It is a status signal. It is used to differentiate between memory locations and I/O operations.
*When this signal is low (IO/M = 0) it denotes the memory related operations.
*When this signal is high (IO/M = 1) it denotes an I/O operation.

OPERAND:


The data on which the operation is to be performed is called as an Operand.




HOW MANY OPERATIONS ARE THERE IN THE INSTRUCTION SET OF 8085 MICROPROCESSOR?



There are 74 operations in the 8085 microprocessor.



ADDRESS LINES IN A 4096 X 8 EPROM CHIP:



12 address lines.



CONTROL SIGNALS USED FOR DMA OPERATION ARE __________



Ans: HOLD & HLDA.



WAIT STATE:



This state is used by slow peripheral devices. The peripheral devices can transfer the data to or from the microprocessor by using READY input line. The Microprocessor remains in wait state as long as READY line is low. During the wait state, the contents of the address, address/data and control buses are held constant.



FLAGS:



FLAG



The flags are used to reflect the data conditions in the accumulator. The 8085 flags are S-Sign flag, Z-Zero flag, AC-Auxiliary carry flag, P-Parity flag, CY-Carry flag