首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
Macros编程语言讲解、辅导program程序设计、Python,Java程序讲解 辅导R语言程序|讲解数据库SQL
项目预算:
开发周期:
发布时间:
要求地区:
Project 6 - String Primitives and Macros
Due Dec 6 by 11:59pm Points 50 Submitting a file upload File Types asm
Available after Nov 22 at 12am
Submit Assignment
Introduction
This program, the portfolio project for the class, is the final step up in difficulty. Once
again the Rubric (see below) now has a number of point deductions for not meeting
requirements. It it not uncommon for a student to generate a program that meets the Program
Description but violates several Program Requirements, causing a significant loss in points.
Please carefully review the Rubric to avoid this circumstance.
The purpose of this assignment is to reinforce concepts related to string primitive instructions and
macros (CLO 3, 4, 5).
1. Designing, implementing, and calling low-level I/O procedures
2. Implementing and using macros
What you must do
Program Description
Write and test a MASM program to perform the following tasks (check the Requirements section for
specifics on program modularization):
Implement and test two macros for string processing. These macros may use Irvine’s
ReadString to get input from the user, and WriteString procedures to display output.
mGetSring : Display a prompt (input parameter, by reference), then get the user’s keyboard
input into a memory location (output parameter, by reference)
mDisplayString : Print the string which is stored in a specified memory location (input
parameter, by reference).
Implement and test two procedures for signed integers which use string primitive instructions
ReadVal :
1. Invoke the mGetSring macro (see parameter requirements above) to get user input in the
form of a string of digits.
2. Convert (using string primitives) the string of ascii digits to its numeric value
representation (SDWORD), validating the user’s input is a valid number (no letters,
symbols, etc).
3. Store this value in a memory variable (output parameter, by reference).
WriteVal :
1. Convert a numeric DWORD value (input parameter, by value) to a string of ascii digits
11/23/2020 Project 6 - String Primitives and Macros
https://canvas.oregonstate.edu/courses/1784177/assignments/8084707 2/8
2. Invoke the mDisplayString macro to print the ascii representation of the SDWORD value
to the output.
Write a test program (in main ) which uses the ReadVal and WriteVal procedures above to:
1. Get 10 valid integers from the user.
2. Stores these numeric values in an array.
3. Display the integers, their sum, and their average.
Program Requirements
1. User’s numeric input must be validated the hard way:
a. Read the user's input as a string and convert the string to numeric form.
b. If the user enters non-digits other than something which will indicate sign (e.g. ‘+’ or ‘-‘), or
the number is too large for 32-bit registers, an error message should be displayed and the
number should be discarded.
c. If the user enters nothing (empty input), display an error and re-prompt.
2. ReadInt , ReadDec , WriteInt , and WriteDec are not allowed in this program.
3. Conversion routines must appropriately use the LODSB and/or STOSB operators.
4. All procedure parameters must be passed on the runtime stack. Strings must be passed by
reference
5. Prompts, identifying strings, and other memory locations must be passed by address to the
macros.
6. Used registers must be saved and restored by the called procedures and macros.
7. The stack frame must be cleaned up by the called procedure.
8. Procedures (except main ) must not reference data segment variables or constants by name.
9. The program must use Register Indirect addressing for array elements, and Base+Offset
addressing for accessing parameters on the runtime stack.
10. Procedures may use local variables when appropriate.
11. The program must be fully documented and laid out according to the CS271 Style Guide. This
includes a complete header block for identification, description, etc., a comment outline to
explain each section of code, and proper procedure headers/documentation.
Notes
1. For this assignment you are allowed to assume that the total sum of the numbers will fit inside a
32 bit register.
2. We will be testing this program with positive and negative values.
3. When displaying the average, you may round down (floor) to the nearest integer. For example if
the sum of the 10 numbers is 3568 you may display the average as 356.
4. Check the Course Syllabus for late submission guidelines.
5. Find the assembly language instruction syntax and help in the CS271 Instructions Guide.
6. To create, assemble, run, and modify your program, follow the instructions on the course
Syllabus Page’s "Tools" tab.
Resources
Additional resources for this assignment
11/23/2020 Project 6 - String Primitives and Macros
https://canvas.oregonstate.edu/courses/1784177/assignments/8084707 3/8
Project Shell with Template.asm
CS271 Style Guide
CS271 Instructions Reference
CS271 Irvine Procedure Reference
What to turn in
Turn in a single .asm file (the actual Assembly Language Program file, not the Visual Studio
solution file). File must be named "Proj5_ONID.asm" where ONID is your ONID username. Failure
to name files according to this convention may result in reduced scores (or ungraded work). When
you resubmit a file in Canvas, Canvas can attach a suffix to the file, e.g., the file name may
become Proj5_ONID-1.asm. Don't worry about this name change as no points will be deducted
because of this.
Example Execution
User input in this example is shown in boldface italics.
PROGRAMMING ASSIGNMENT 6: Designing low-level I/O procedures
Written by: Sheperd Cooper
Please provide 10 signed decimal integers.
Each number needs to be small enough to fit inside a 32 bit register. After you have finished inputting
the raw numbers I will display a list of the integers, their sum, and their average value.
Please enter an signed number: 156
Please enter an signed number: 51d6fd
ERROR: You did not enter a signed number or your number was too big.
Please try again: 34
Please enter a signed number: -186
Please enter a signed number: 115616148561615630
ERROR: You did not enter an signed number or your number was too big.
Please try again: -145
Please enter a signed number: 5
Please enter a signed number: +23
Please enter a signed number: 51
Please enter a signed number: 0
Please enter a signed number: 56
Please enter a signed number: 11
You entered the following numbers:
156, 34, -186, -145, 5, 23, 51, 0, 56, 11
The sum of these numbers is: 5
The rounded average is: 1
Thanks for playing!
Extra Credit (Original Project Definition must be Fulfilled)
To receive points for any extra credit options, you must add one print statement to your program
output per extra credit which describes the extra credit you chose to work on. You will not
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写math 1151, autumn 2024 w...
2024-11-14
代做comp4336/9336 mobile dat...
2024-11-14
代做eesa01 lab 2: weather an...
2024-11-14
代写comp1521 - 24t3 assignme...
2024-11-14
代写nbs8020 - dissertation s...
2024-11-14
代做fin b377f technical anal...
2024-11-14
代做ceic6714 mini design pro...
2024-11-14
代做introduction to computer...
2024-11-14
代做cs 353, fall 2024 introd...
2024-11-14
代做phy254 problem set #3 fa...
2024-11-14
代写n1569 financial risk man...
2024-11-14
代写csci-ua.0202 lab 3: enco...
2024-11-14
代写econ2226: chinese econom...
2024-11-14
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!