Hello, this is Dr. Miller, and this
is Episode one point two of assembly
today. What we're going to learn
about is assembly architectures
and data representation, including
binary hexadecimal and
2s complement.
So what is assembly?
Assembly is the second lowest level
programing language that we have
for computers.
It is written for a specific
architecture, including X eighty six
arm Sparke or even
the cell processor.
And the basic assembly
commands will create binary
code by an assembler.
And so it'll create the executable
that will get run on one of these
computers. The raw binary code.
There are several different
assemblies that we could use.
There is the Microsoft assembler or
Mazloum turbo assembler,
Nazem Organa assembler.
In this course we will learn
about the Nazeem assembler.
And will you also use the Ganu
assembler for ARM
Assembly?
So as far as the architectures go,
we have at the lowest level we have
the digital binary
logic that
each of the processor makers create
and they do this by creating
or gates and gates and
using transistors.
On top of that, the
creators of the instructions that
will create an instruction set
architecture or Issei.
And this is a specification that any
one of those processors would use
in order to, for example,
move data from main memory
into a register or do an
addition.
And so from the instruction set
architecture, we create assembly
language.
And so assembly language is
going to give us the
commands that are somewhat generic.
So you can say add one
register to another in
a language that is understandable
by humans as opposed to
understandable by computers.
The instruction set architecture
is defined by these processor
makers, and so it tends to
be op codes
which are binary in
nature and
then high level programing languages
like C, Java, Perl,
they are built on top of assembly
language.
And so these languages will
end up generating assembly
languages or building interpreters
that will run in assembly language.
Data representation,
so computers stored data, as
we should know, using one's or
zero's, but
reading ones and zeroes is a
difficult process.
And so people who do
a lot of programing, a lot of low
level programing, will use different
representations in order to store
the data because it's easier for
us to read.
So some of these representations are
hexadecimal, ASCII and
2s complement.
So binary data we have, each one
of these represents
a bit. So I have a zero bot
and a one bit, and we have them in
a particular order, meaning
that this bit represents
either the number
one or having it
or not having it, or the number
two having it or not having it.
And so
each one of these bits represents
whether or not that thing is on or
off.
And so we can see here that I have
eight bits and eight bits is known
as a bite.
If I have four bits, that's also
called a nibble or half of a bite.
And you can use powers of two,
as you can see, one, two, four,
eight each time it doubles.
And that is probably the easiest
way for most students to learn how
to convert something from binary
into decimal.
So, for example, if we have the two
bit on the thirty two bit on
and the 64 bit on, if
we add all those together, this
binary number represents
the decimal number ninety eight
and you can play with it by changing
some of these bits and then seeing
what the ending result is
for this number.
Now, hexadecimal is a way to
take each nibble,
right, and represented by using
one digit, the
digits go from zero
to nine and then A
through F.
And so if you have the letter D,
what that represents in binary
is one one zero one.
It also represents the number 13
in decimal.
And so this is a way where you could
write one byte by using
just two hex digits
and reading to hex digits.
For example, A.F.
is a lot easier than reading one
zero one zero one one
one one.
And so a lot of times
a very low level programmers will
use hexadecimal so that they can
understand what is happening,
but not get lost in all of the
ones and zeros that are going across
the screen.
And so a lot of things like
assemblers and this assemblers will
use hexadecimal in order to
represent the data
to complement.
So this is a way that computers will
use to store
data that is either positive
or negative. So we can have either
a positive number and negative
number in
twos complement the most significant
bit. So if I have eight bits,
the top bit, if it's a zero,
then we have a positive number.
And then if it's a one, we have a
negative number.
And in a later lecture we'll learn
how to convert a number into twos
complement.
If the uppermost bit is a one,
then we flip all of the bits so all
the zeros become ones and all the
ones become zeros.
And then we would add one to the
result that we have.
We also have characters so
characters can be aski
or the American standard
for coded information interchange,
and this was an American standard
created a long time ago
that used just eight bits or
characters, and it just represented
the American characters of
letters, you know, A through Z
and punctuation,
anything that you would generally
see on an American keyboard.
And then for the letters or things
that you would be able to see, the
most significant bit is going to be
a zero.
But assembly can very easily
convert from characters to bytes
because in the end we have to have
bytes in order to
save our data inside of our files.
But since Aski was introduced, we've
also added the Unicode standard,
so this is one standard for all of
the world.
And so some of these are UTF
eight, 16 and 32.
And this basically means how many
bits we're going to use for that.
And so UTF thirty two has the
ability to store every single
character that we could want
and emoji as well.
And so this standard allows anybody,
even some of the pictographic
languages, to have characters
representing all the different words
that they have inside of their
languages.
So in summary, we briefly discussed
discuss the assembly architecture,
we discussed the different binary
data representations, including
binary hexadecimal to complement
and even the
different types of methods
for storing characters.
Looking forward, we'll look at
different architectures, registers
and then protected zone,
if you have any questions, you can
contact me at Miller, M.J.
at Unclutter Edu or on
Twitter at Milhouse 30.