Microprocessor lab 3 prelab.doc_第1页
Microprocessor lab 3 prelab.doc_第2页
Microprocessor lab 3 prelab.doc_第3页
Microprocessor lab 3 prelab.doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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 see 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 Flowchart1.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 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 problems 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.1.6 Program Code2 ; Lab3: Assembly programming & Elementary Wiring3 ; Hui Zhang4 .global_c_int005 ;-6 ;constants7 ;-8 score_addr.set0xA002;set starting address for the score vectors in memory9 score_vector_len.set0xA001;address of the vector_length10 data_sect.set0xa000;constant that is actually the starting addr of .data section11 bss_sect.set0xb000;constant that is actually the starting addr of .bss section12 ;-1314 ;* DATA ALLOCATION SECTION - Variables/Data *15 .data;data section starts at 0xA0001617 counter.word0h; empty it first18 vector_length.word5192021 scores.word33; 0-100, create the scores22 .word5023 .word6524 .word825 .word202627 .bssmax_addr, 128 .bssmin_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 AR2, #score_vector_len36 MOV AR3, #counter37 MOV AL, *AR238 MOV *AR3, AL39 DEC *AR340 MOV AL, #041 MOVAL, *AR042 MOV *AR1, AL43 LOOP1INC AR044 MOV AL, *AR045 SUB AL, *AR146 BYES1, LT47 MOV AL, *AR048 MOV *AR1, AL49 YES1DEC *AR3;decrement counter50 BLOOP1, NEQ51 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 MOVAL, *AR065 MOV *AR1, AL66 LOOP2

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论