代写辅导接单-CMPEN 472, The Pennsylvania State University**

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top

 **CMPEN 472, The Pennsylvania State University**  

**Homework 6**  

Due: Oct. 09, 2023   11:30pm

 

**Objective**  

To learn how to use arithmetic instructions and write basic system I/O subroutines. Learn user interface through a serial port.

 

**Instruction**  

1. Write a user-friendly system program for the following commands:

  - **S**: Show the contents of memory location in word format.

  - **W**: Write the data word (not byte) to memory location.

  - **QUIT**: Quit the main program, run 'Type writer' program.

 

2. **Command S**: This command shows the contents of memory location specified by the address in hexadecimal number followed by the 'S' character. For example, if the data $126A is stored in memory location $3000, a user types in the first line ending with Enter/Return key and the following should be displayed on the HyperTerminal connected to the HCS12 board:

 

  >$S3000  

  >$3000 = $126A   4714

 

  The data $126A is printed in both hexadecimal and decimal number format. The character '>' is the prompt for this program.

 

3. **Command W**: this command writes data into the memory location specified by the address in hexadecimal followed by the 'W' character. The data to be written to the memory location is followed by a space and it can be specified by hexadecimal '$' or just decimal number. For example, if one wants to store the data $126A in memory location $3003, a user types in the first line ending with Enter/Return key and the following should be displayed on the HyperTerminal connected to the HCS12 board:

 

  >$W3003 4714  

  >$3003 = $126A   4714

 

  Or

 

  >$W3003 $126A  

  >$3003 = $126A   4714

 

  As a result, the word data $126A is stored in the memory location $3003 and it is shown with the 'S' command. The 'W' command accepts both '4714' or '$126A' as a 16 bit number.

 

4. For HCS12 chip, a memory address is a 16 bit number and each memory location hold an 8 bit data. And we call a 16 bit data "word" and it is two byte.

 

5. Design the program to start at $3100 and data to start at $3000.

 

6. Make your program user-friendly and fool proofed. Print detail guide on the terminal screen so that users will properly use your program. Once your program is running, everything must be self-explanatory to user at the Hyper Terminal.

 

7. For this homework, you must do error checking to see if correct input is entered by a user. And give correct command usage example if invalid command was entered. Your program must NOT crash or hang if a user enters wrong input.

 

8. The HyperTerminal display should look something like the following:

 

  > go 3100 (or hit "run" button on simulator)

 

  Welcome to the Simple Memory Access Program!  

  Enter one of the following commands (examples shown below)

 

  >$S3000  

  >$3000 = $126A   4714   :to see the memory content at $3000 and $3001

 

  >$W3003 $126A  

  >$3003 = $126A   4714   :to write $126A to memory locations $3003 and $3004

 

  >$W3003 4714  

  >$3003 = $126A   4714   :to write $126A to memory locations $3003 and $3004

 

  >Quit  

  >Ter writing now    :quit the Simple Memory Access Program

 

  >$W300C  

  >invalid input, address

 

  >$S34678  

  >invalid input, data

 

  >$W3003 $126AB  

  >invalid input, data

 

  >$W3003 70000  

  >invalid input, data

 

 University** **Homework 6** Due: Oct. 09, 2023 11:30pm **Objective** To learn how to use arithmetic instructions and write basic system I/O subroutines. Learn user interface through a serial port. **Instruction** 1. Write a user-friendly system program for the following commands: - **S**: Show the contents of memory location in word format. - **W**: Write the data word (not byte) to memory location. - **QUIT**: Quit the main program, run 'Type writer' program. 2. **Command S**: This command shows the contents of memory location specified by the address in hexadecimal number followed by the 'S' character. For example, if the data $126A is stored in memory location $3000, a user types in the first line ending with Enter/Return key and the following should be displayed on the HyperTerminal connected to the HCS12 board: >$S3000 >$3000 = $126A 4714 The data $126A is printed in both hexadecimal and decimal number format. The character '>' is the prompt for this program. 3. **Command W**: this command writes data into the memory location specified by the address in hexadecimal followed by the 'W' character. The data to be written to the memory location is followed by a space and it can be specified by hexadecimal '$' or just decimal number. For example, if one wants to store the data $126A in memory location $3003, a user types in the first line ending with Enter/Return key and the following should be displayed on the HyperTerminal connected to the HCS12 board: >$W3003 4714 >$3003 = $126A 4714 Or >$W3003 $126A >$3003 = $126A 4714 As a result, the word data $126A is stored in the memory location $3003 and it is shown with the 'S' command. The 'W' command accepts both '4714' or '$126A' as a 16 bit number. 4. For HCS12 chip, a memory address is a 16 bit number and each memory location hold an 8 bit data. And we call a 16 bit data "word" and it is two byte. 5. Design the program to start at $3100 and data to start at $3000. 6. Make your program user-friendly and fool proofed. Print detail guide on the terminal screen so that users will properly use your program. Once your program is running, everything must be self-explanatory to user at the Hyper Terminal. 7. For this homework, you must do error checking to see if correct input is entered by a user. And give correct command usage example if invalid command was entered. Your program must NOT crash or hang if a user enters wrong input. 8. The HyperTerminal display should look something like the following: > go 3100 (or hit "run" button on simulator) Welcome to the Simple Memory Access Program! Enter one of the following commands (examples shown below) >$S3000 >$3000 = $126A 4714 :to see the memory content at $3000 and $3001 >$W3003 $126A >$3003 = $126A 4714 :to write $126A to memory locations $3003 and $3004 >$W3003 4714 >$3003 = $126A 4714 :to write $126A to memory locations $3003 and $3004 >Quit >Ter writing now :quit the Simple Memory Access Program >$W300C >invalid input, address >$S34678 >invalid input, data >$W3003 $126AB >invalid input, data >$W3003 70000 >invalid input, data --- Let me know how you'd like to proceed!


51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468