Loading…
Transcript

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 program use the piece of code that we wrote it to translate comas between fields into binary

-Solution:Write conditions that avoid the program from translate unwanted field.

the user can see

his assembly code

displayed in binary

form on the prompt

THE END

Our Project:

PNU ASSEMBLER!

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

Lets start the journey

of the assembly code!

(3) We don’t know how to cut the string if there is space or enter character

The Solution:We use String Tokenize.

the code will be cut by a token tool

into small pieces of string

each one contain one word:)

HEXADECIMAL NUMBERS

• The program use the piece of code that we wrote it to translate comas between fields into binary

-Solution:Write conditions that avoid the program from translate unwanted field.

• We don’t know how to tell the compiler that he is dealing with hexadecimal number

The Solution: Tell the compiler if there is character H or h then the number is hexadecimal.

• (3) We don’t know how to cut the string if there is space or enter character

The Solution:We use String Tokenize.

• (4) we realize that we don’t need the decimal function because the hexadecimal does it already. and the hexadecimal also.

ASCCI

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!

at the end

the assembler :

different between compiler and assembler

Assets

assembler

details

--• Converts machine-manipulation coding directly

into binary machine instructions.

--Produces the most efficient executables,

but is the most difficult (for humans) to work with.

map

compiler

thanks for listening:)

Stockholm

(cc) photo by Metro Centric on Flickr

(cc) photo by jimmyharris on Flickr

Budapest

(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.

San Francisco

(cc) photo by Franco Folini on Flickr

doodles

Notes

alanoud alhussain

amjad alsohaim

rwan alomirini

arwa algabas

outlook

Place your own picture

behind this frame!

Double click to crop it if necessary

notes

photo frame