An assembler is a program
converts computer instructions
into a pattern of bits so processor can use them to perform its operations.
Those instructions may call assembler
language or assembly language.
first of all the user should enter his code
ending by underscore.
then our lovely assembler should
convert it to a binary code through
the following steps:
the user can see
his assembly code
displayed in binary
form on the prompt
our assembler can check if the token were hexadecimal number by simple logic
that find out if the token were end
with hexadecimal simple(h OR H)
or need to be convert to ascci code :)
each peices will compared with
the list of assembly instruction
(which is stored in 2 arrays to offer
capital and small letter )
if our assembler find the
correct instruction-------->it will bring the
appropriate binary code from
another array
the code will be cut by a token tool
into small pieces of string
each one contain one word:)
IF IT IS HEXADECIMAL NUMBER
IT WILL BE TRANSLATED
DIGIT BY DIGIT AND
ADD ZEROES IF THE NUMBER WAS
LESS THAN 8 BIT :)
EACH CHARECTER WILL BE CONVERT TO THE CORRESPOND BINARY CODE
if it is not found in instructions ,
the token will be compared with another
array which is contain all the registers
if it token =register
-->display the binary code!
--• Converts machine-manipulation coding directly
into binary machine instructions.
--Produces the most efficient executables,
but is the most difficult (for humans) to work with.
(cc) photo by Metro Centric on Flickr
(cc) photo by jimmyharris on Flickr
(cc) photo by Metro Centric on Flickr
--reads human-readable source code
--produces machine-executable binary code.
--Easiest for humans to program,
but does not always produce the most efficient executables.
(cc) photo by Franco Folini on Flickr