Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Other

CS 1105-01 – AY2026-T3 Assignment Activity Unit 7 | Actual verified study complete Solutions | A+ Graded | 2026 Updated | 100% correct

Document preview thumbnail
Preview 2 out of 5 pages

CS 1105-01 – AY2026-T3 Assignment Activity Unit 7 | Actual verified study complete Solutions | A+ Graded | 2026 Updated | 100% correct

Content preview

CS 1105-01 – AY2026-T3 Assignment Activity Unit 7 | Actual
verified study complete Solutions | A+ Graded | 2026 Updated |
100% correct




Bijay Krushna Mohapatra

Department of Computer Science
CS 1105-01 - AY2026-T3-Assignment Activity Unit 7




Assembly Language Implementation of a Stack for String Reversal

Being new to assembly language programming, this project is intended for me to show an
understanding of lower-level concepts by creating a stack data structure in an assembly
language to reverse a string, a common programming task. The following describes the design,
development, and advantages of an assembly language program.

1. An Assembly Language String Reversal Program Using a Stack

Due to the difficulty of providing a complete assembly program which is executable with this
response, here is a summary of the important components and logic. The program has a
simplified assembly language target environment (for example: an x86 architecture with a
nofrills assembler) and the organization for instructional clarity and value rather than the
ultimate in optimization.

Data Segment: An area defining memory locations for the string to reverse, the stack, and
variables needed including the stack pointer.

, • original_string: db “Hello World”, 0 ; Null-terminated string

• reversed_string: db 20 dup(0) ; Buffer for reversed string

• stack: db 10 dup(0) ; Stack (limited size for simplicity)

• stack_pointer: dw stack ; Pointer to the top of the stack

The Code Section is where the logic for the program is located.

• Push Function: This subroutine accepts a character and pushes it to the stack.

* Verify that the stack has not overflowed (the stack pointer is not past the stack
boundary).

* Set the character in memory, at the address pointed to by the stack pointer.

* Increment the stack pointer.

• Pop Function: This subroutine pops a character off the stack.

* Verify the stack has not underflowed (the stack pointer is greater than the stack's
base address).

* Decrement the stack pointer.

* Get the character from memory, at the address pointed to by the stack pointer.

• Main Program Logic:

* Load the address of the original string.

* Loop through string, and pushing it to the stack, character by character.

* Load address for the reversed string.

* Loop to pop off the stack and store them in the reversed string buffer.

* Null terminate the reversed string.

* (Optional) Print the reversed string (requires special calls depending on the system).

Document information

Uploaded on
April 9, 2026
Number of pages
5
Written in
2025/2026
Type
Other
Person
Unknown
$14.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
EduSprint
3.9
(8)
Sold
61
Followers
6
Items
7090
Last sold
2 days ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions