You are on page 1of 12

what are som common applications of microprocessor and microcontrollers that uses

assembly language as their core or basic language


Assembly language is used to program 8051/8052 microcontrollers. You can also visit
this site "http://www.8052.com/codelib" for information.

1st lecture example regarding colors Please explain it briefly with Example and also
explain "Precision is involved and only numbers are precise in this world. One will
always be one and two will always be two."

Color example is just to tell about the precision. As the first lecture describe how
precision is necessary, for example if we want to process a picture and picture is 300 DPI.
Then on every inch there will be a number of pixels. And if the picture which we want to
process in this picture the information is not precise then processor has to do some extra
work. So information must be precise. Now in the 2nd part of the statement processor sees
the information in term of numbers. As we know data stored in memory, and there must
be index number of every data if processor want to fetch data (which address is for
example 100) from memory. So it means it exactly fetch 100 place data, not more not
less. So therefore the phrase is quote in the lecture that one means one and two mean two.
I hope you got your answer.

kindly define with example to clear my idea about "Control bus"


There are three buses used in computer for performing all computer functions. Data Bus
Address Bus Control Bus A control bus is (part of) a computer bus, used by CPUs for
communicating with all other devices within the computer. The control bus carries
commands from the CPU and returns status signals from the devices. Example: If the
data is being read or written to the device the appropriate line (read or write) will be
active. These are the basic control lines in computer.

Why we study assembly language? Is there any scope of this in market? We have seen in
advertisement that there is no any scope of assembly language.
There is still lot of jobs available in assembly language with effective salary
package. Last time a job that I see somewhere, I post it there.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""''
"Baltoros is a technology consultancy startup company incubated at
the National University of Sciences & Technology (NUST),Islamabad, Pakistan. Baltoros
team has extensive research and development experience with over 100 high-quality
research publications, several pending patents, and many successfully completed research
projects. Baltoros is not a typical technology outsourcing firm. Our core competence is in
providing timely and industry-leading solutions to hard problems in computer networks,
operating systems and information/network security. We are hiring people with following
skills. Post: Design Engineer Number of Posts: Multiple Education: BSCS Skills
Required: C Language Data Structure Operating System Concepts Assembly Language"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Actually it depends upon job nature. Mostly embedded systems being developed in
assembly language. Such as robotics, Army defending system. And many more.
Define with example to clear my idea about "Control bus
There are three buses used in computer for performing all computer functions. Data Bus
Address Bus Control Bus A control bus is (part of) a computer bus, used by CPUs for
communicating with all other devices within the computer. The control bus carries
commands from the CPU and returns status signals from the devices. Example: If the
data is being read or written to the device the appropriate line (read or write) will be
active. These are the basic control lines in computer.

Sir I am confused you in your very 1st lecture example regarding colors Please explain it
briefly with Example and also explain "Precision is involved and only numbers are
precise in this world. One will always be one and two will always be two."

Color example is just to tell about the precision. As the first lecture describe how
precision is necessary, for example if we want to process a picture and picture is 300 DPI.
Then on every inch there will be a number of pixels. And if the picture which we want to
process in this picture the information is not precise then processor has to do some extra
work. So information must be precise. Now in the 2nd part of the statement processor sees
the information in term of numbers. As we know data stored in memory, and there must
be index number of every data if processor want to fetch data (which address is for
example 100) from memory. So it means it exactly fetch 100 place data, not more not
less. So therefore the phrase is quote in the lecture that one means one and two mean two.
I hope you got your answer.

i want to aske about regiter whats it porpose and about segments, what is assembly
version how to understand it,we have to workwith it
Register is a special, high-speed storage area within the CPU. All data must be
represented in a register before it can be processed. For example, if two numbers are to be
multiplied, both numbers must be in registers, and the result is also placed in a register.
The register can contain the address of a memory location where data is stored rather than
the actual data itself.

Now a days computer memory is divided into portions and one of that portion can be
addressed by single index register we call that memory portion a Segment.

Assembly language has only one version that is assembly language version. We will
write all programs in assembly language that will run on assembler "nasm" and debugged
through "afd debugger". We introduce the English language version only for your
understanding that how in our language a program can be.

the text books that resemble to the lectures.


" Assembly Language for Intel Based Computers by Kip Ervie 4th edition"
as Buses are (8 bit, 16 bit, 32 bit) etc do the registers are same as registers mean registers
also have (8 bit, 16 bit, 32 bit) etc.
Although buses and registers can be of 8bits, 16 bits and 32 bits. But these two are
different. Buses are the carriers of data, control signals and address of memory locations.
Where as registers are the locations that hold data for short time. We can also say "a
special, high-speed storage area within the CPU. All data must be represented in a
register before it can be processed." For example, if two numbers are to be multiplied,
both numbers must be in registers, and the result is also placed in a register. The register
can contain the address of a memory location where data is stored rather than the actual
data itself.

