Microprocessor lab 3 prelab.doc

上传人:11****ws 文档编号:3179785 上传时间:2019-05-24 格式:DOC 页数:4 大小:1.97MB
下载 相关 举报
Microprocessor lab 3  prelab.doc_第1页
第1页 / 共4页
Microprocessor lab 3  prelab.doc_第2页
第2页 / 共4页
Microprocessor lab 3  prelab.doc_第3页
第3页 / 共4页
Microprocessor lab 3  prelab.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、Hui ZhangLab39-11-12SECTION: 1539LAB3 Pre-laboratory ReportSection 1:1.1 Program DescriptionPart2: Write an Assembly code program that find the maximum score and minimum score from a list of test scores using two for-loops.Part3: Set up an 8 bit LED display on the F28335 board, which allows us to se

2、e the program is doing through the LED lights. It is for debugging purpose. Part4: Add a 4 bit DIP switch onto the F28335 board. This allows us to input information during program execution.1.2 FlowchartS t a r tc o u n t e r = s c o r e _ v e c t o r _ l e nA L = 0m a x = s c o r e ( i )c o u n t e

3、 r - -I n p u tA L = s c o r e ( i + + )A L = A L m a xN f l a g = 1 ?N OA L = s c o r e ( i + 1 )M a x = A LC o u n t e r - -Y E SY E Sc o u n t e r = s c o r e _ v e c t o r _ l e nA L = 0M i n = s c o r e ( i )c o u n t e r - -A L = s c o r e ( i + + )A L = A L m i nN f l a g = 0 ?A L = s c o r e

4、 ( i + 1 )M i n = A LC o u n t e r - -Y E SE N DC o u n t e r = 0 ?N ON OC o u n t e r = 0 ?Y E SN OHui ZhangLab39-11-12SECTION: 15391.3 Schematic1.4 Problems EncounteredWhile writing the assembly code, I had a problem where I tried to copy the score_vector_len to the counter. Apparently, it doesnt

5、work if I simply write MOV *AR3, *AR2 (where AR3 = score_vector_len and AR2 = counter). I couldnt compile it with that line of code. Instead, I had to move the score_vector_len to accumulator, and then copy the value in accumulator to the destination AR2, which is counter.Also, I had a lot of proble

6、ms with writing the test program for LED and switch. The email from EEL4744 group helped me solve this problem.1.5 Future Work/ApplicationsTo go future after finding the minimum and maximum, we can look into finding outliers from a list of grades or even create a list of ranked score.Hui ZhangLab39-

7、11-12SECTION: 15391.6 Program Code2 ; Lab3: Assembly programming Hui Zhang4 .global _c_int005 ;-6 ;constants7 ;-8 score_addr .set 0xA002 ;set starting address for the score vectors in memory9 score_vector_len .set 0xA001 ;address of the vector_length10 data_sect .set 0xa000 ;constant that is actuall

8、y the starting addr of .data section11 bss_sect .set 0xb000 ;constant that is actually the starting addr of .bss section12 ;-1314 ;* DATA ALLOCATION SECTION - Variables/Data *15 .data ;data section starts at 0xA0001617 counter .word 0h ; empty it first18 vector_length .word 5192021 scores .word 33 ;

9、 0-100, create the scores22 .word 5023 .word 6524 .word 825 .word 202627 .bss max_addr, 128 .bss min_addr, 129 .globalscore_addr,score_vector_len,counter,vector_length,num4,counter,scores,max_addr,min_addr30 .text31 _c_int00: ;PROGRAM STARTS HERE3233 MOV AR0, #score_addr34 MOV AR1, #max_addr35 MOV A

10、R2, #score_vector_len36 MOV AR3, #counter37 MOV AL, *AR238 MOV *AR3, AL39 DEC *AR340 MOV AL, #041 MOV AL, *AR042 MOV *AR1, AL43 LOOP1 INC AR0Hui ZhangLab39-11-12SECTION: 153944 MOV AL, *AR045 SUB AL, *AR146 B YES1, LT47 MOV AL, *AR048 MOV *AR1, AL49 YES1 DEC *AR3 ;decrement counter50 B LOOP1, NEQ51

11、NOP52 NOP5354 ;find min_score55 MOV AR0, #score_addr56 MOV AR1, #min_addr57 MOV AR2, #score_vector_len58 MOV AR3, #counter59 MOV AL, *AR260 MOV *AR3, AL ;put the length to counter61 DEC *AR362 MOV AL, #0 ;empty the AL6364 MOV AL, *AR065 MOV *AR1, AL66 LOOP2 INC AR067 MOV AL, *AR068 SUB AL, *AR169 B YES2, GEQ70 MOV AL, *AR071 MOV *AR1, AL72 YES2 DEC *AR3 ;decrement counter73 B LOOP2, NEQ74 NOP75 NOP

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育教学资料库 > 精品笔记

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。