Difference between revisions of "CSC231 Homework 2"
(→Problem #2) |
(→Question 1) |
||
Line 73: | Line 73: | ||
===Question 1=== | ===Question 1=== | ||
− | What string of characters is contained in the array that occupies the first 31 bytes of memory when the processor has reached the 3rd NOP instruction of the program? | + | What string of characters is contained in the array that occupies the first 31 bytes of data memory when the processor has reached the 3rd NOP instruction of the program? |
===Question 2=== | ===Question 2=== |
Revision as of 17:06, 15 September 2008
<meta name="keywords" content="computer science, assembly language, pentium, exercise, machine language, intel" /> <meta name="description" content="Dominique Thiebaut's Web Page" /> <meta name="title" content="Dominique Thiebaut -- Computer Science" /> <meta name="abstract" content="Dominique Thiebaut's Computer Science Web pages" /> <meta name="author" content="thiebaut at cs.smith.edu" /> <meta name="distribution" content="Global" /> <meta name="revisit-after" content="10 days" /> <meta name="copyright" content="(c) D. Thiebaut 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,2008" /> <meta name="robots" content="FOLLOW,INDEX" />
Assignment #2
This assignment is due on Wednesday, Sept 24th, at 11:59 p.m. plus 1 minute.
Problem #1
Write a program that displays the following pattern using loops.
**********#
*********##
********###
*******####
******#####
*****######
****#######
***########
**#########
*##########
**#########
***########
****#######
*****######
******#####
*******####
********###
*********##
**********#
Requirements: your program cannot contain more than 5 int 0x80 instructions!
Store your program in a file called hw2a.asm and submit it as follows:
submit hw2 hw2a.asm
Problem #2
For this problem you have to debug the executable version of a program and answer two questions.
You can get the executable version of the program by using this command, from your Linux account:
cp ~thiebaut/public_html/classes/231/hw2 .
(don't forget the dot at the end of the line!)
If you are working off-campus, and you have a linux machine where the utility wget is installed, try this:
wget http://cs.smith.edu/~thiebaut/classes/231/hw2
and you should get a copy of the program.
Once you're done transfering the program, debug it:
ddd hw2 &
Question 1
What string of characters is contained in the array that occupies the first 31 bytes of data memory when the processor has reached the 3rd NOP instruction of the program?
Question 2
What hexadecimal values are stored in the registers eax, ebx, ecx, and edx when the processor has reached the 3rd NOP instruction of the program?
Write your answers in a file called hw2.txt and submit your file as follows:
submit hw2 hw2.txt