Adding two 16 binary bits.


If we add two sixteen bit binary number and if no carry is generated the answer will be in
16 bit, but if carry is generated the answer will exceed sixteen bit,i.e. 17 bits, but if we
have not enough space the answer will be wrap up mean in also 16 bit.

How does flags register work? What is the importance of it in Processor?


Dear Student The FLAGS register is the status register that contains the current state of
the processor. This register is also of 8bit, 16 bit or 32 bit. But it is different from other
registers in a sense that its all bits are acting separately. It means if it is of 8 bit then Its
first bit can be "carry flag" Second "zero flag" Third "sign flag" etc. or The bits of the
flags register work independently and individually, and combined its value is
meaningless.
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
F E D C B A 9 8 7 6 5 4 3 2 1 0
S Z C

i want to know the application of assembly language in different fields of science and
engineering.
Assembly language is used primarily for direct hardware manipulation, access to specialized
processor instructions, or to address critical performance issues. Typical uses are device
drivers, low-level embedded systems, and real-time systems.

Debugger the value changes in the ax and bx registers


but the value does not change in memory area after the
execution of each instruction shown on the right side of
debugger
First you run your program in debugger through F2 key, then see the memory area also
go the to the particular memory location through m1 ds: (address of that location where
the ax is lie) and set the memory window 2 with m2 ds:(address of that memory location
where bx is lie ) then check the value by pressing F2 key.
if we use db it show 05 and if we use dw it shows 0500. Where it show the same value
Sir what are embeded systems and real time systems.

Embedded System:
Embedded system is a computer system designed to perform some specific task often
with real-time computing constraints. It is embedded as part of a complete device often
including hardware and mechanical parts.

Physically, embedded systems range from portable devices, such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the
systems controlling nuclear power plants. Complexity varies from low, with a single
microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.

Real Time System:


In real-time computing (RTC), or reactive computing, is the study of hardware and
software systems that are subject to a "real-time constraint" i.e., operational deadlines
from event to system response.
A real time system may be one where its application can be considered (within context)
to be mission critical. The anti-lock brakes on a car are a simple example of a real-time
computing system. The real-time constraint in this system is the short time in which the
brakes must be released to prevent the wheel from locking. Real-time computations can
be said to have failed if they are not completed before their deadline, where their deadline
is relative to an event. A real-time deadline must be met, regardless of system load.

As it is mentioned that 8080 and 8085 could access a total memory of 64k using 16 lines
of their address bus. I want to know that how 16 bits are used to access the 64k memory?
The 16bit are use to access the 64K. If we do 2 Raise to Pow 16 = 65536, and if we
divide 65536/1024 (which is 1KB ) = 64 KB. I hope you got your answer.

As you have described that the memory of iAPX88 is divided in many functional
windows and each window has size of 64k so that the software of 8085 can be fit in the
window. So my question is,

will the every window 1MB memory of iAPX88 has its separete software in in it?

iAPX88 cannot run on a single software?

In IAPX88, window size is still 64K and by shifting this window up/down we can access
whole 1MB memory. If a program wants to access two memory locations that are more
than 64K apart, two different values must be used in the segment register to do so.
Similarly, if the program itself is bigger than 64K, the segment register that points to the
code area must be changed when the program rolls over or jumps into a section of code
that cannot be reached with the current segment register and program counter. I hope you
got your answer.

what Caches are .Are they kind of regesteres


Cache is a component that improves performance by storing the data such that future
requests for that data are served faster than earlier. Hardware implements cache as a
block of memory for temporary storage of data likely to be used again. Cache can be a
CPU cache or memory (disk) cache.
What are the current chalenging issues of speed of computer and their emerging date
solution?
There are many chellenging issues related to dspeed of computer.Ths main and biger one
is processor speed fastening For this purpose new processors are designed with new
technolgoies called "Corei". You can search about these.
Also certain issues are related to operating systems and their compatibilities with new
softwares.

every time “move” not using B8


B8 is the opcode of when we move any constant into ax, and BB is the opcode when we
move any constant into the BX.

1 1 2 3 4 5 6 7 8 9 A B C D E F

DS:0119 00 CD FF 24 FF 1B 23 56 65 OF 1E 01 09 2A 0B
12 34 56

DS:0121 OF 1E 01 09 2A 0B 24 FF 1B 23 24 FF 1B 23 07 21
43 65

Suppose it is the memory window in the debugger and I want to know that the valued on
left side of Memory Window(DS:0119 , DS:0119 etc) Are these values called Offset?

