狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线

CIT 593代做、代寫Java/c++語言編程

時間:2024-07-24  來源:  作者: 我要糾錯


CIT 593 – Module 11 Assignment Instructions  
CIT 593 – Module 11 Assignment  
Making the LC4 Assembler Instructions  
Contents  
Assignment Overview 3  
Learning Objectives 3  
Advice 3  
Getting Started 4  
Codio Setup 4  
Starter Code 4  
Object File Format Refresher 4  
Requirements 5  
General Requirements 5  
Assembler 5  
assembler.c: main 5  
asm_parser.c: read_asm_file 6  
asm_parser.c: parse_instruction 6  
asm_parser.c: parse_add 6  
asm_parser.c: parse_xxx 6  
asm_parser.c: str_to_bin 7  
asm_parser.c: write_obj_file 7  
Extra Credit 8  
Suggested Approach 8  
High Level Overview 8  
Great High Level Overview, but I really need a Slightly More Detailed Overview 10  
Part 0: Setup the main Function to Read the Arguments 10  
Part 1: Read the .asm File 10  
Part 2: Parse an Instruction 1  
Part 3: Parse an ADD Instruction 1  
Part 4: Converting the binary string to an hexadecimal formatted integer 1  
Part 5: Writing the .obj object file 1  
Testing 1  
Validate Output with PennSim 1  
Files for Testing 1  
Unit Testing 1  
GDB for Debugging 1  
Submission 1  
Submission Checks 1  
The Actual Submission 1  
Page 1 of 24CIT 593 – Module 11 Assignment Instructions  
Grading 1  
Assembler 1  
Extra Credit 1  
An Important Note of Plagiarism 1  
FAQ 1  
Quick Hints 1  
Formatting 1  
Endianness 1  
Resources 1  
Page 2 of 24CIT 593 – Module 11 Assignment Instructions  
Assignment Overview  
From lecture you’ve learned that C is file-oriented and that working with files represents I/O  
devices in C.  
C files fall into two categories: "text" and "binary". In this assignment you’ll work with both types  
by reading in a text file and writing out a binary file.  
You will read an arbitrary .asm file (a text file intended to be read by PennSim) and write a .obj  
file (the same type of binary file that PennSim would write out).  
Aside from reading and writing out the files, your task will be to make a mini-LC4- Assembler!  
An assembler is a program that reads in assembly language and generates its machine  
equivalent.  
This assignment will require a bit more programming rigor than we’ve had thus far, but now that  
you’ve gained a good amount of programming skill in this class and in others, it is the perfect  
time to tackle a large programming assignment (which is why the instructions are so many  
pages).  
Learning Objectives  
This assignment will cover the following topics:  
● Review the LC4 Object File Format  
● Read text files and process binary files  
● Assemble LC4 programs into executable object files  
● Use debugging tools such as GDB  
Advice  
● Start early  
● Ask for help early  
● Do not try to do it all in one day  
Page 3 of 24CIT 593 – Module 11 Assignment Instructions  
Getting Started  
Codio Setup  
Open the Codio assignment via Canvas. This is necessary to link the two systems.  
You will see many directories and files. At the top-level workspace directory, the mail files are  
asm_parser.h, asm_parser.c, assembler.c, and PennSim.jar.  
Do not modify any of the directories or any file in any of the directories.  
Starter Code  
We have provided a basic framework and several function definitions that you must implement.  
assembler.c - must contain your main function.  
asm_parser.c - must contain your asm_parser functions.  
asm_parser.h - must contain the definition for ROWS and COLS  
- must contain function declarations for read_asm_file,  
parse_instruction, parse_reg, parse_add, parse_mul,  
str_to_bin, write_obj_file, and any helper function you  
implement in asm_parser.c  
test1.asm - example assembly file  
PennSim.jar - a copy of PennSim to check your assembler  
Object File Format Refresher  
The following is the format for the binary .obj files created by PennSim from your .asm files. It  
represents the contents of memory (both program and data) for your assembled LC-4 Assembly  
programs. In a .obj file, there are 3 basic sections indicated by 3 header “types” = Code , Data,  
and Symbol:  
● Code: 3-word header (xCADE, <address>, <n>), n-word body comprising the instructions.  
○ This corresponds to the .CODE directive in assembly.  
● Data: 3-word header (xDADA, <address>, <n>), n-word body comprising the initial data  
values.  
○ This corresponds to the .DATA directive in assembly.  
● Symbol: 3-word header (xC3B7, <address>, <n>), n-character body comprising the  
symbol string. These are generated when you create labels (such as “END”) in  
assembly. Each symbol is its own section.  
○ Each character in the file is 1 byte, not 2 bytes.  
○ There is no NULL terminator.  
Page 4 of 24CIT 593 – Module 11 Assignment Instructions  
Requirements  
General Requirements  
● You MUST NOT change the filenames of any file provided to you in the starter code.  
● You MUST NOT change the function declarations of any function provided to you in the  
starter code.  
● You MAY create additional helper functions. If you do, you MUST correctly declare the  
functions in the appropriate header file and provide an implementation in the appropriate  
source file.  
● Your program MUST compile when running the command make.  
● You MUST NOT have any compile-time errors or warnings.  
● You MUST remove or comment out all debugging print statements before submitting.  
● You MUST NOT use externs or global variables.  
● You MAY use string.h, stdlib.h, and stdio.h.  
● You SHOULD comment your code since this is a programming best practice.  
● Your program MUST be able to handle .asm files that PennSim would successfully  
assemble. We will not be testing with invalid .asm files.  
● Your program MUST NOT crash/segmentation fault.  
● You MUST provide a makefile with the following targets:  
○ assembler  
○ asm_parser.o  
○ all, clean, clobber  
Assembler  
assembler.c: main  
● You MUST not change the first four instructions already provided.  
● The main function:  
○ MUST read the arguments provided to the program.  
■ the user will use your program like this:  
./assembler test1.asm  
○ MUST store the first argument into filename.  
○ MUST print an error1 message if the user has not provided an input filename.  
○ MUST call read_asm_file to populate program[][].  
○ MUST parse each instruction in program[][] and store the binary string equivalent  
into program_bin_str[][].  
○ MUST convert each binary string into an integer (which MUST have the correct  
value when formatted with "0x%X") and store the value into program_bin[].  
○ MUST write out the program into a .obj object file which MUST be loadable by  
PennSim's ld command.  
Page 5 of 24CIT 593 – Module 11 Assignment Instructions  
asm_parser.c: read_asm_file  
This function reads the user file.  
● It SHOULD return an error2 message if there is any error opening or reading the file.  
● It MAY try to check if the input program is too large for the defined variables, but we will  
not be testing outside the provided limits.  
● It MUST read the exact contents of the file into memory, and it MUST remove any  
newline characters present in the file.  
● It MUST work for files that have an empty line at the end and also for files that end on an  
instruction (i.e. do not assume there will always be an empty line at the end of the file).  
● It MUST return 0 on success, and it MUST return a non-zero number in the case of  
failure (it SHOULD print a useful error message and return 2 on failure).  
asm_parser.c: parse_instruction  
This function parses a single instruction and determines the binary string equivalent.  
● It SHOULD use strtok to tokenize the instruction, using spaces and commas as the  
delimiters.  
● It MUST determine the instruction function and call the appropriate parse_xxx helper  
function.  
● It MUST parse ADD, MUL, SUB, DIV, AND, OR, XOR instructions.  
○ It MUST parse ADD IMM and AND IMM if attempting that extra credit.  
● It MUST return 0 on success, and it MUST return a non-zero number in the case of  
failure (it SHOULD print a useful error message and return 3 on failure).  
asm_parser.c: parse_add  
This function parses an ADD instruction and provides the binary string equivalent.  
● It MUST correctly update the opcode, sub-opcode, and register fields following the LC4  
ISA.  
● It SHOULD call a helper function parse_reg, but we will not be testing this function.  
● It MUST return 0 on success, and it MUST return a non-zero number in the case of  
failure (it SHOULD print a useful error message and return 4 on failure).  
asm_parser.c: parse_xxx  
You MUST create a helper function similar to parse_add for the other instruction functions  
required in parse_instruction.  
● They MUST correctly update the opcode, sub-opcode, and register fields following the  
LC4 ISA.  
● They SHOULD call a helper function parse_reg, but we will not be testing this function.  
● They MUST return 0 on success, and they MUST return a non-zero number in the case  
of failure (it SHOULD print a useful error message and return a unique error number on  
failure).  
Page 6 of 24CIT 593 – Module 11 Assignment Instructions  
asm_parser.c: str_to_bin  
This function converts a C string containing 1s and 0s into an unsigned short integer  
● It MUST correctly convert the binary string to an unsigned short int which can be verified  
using the "0x%X" format.  
● It SHOULD use strtol to do the conversion.  
asm_parser.c: write_obj_file  
This function writes the program, in integer format, as a LC4 object file using the LC4 binary  
format.  
● It MUST output the program in the LC4 binary format described in lecture and in the  
Object File Format Refresher section.  
● It MUST create and write an empty file if the input file is empty  
● It MUST change the extension of the input file to .obj.  
● It MUST use the default starting address 0x0000 unless you are attempting the .ADDR  
extra credit.  
● It MUST close the file with fclose.  
● It MUST return 0 on success, and they MUST return a non-zero number in the case of  
failure (it SHOULD print a useful error message and return 7 on failure).  
● The generated file MUST load into PennSim (and you MUST check this before  
submitting), and the contents MUST match the .asm assembly program  
 Page 7 of 24CIT 593 – Module 11 Assignment Instructions  
