Ceg 3136 Pre Lab 1
Ceg 3136 Pre Lab 1
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
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
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;
}