Secondly I want to know that the values given on the top of this window, What will we
call them?

Yes these value are called offset, and in your 2 nd question these are also offset for
example if one location is DS:0117. then top values are showing further offset locations.
7 8 9 A B C D E F 0 1 2
…….

Now as in our example at offset 0117 the value is 05. Now the next location is 0118
similarly next is 0119 and so far so these are also offsets (we can say memory locations).

What is direct addressing?

How many types of an Operand are?

What is an Immediate Operand?

In direct addressing, the instruction tells where the value can be found, but the value
itself is out in memory.It means the part of instruction contain the address of memoray
where the operand is residing.
There are three types of operands with respect to their addressing mode.
Immediate
Register
Memory

Immediate addressing is one where the instruction itself contains the value to be used for
processing and that value is called immediate operand becase we have no need to address
the memory to access that value.
Help me in understanding of addressing modes, easily.
Addressing mode:
The iAPX88 processor supports seven modes of memory access.
Remember that immediate is not an addressing mode but an operand type.
Operands can be immediate, register, or memory.
If the operand is memory one of the seven addressing modes will be used to access it.
The memory access mechanisms can also be written in the general form as
“base + index + offset”;
And we can define the possible addressing modes by saying that any one, two, or none
can be skipped from the general form to form a legal memory access.
Direct: “mov [1234], ax “ .Direct offset “1234 is in instruction and contents of ax are
moved at memory location 1234.
Based Register Indirect: “mov [bx], ax” moves the two byte contents of the AX register
to the address contained in the BX register in the current data segment.
Indexed Register Indirect: “mov [si], ax” moves the contents of the AX register to the
word starting at address contained in SI in the current data segment.
Based Register Indirect + Offset: “mov [bx+300], ax” stores the word contained in AX
at the offset attained by adding 300 to BX in the current data segment.
Indexed Register Indirect + Offset: “mov [si+300], ax” moves the word contained in
AX to the offset attained by adding 300 to SI in the current data segment.
Base + Index: “mov [bx+si], ax” moves the word contained in the AX register to offset
attained by adding BX and SI in the current data segment.
Base + Index + Offset: “mov [bx+si+300], ax” moves the word contents of the AX
register to the word in memory starting at offset attained by adding BX, SI, and 300 in
the current data segment.

Explain segment association,wraparound ,sumary of addressing mode pls sir explain me i m so


confuse
Segment Association:
As we know that the memory is divided in functional parts or window, one for code, one
for data. We see every window through its own window. If we see code section we don’t
see data section and vice versa.
At a time in memory four windows exist;
• one is CS (code window) hold the base point of code,
• then DS ( Data segment ) hold the base point of data
• then SS (Stack Segment ) hold the base point of stack segment
• and ES (Extra segment ) it use only for data movement.
Now we come to the segment association point.
As we know that effective address = base + offset or base + offset + index. And
addressing is not meaning full unless and until we tell that at which segment it belong.
And we also know that every offset is connected is with its default segment, if we don’t
tell the segment it will automatically take its default segment.
• And we also know that CS is by default associated with IP and (SI, DI, BX) is
register indirect form and
• by default take DS. And BP by default take SS and SP also take SS by
default. The association of these register cannot be change they are lock with no
option. Other register are not locked so can be changed.
Address Wraparound
For the whole megabyte we need 20 bits while CS and IP are both 16bit registers. We
need a mechanism to make a 20bit number out of the two 16bit numbers. Consider that
the segment value is stored as a 20 bit number with the lower four bits zero and the offset
value is stored as another 20 bit number with the upper four bits zeroed. The two are
added to produce a 20bit absolute address. A carry if generated is dropped without being
stored anywhere and the phenomenon is called address wraparound.

what the calculation then this program size 18 byte?


1 [org 0x100]
2
3 00000000 B80500 mov ax, 5
4 00000003 BB0A00 mov bx, 10
5 00000006 01D8 add ax, bx
6 00000008 BB0F00 mov bx, 15
7 0000000B 01D8 add ax, bx
8 0000000D B8004C mov ax, 0x4c00
9 00000010 CD 21 int 0x21
1 1

As the 10 in hex so in decimal it is 16. CD 21 both consist of 2 bytes. So file size is 16+2
is 18 that’s how we calculate the total size of listing file.

Explaine what is diffrence between effective address and physical address?


Let me explain you effective address with the help of example
suppose BX=0x0100 and we have expression mov ax, [bx+40] then the effective
address is 0100+0028 (because 40 in decimal and we convert it into hex)

now the answer is = 0128 which is effective address.

