12.07.2015 Views

EE-364 Lab #3 VSC - Capitol College Faculty Pages

EE-364 Lab #3 VSC - Capitol College Faculty Pages

EE-364 Lab #3 VSC - Capitol College Faculty Pages

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

0 1 0 1 1 1 1 1 (0) ENT 31 ; [31] = n1 0 1 0 0 0 0 0 (1) MVI 00 0 1 1 1 1 1 0 (2) STA 30 ; [30] = index for summation0 0 1 1 1 1 0 1 (3) STA 29 ; [29] = SUM1 0 1 0 0 0 0 1 (4) MVI 1 ; initialize index1 0 0 1 1 1 1 0 (5) ADD 30 ; increment index0 0 0 1 1 1 1 0 (6) LDA 30 ; get index1 0 0 1 1 1 0 1 (7) ADD 29 ; perform summation1 1 1 0 0 1 0 0 (8) JNE 4 ; repeat if index is less than limit0 1 1 1 1 1 0 1 (9) PRT 29 ; output sum1 1 0 0 0 0 0 0 (10 TER ; stopYou can write your own programs and simulate them using the SIM utility. This utilityreads data from a file called CODE.DAT that contains the machine code (01011111,1010000, etc.). After creating CODE.DAT and executing SIM, you should see the followingdisplayMachine Assembly LanguageLocation Instruction Instruction A PCHit the Enter key to execute one line of code. The address, the machine code theassembly language mnemonic and the contents of the A and PC registers are displayedfor each line of code executed:Machine Assembly LanguageLocation Instruction Instruction A PC? 100000 01011111 ENT 11111 00000000 0000100001 10100000 MVI 00000 00000000 0001000010 00111110 STA 11110 00000000 0001100011 00111101 STA 11101 00000000 0010000100 10100001 MVI 00001 00000001 0010100101 10011110 ADD 11110 00000001 0011000110 00011110 LDA 11110 00000001 0011100111 10011101 ADD 11101 00000001 0100001000 11100100 JNE 00100 00000001 01001101001 01111101 PRT 11101 00000001 0101001010 11000000 TER 00000 00000001 010104

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!