0% found this document useful (0 votes)
35 views7 pages

Ceg 3136 Pre Lab 1

Pre Lab 1 for CEG3136

Uploaded by

Lola Omowa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views7 pages

Ceg 3136 Pre Lab 1

Pre Lab 1 for CEG3136

Uploaded by

Lola Omowa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

CEG 3136

LAB 1: Introduction to Microprocessor Programming


FALL 2021

TA: Karim Alghoul


September 19, 2021

OMOWA OMOLOLA - 300130234


ALEJANDRO BECERRA
OBJECTIVE 3
EQUIPMENT 3
PART 1 3
Algorithm 3
Outcomes Observation 3
PART 2 6
PART 3 6
Algorithm 6
OBJECTIVE
The purpose of this lab was to learn Assembly Language, miniIDE, and the Dragon-12 board.
The first part of the lab was to experience reading and writing assembly language on the
D-bug12 monitor. The second part was to learn how to troubleshoot and debug a program by
tracing the program and identifying the incorrect code. The last part centered on creating a
missing assembly code.

EQUIPMENT
● Windows PC
● Dragon 12 Plus Trainer

PART 1
The first part of the experiment had told us to use the MiniIDE software's D-Bug12 module to
put together a program and record responses to a table. This program was designed to interpret a
user-given ASCII character input from the terminal, and repeat that character a set number of
times in a formatted manner. The amount of times it would be repeated as well as the formatting
of the outputted text would be changed afterward according to the lab manual's
recommendations.

Algorithm
To better comprehend the process, we have to translate the given algorithm into C code. The
following is the code we developed:

Outcomes Observation
We were given a series of instructions and told to keep track of the subsequent address and
contents noticed during the procedure.
Address Content Instructions Descriptions

2000 LDD #$3A Load ASCII code for


“:”

LDX $EE86 Load the vector for


putchar routine

JSR 0,X Print what’s in B on


terminal

LDX $EE84 Load the vector for


getchar routine

JSR 0,X Get a new character


in B

LDAA #3 Initialize loop counter

PSHA Save the counter on


stack

PSHB Save contents of B on


stack

LDD #$20 Load B with a space

LDX $EE86 Load the vector for


putchar routine

JSR 0,X Print it on terminal

PULB Get original character

LDX $EE86 Load the vector for


putchar routine

JSR 0,X Print it on terminal

PULA Retrieve the counter

DECA Decrement loop


counter

BNE $200F If counter <> 0,


repeat

SW1 Return the monitor

Following that, we were asked to change the instructions as well as the content of the addresses.
The alterations include the “:” prompt to a “>” promt, the “ “ spacing to a “;”, and change the
loop counter to print exactly 15 times

Address Content Instructions Descriptions

2000
PART 2
This part of the lab required an already coded alarmSimul.asm file to be assembled. After
studying the alarmSimul assembler code and the design paper, it was noticed that the problem
was happening before branching to the function after studying the alarmSimul assembler code
and the design paper.
After tracing the instructions as explained in the lab manual and we found the error was in the
line beq CDE endif which had to be changed to bne CDE endif.

A B X Y SP PC CCR

PART 3
In the final part of this lab experiment, the task was to construct a delay module for the code
already provided in the lab manual in the final portion of the experiment. This involved
implementing the body of several subroutines. To do this we used pseudocode that we had
designed earlier in the prelab using the C language.

Algorithm
The c-code pseudocode is provided below:
Int pollDelay() {
Byte delayDone= 0;
Int delayCycle = 0x1289;

do{
delayCycle---;
}while(delayCycle);

If (delayCount == 0){
delayDone = 1;
}
else delayCount--;

return delayDone;
}
void setDelay(int count){
delayCount = count;
}

You might also like