You are on page 1of 4

MIDDLE EAST TECHNICAL UNIVERSITY

NORTHERN CYPRUS CAMPUS

EEE 347

PRELIMINARY WORK #1

INTRODUCTION TO MICROPROCESSORS/EMBEDDED SYSTEMS


LABORATORY

MARCH 11nd, 2015

BERK AIOLU - 1863000 - EEE


RECEP BALCI
- 1863018 - EEE

WEDNESDAY AFTERNOON

INSTRUCTOR:
ILKAY ULUSOY
ASSISTANTS:
FASSAHAT ULLAH QURESHI
ARSALAN TARIQ

1.2.2.
a.)
* This is a very simple program that adds the contents of address
* $0000 to the contents of address $0001 and stores the resulting
* sum in the memory location at address $0002. If there is an
* overflow the contents of address $0003 is set to $FF else
* address $0003 is cleared.

OPER1
OPER2
SUM
OVERFL
FALSE

START

OVF
NOVF
LOOP

NAM SUM
ORG $0000
FCB $64, $1A, $00, $00
ORG $0000
RMB 1
RMB 1
RMB 1
RMB 1
EQU $00
ORG $2000
CLV
LDAB #FALSE
LDAA OPER1
ADDA OPER2
BVC NOVF
COMB
STAA SUM
STAB OVERFL
JMP LOOP
END

name of the program is SUM


starting adress to insert data
from constant bytes $64, $1A, $00, $00
starting address for the reservation
reserve 1 byte for operation1
reserve 1 byte for operation2
reserve 1 byte for the sum
reserve 1 byte for the overflow
false address is allocated to $00
The program starts
Clear the overflow
Load False bit in accu B
Load oper1 in accu A
add oper2 to accu A
Branch if there is no overflow
Take the complement of B
store sum in accu A
store overflow in acc B
jump to loop
end this program

b)
$0000
$0001
$0002
$0003

oper1
oper2
sum
overflow

$64 (%01100100)
$1A (%00011010)
$7E (%01011110)
$00

c)
$0000
$0001
$0002
$0003

oper1
oper2
sum
overflow

$64 (%01100100)
$1C (%00011100)
$80 (%10000000)
$00

No overflow , and the sum changes.

1.2.3.
a.) NAM FILLABS
ORG $2000
LDAB #$10
LDX #$2200
LDAA #$AB
START:
STAA $00,X
INX
DECB
BNE
START
LOOP:
BRA
LOOP
b.)

Yes, we can use the following assembler directives.


NAM ASMBLD
ORG $2200
FILL $AB, $10
END

1.2.4.)
a.)

LOOP:

START:

ORG $2000
LDX #$2200
LDY #$2300
LDAB #$0010
LDAA $00,X
STAA $00,Y
INX
INY
DECB
BNE
LOOP
BRA
START

b.)
Yes, we can do the same job with MOVE command, which is one of the BUFFALO
commands.
MOVE $2200 $2210 $2300

1.2.5
ROM (Read Only Memory) is non volatile. This means that when the power shuts down,
the data inside of the ROM doesnt erase. On the other hand, RAM (Random Access Memory)
is volatile which means when the power goes down , the data of the RAM will be lost.
There is a need both ROM and EEPROM because we need a memory that keeps a specific
data whcih have to be non-volatile and also we need non-volatile and eracable memory
place.

1.2.6.
What is the function of the control unit?
The control unit control the flow of the information through the processor and organize the
performance of the other nuits within it. Its working system goes like fecthing , decoding
and execution.
How does the control unit get the instruction that it must execute?
The address register gets the address from the program counter. Once the address register
points the address, address bus take the instruction and sent it to instruction decoder. This
given ppcode tells the decoder what to do and after taking the data executionpart of the
control unit will process.
How does it know the number of bytes in an instruction?
If prebyte arrive to the decoder, then decoder knows that there is an another 1 byte
instruction to decode.

1.2.7.
A pipelined processor cannot document the number of clocks per instruction because
"it depends", it is not possible to exactly document.We can usually see from the instruction
and options exactly why it takes that many cycles, and it isnt pipelined, in the sense that we
use that word with modern processors

You might also like