Extra Credit  
You may attempt any, all, or none of these extra credit options. You MUST test using your own  
generated examples (we will not provide any).  
Option 1: modify your read_asm_file function to ignore comments in .asm files. You MUST  
handle all types of comments for credit.  
Option 2: modify your program to handle ADD IMM and AND IMM instructions. Both MUST work  
completely for credit.  
Option 3: modify your program to handle the .CODE and .ADDR directives.  
Option 4: modify your program to handle the .DATA, .ADDR, and .FILL directives.  
Suggested Approach  
This is a suggested approach. You are not required to follow this approach as long as you  
follow all of the other requirements.  
High Level Overview  
Follow these high-level steps and debug thoroughly before moving on to the next.  
1. Initialize all arrays to zero or '狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线
  • <dl id="akume"></dl>
      <noscript id="akume"><object id="akume"></object></noscript>
    • <nav id="akume"><dl id="akume"></dl></nav>
      • <rt id="akume"></rt>
        <dl id="akume"><acronym id="akume"></acronym></dl><dl id="akume"><xmp id="akume"></xmp></dl>
        www成人免费| 日韩 欧美 视频| 日韩精品久久一区二区| 成人黄色一区二区| 九九久久久久久| 国产九九在线观看| 亚洲第一区第二区第三区| 丁香六月激情婷婷| 女女同性女同一区二区三区按摩| 91日韩视频在线观看| 成熟丰满熟妇高潮xxxxx视频| 久久人人爽av| 男女裸体影院高潮| 亚洲欧美手机在线| 午夜欧美福利视频| 97在线免费公开视频| 欧美人与动牲交xxxxbbbb| 九九热精品国产| 欧美与动交zoz0z| 艳母动漫在线免费观看| 亚洲高清免费在线观看| 可以在线看的黄色网址| 日本欧美黄色片| 男人用嘴添女人下身免费视频| 久草综合在线观看| 最近免费中文字幕中文高清百度| 内射国产内射夫妻免费频道| 97干在线视频| 亚洲熟妇无码另类久久久| 亚洲女人在线观看| 国产中文字幕乱人伦在线观看| 四虎免费在线观看视频| 91丝袜超薄交口足| 国产高清999| 黄频视频在线观看| 性欧美在线视频| 国产婷婷一区二区三区| 五十路熟女丰满大屁股| 凹凸国产熟女精品视频| 亚洲国产精品久久久久爰色欲| 无码aⅴ精品一区二区三区浪潮 | 国产手机免费视频| 国产乱人伦精品一区二区三区| 日本xxxxx18| av网站大全免费| 五月天视频在线观看| 超碰免费在线公开| 日本xxxxx18| 91猫先生在线| 能看的毛片网站| 国产精品后入内射日本在线观看| 久久人人爽人人片| 又大又硬又爽免费视频| 久久久免费视频网站| 国产情侣av自拍| 久久久国产精华液999999| 天天干在线影院| 99蜜桃臀久久久欧美精品网站| 毛片av免费在线观看| 在线免费观看视频黄| av磁力番号网| 日韩精品一区二区三区久久| 黄色一级片播放| a级黄色一级片| 我要看一级黄色大片| 日本黄色a视频| 1024精品视频| 97超碰人人看| 欧美牲交a欧美牲交aⅴ免费下载| 成人毛片100部免费看| aa免费在线观看| 女同性恋一区二区| 日韩中文字幕免费在线| 久国产精品视频| 国产乱女淫av麻豆国产| 18黄暴禁片在线观看| 手机免费av片| 中文字幕无码精品亚洲35| 超碰在线资源站| av网站大全免费| 最新中文字幕久久| 熟女少妇精品一区二区| 北条麻妃亚洲一区| 亚洲一区二区三区四区五区xx| 色噜噜狠狠一区二区| 午夜免费看毛片| 黄色片一级视频| 日韩中字在线观看| 国产在线无码精品| 只有这里有精品| 日韩国产一级片| 一区二区三区日韩视频| 国产视频手机在线播放| www.99热这里只有精品| 浴室偷拍美女洗澡456在线| 国内性生活视频| 国模吧无码一区二区三区| 在线观看17c| 樱空桃在线播放| 国产精品自在自线| av网站手机在线观看| 99精品在线免费视频| 国产欧美精品aaaaaa片| 精品少妇人妻av一区二区| 爱爱爱爱免费视频| 潘金莲激情呻吟欲求不满视频| 穿情趣内衣被c到高潮视频| 国产美女主播在线播放| 国产又粗又爽又黄的视频| 国产精品区在线| 在线黄色免费观看| 最新天堂在线视频| 97在线国产视频| 欧美一级片免费播放| 国产精品va在线观看无码| 成人毛片100部免费看| 免费观看亚洲视频| 999精品视频在线| www.天天射.com| 在线观看免费不卡av| 午夜免费福利在线| 亚洲小视频网站| www.亚洲高清| 九九九久久久久久久| 色黄视频免费看| 日韩最新中文字幕| 欧妇女乱妇女乱视频| 色悠悠久久综合网| 视频一区二区视频| 少妇人妻互换不带套| 少妇一级淫免费放| 成人在线播放网址| 欧美 国产 日本| 日本中文字幕二区| 成人在线免费高清视频| 超碰影院在线观看| 精品久久一二三| 五月婷婷六月合| 99re6这里有精品热视频| 欧美日韩午夜爽爽| 亚洲精品视频导航| 国产手机免费视频| 五月婷婷六月合| 成人国产一区二区三区| 日本午夜激情视频| 免费国产成人看片在线| 亚洲一区精品视频在线观看| 免费日韩在线观看| 91在线视频观看免费| 伊人色在线观看| 成人av在线播放观看| 亚洲欧美日韩一级| 午夜精品在线免费观看| 日韩 国产 一区| 日韩五码在线观看| 色婷婷.com| 2021国产视频| 亚欧在线免费观看| 免费成人进口网站| 在线观看av日韩| 少妇黄色一级片| 深夜黄色小视频| 免费无遮挡无码永久视频| 中文av字幕在线观看| 午夜免费福利小电影| 久久久久免费精品| 亚洲综合欧美激情| 日本a在线免费观看| 中文字幕一区二区三区四| 免费 成 人 黄 色| 精品国产一区三区| 99热这里只有精品免费| 国产成人在线综合| 成人黄色片视频| 国产欧美激情视频| 欧美做暖暖视频| 在线观看免费视频污| 国产第一页视频| 秋霞无码一区二区| 亚洲性图一区二区| 不卡av免费在线| 精品欧美一区免费观看α√| 大桥未久一区二区| 国产最新免费视频| 国产一伦一伦一伦| 99久久国产宗和精品1上映| www.成年人视频| 男人天堂新网址| 成人性生生活性生交12| 五月婷婷六月合| 国产九九在线视频| 手机在线看福利| 免费黄色一级网站| 国产一区二区在线观看免费视频| 先锋影音男人资源| 日韩一级免费片| 亚洲老女人av| 国产高清av在线播放| 五月婷婷丁香色| 久久久天堂国产精品|