And to calculate physical address for the whole megabyte we need 20 bits while CS
and IP are both 16bit registers. We need a mechanism to make a 20bit number out of the
two 16bit numbers. Consider that the segment value is stored as a 20 bit number with the
lower four bits zero and the offset value is stored as another 20 bit number with the upper
four bits zeroed. The two are added to produce a 20bit absolute address. A carry if
generated is dropped without being stored anywhere and the phenomenon is called
address wraparound. The process is explained with the help of the following diagram.
Therefore memory is determined by a segment-offset pair and not alone by any one
register which will be an ambiguous reference.
Every offset register is assigned a default segment register to resolve such ambiguity.
For example the program we wrote when loaded into memory had a value of 0100 in IP
register and some value say 1DDD in the CS register. Making both 20 bit numbers, the
segment base is 1DDD0 and the offset is 00100 and adding them we get the physical
memory address of 1DED0 where the opcode B80500 is placed.

Kindly explain fsb and clock speed. Regards


A front side bus (FSB) is an electrical pathway on a computer’s motherboard, which
connects the various hardware components to the main microprocessor, or central
processing unit (CPU). The front side bus is bi-directional, meaning data can flow both
ways, allowing components to send and receive data from the CPU.
If you think of the CPU as the brain of the computer, and the memory, hard disk and
other components as organs, the front side bus would be akin to the main nervous
system than links the organs to the brain.

Clock Speed
Clock speed is the rate at which microcomputer execute instructions.
1: explain about Code labels & Data labels.

2: what is 8088 architecture?

3: what is effective address & physical address?

Labels are only a syntactical value.


For example: if we want to repeat an action on the basis of some condition than we have
to jump on that proper location or data. So that location or data can be mentioned through
Labels.
If it will specify an address of memory where we have to go for value or more instruction
it is called address Label and if it is representing a data it is called data label. The
assembler does not differentiate between code labels and data labels. The programmer is
responsible for using a data label as data and a code label as code.

Effective address just means the actual address used for an instruction's operand. The
address that is obtained by applying any specified indexing or indirect addressing rules to
the specified address.

A physical address, also real address, or binary address, is the memory address that is
electronically (in the form of binary number) presented on the computer address bus
circuitry in order to enable the data bus to access a particular storage cell of main
memory.
For example: if BX=0100, SI=0200, and CS=1000 and the memory access under
consideration is [cs:bx+si+0x0700], the effective address formed is bx+si+0700 = 0100 +
0200 + 0700 = 0A00. Now multiplying the segment value by 16 makes it 10000 and
adding the effective address 00A00 forms the physical address 10A00.

8088 Architecture:
Technically iAPX88 stands for “Intel Advanced Processor Extensions 88.” It was a very
successful processor also called 8088 and was used in the very first IBM PC machines.
8088 is a 16bit processor with its accumulator and all registers of 16 bits.

What is data cache? l1 cache and l2 cache, l3 cache and difference between fsb and clock
speed?
Cache:
Processor cache is a temporary data storage area where frequently accessed data can be
quickly accessible. Mostly work done on processor side, i.e. how to improve cache as
well as processing speed. Once data is stored, it can be accessed in the future much
quicker than other memory types such as RAM or hard drives. This greatly speeds up
CPU operations as it has less data to recalculate and does not have to go as far to get the
data. When you use the on-board memory, you have to first check to see if the data you
want is present. If the data is found, this is called a computer cache hit. If not, it is a
computer cache miss, and the computer then continues on to the system memory. That
thing you will be read in your next course i.e. computer architecture.
Processor has different type of cache that includes L1 L2 and L3 may be in future there
will be more types of it. Processors measure time in very tiny increments. When the CPU
needs to access the RAM, it takes about 60 nanoseconds, or 60 billionths of a second.
Since CPU's can have a cycle time as low as 2 nanoseconds, that is quite a bit of time. So
engineers did two things. First, they build a special area of memory directly on the
motherboard that is very small, but very fast. This is the L2 cache. A trip to this memory
takes the processor around 30 nanoseconds, half the time of regular RAM. Then, they
decided that wasn't fast enough and built another layer of memory directly on the CPU
itself. This became the L1 cache, which is accessed at the same speed as the cycle time of
the processor, around 2 nanoseconds. Today, some processors are built with 2 levels of
memory directly on the chip, with the L3 cache being on the motherboard. So, you can
see how these can be strung together.L1 supplies the L2 memory, which in turn supplies
the L3 memory.

And your other question is FSB and Clock speed

Front Side Bus (FSB).


CPU uses FSB to communicate with the rest of the computer. As a result, it is important
when looking at CPUs to make sure you are getting a good FSB speed. These will range
from 166 MHz in older CPU's up to 1666 MHz in current top CPU's.

Clock Speed
Clock speed is the rate at which microcomputer execute instructions.

You might also like