Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please please someone help me (Print Decimal) Assembly Language . For a certain

ID: 3695800 • Letter: P

Question

please please someone help me (Print Decimal)  Assembly Language .

For a certain value, say 235, for example, to print it out,
we will need to extract each digit, convert it to its ASCII
code by adding 30h, and then print it. Consider the
following process:
235 / 10 (the base) 23 …with remainder 5
23 / 10 2 … with remainder 3
2 / 10 0 … with remainder 2
Here are some points to note:
1. The set of the remainder are what we need to print, but
it’s in reverse order;
2. We need to keep dividing the number by 10, which is the
radix, until it becomes 0.
3. Therefore, the important instructions that you need to
know before you start working on this problem are DIV and
stack operations. Please check your textbook for DIV.
II. Assignment:
1. Write an ASM program to produce the following output:
HEX = 7FFF
Decimal = 32767
Where 7FFF is hard-coded and 32767 is the only output your
Computer Organization Printing Decima Numberl <2/2>
2. Algorithm consists of two parts:
a. Part 1:
i. Divide the number;
ii. Keep the remainder in stack;
iii. The quotient becomes the number;
iv. Repeat i~iii until the number (or the quotient)
becomes 0.
Don’t forget that you need a counter to record
how many digits you have.
When this part is finished, the number in decimal
format is ready in the stack.
b. Part 2: Pop the stack and print it using the counter
you accumulate in the last step.
3. Name this program u2Prn10a.asm.
4. Create u2Prn10b.asm based upon u2Prn10a.asm. In this
program, you are going to use procedures.
III. In-Class Lab:
To help you better understand what you need to do, use
debug to assemble a COM program called prndigit.com. The
steps follow:
1 Initialize BX to 0 and AX to 7FFF
2 Compare AX with 0
3 If AX is 0 then jump to next part
4 ;; The above two lines are same as while (AX != 0)
5 ;; Beginning of the while loop
6 Set DX to 0 and CX to decimal value 10
7 DIV CX ;; Check this out
8 PUSH DX;; Why need to push DX?
9 Increment the value of BX
10 ;; End of the loop and need go back to see if AX is 0
11 ,, Here is the beginning of the new part
12 Let CX have the value of BX
13 ;; since BX contains the number of digits.
14 Keep popping and adding 30H to the value and print it out.

Explanation / Answer

After that, you have a fair amount of freedom. The following chapter dependency graph shows how later chapters depend on knowledge gained from other chapters. 1. Basic Concepts: Applications of assembly language, basic concepts, machine language, and data representation. 2. x86 Processor Architecture: Basic microcomputer design, instruction execution cycle, x86 processor architecture, x86 memory management, components of a microcomputer, and the input-output system. 3. Assembly Language Fundamentals: Introduction to assembly language, linking and debugging, and defining constants and variables. 4. Data Transfers, Addressing, and Arithmetic: Simple data transfer and arithmetic instructions, assemble-link-execute cycle, operators, directives, expressions, JMP and LOOP instructions, and indirect addressing. 5. Procedures: Linking to an external library, description of the book’s link library, stack operations, defining and using procedures, flowcharts, and top-down structured design. 6. Conditional Processing: Boolean and comparison instructions, conditional jumps and loops, high-level logic structures, and finite-state machines. 7. Integer Arithmetic: Shift and rotate instructions with useful applications, multiplication and division, extended addition and subtraction, and ASCII and packed decimal arithmetic. 8. Advanced Procedures: Stack parameters, local variables, advanced PROC and INVOKE directives, and recursion. 9. Strings and Arrays: String primitives, manipulating arrays of characters and integers, twodimensional arrays, sorting, and searching. 10. Structures and Macros: Structures, macros, conditional assembly directives, and defining repeat blocks. 11. MS-Windows Programming: Protected mode memory management concepts, using the Microsoft-Windows API to display text and colors, and dynamic memory allocation. 12. Floating-Point Processing and Instruction Encoding: Floating-point binary representation and floating-point arithmetic. Learning to program the IA-32 floating-point unit. Understanding the encoding of IA-32 machine instructions. 1 through 9 10 11 12 13 14 16 17 15 xxiv Preface 13. High-Level Language Interface: Parameter passing conventions, inline assembly code, and linking assembly language modules to C and C++ programs. 14. 16-Bit MS-DOS Programming: Calling MS-DOS interrupts for console and file input-output. • Appendix A: MASM Reference • Appendix B: The x86 Instruction Set • Appendix C: Answers to Review Questions The following chapters and appendices are supplied online at the Companion Web site: 15. Disk Fundamentals: Disk storage systems, sectors, clusters, directories, file allocation tables, handling MS-DOS error codes, and drive and directory manipulation. 16. BIOS-Level Programming: Keyboard input, video text, graphics, and mouse programming. 17. Expert MS-DOS Programming: Custom-designed segments, runtime program structure, and Interrupt handling. Hardware control using I/O ports. • Appendix D: BIOS and MS-DOS Interrupts • Appendix E: Answers to Review Questions (Chapters 15–17) Instructor and Student Resources Instructor Resource Materials The following protected instructor material is available on the Companion Web site: www.pearsonhighered.com/irvine For username and password information, please contact your Pearson Representative. • Lecture PowerPoint Slides • Instructor Solutions Manual Student Resource Materials The student resource materials can be accessed through the publisher’s Web site located at www.pearsonhighered.com/irvine. These resources include: • VideoNotes • Online Chapters and Appendices • Chapter 15: Disk Fundamentals • Chapter 16: BIOS-Level Programming • Chapter 17: Expert MS-DOS Programming • Appendix D: BIOS and MS-DOS Interrupts • Appendix E: Answers to Review Questions (Chapters 15–17) Students must use the access card located in the front of the book to register and access the online chapters and VideoNotes. If there is no access card in the front of this textbook, students can purchase access by going to www.pearsonhighered.com/irvine and selecting “purchase access to premium content.” Instructors must also register on the site to access this material. Students will also find a link to the author’s Web site. An access card is not required for the following materials: • Getting Started, a comprehensive step-by-step tutorial that helps students customize Visual Studio for assembly language programming. • Supplementary articles on assembly language programming topics. Preface xxv • Complete source code for all example programs in the book, as well as the source code for the author’s supplementary library. • Assembly Language Workbook, an interactive workbook covering number conversions, addressing modes, register usage, debug programming, and floating-point binary numbers. Content pages are HTML documents to allow for customization. Help File in Windows Help Format. • Debugging Tools: Tutorials