0% found this document useful (0 votes)
29 views5 pages

TP in CompArch Prelims

task performance computer architecture

Uploaded by

Naofumi Iwatani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views5 pages

TP in CompArch Prelims

task performance computer architecture

Uploaded by

Naofumi Iwatani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Villarba, Nicolei Q,

BSCPE4A
09/19/24

Part 1
OneCompiler
https://onecompiler.com/assembly
OneCompiler assembler supports the x86 architecture. It allows users to write and run
assembly code based on the x86 instruction set. The platform provides an online
environment where you can compile and execute assembly programs directly from your
browser. This makes it easier for beginners and those learning assembly language to
experiment with x86-based instructions. However, its primary focus is educational, so it
may not have advanced features found in more complex development tools.

Jdoodle (NASM Compiler IDE)


https://www.jdoodle.com/compile-assembler-nasm-online
NASM (Netwide Assembler) supports the x86 architecture. It is a popular assembler
used to write programs for x86 and x86-64 processors. NASM is known for its simplicity,
speed, and flexibility, making it a great choice for low-level programming. It generates
object files that can be linked and executed on various operating systems, like Windows
and Linux. Because of its strong support for the x86 architecture, NASM is widely used
in both educational and professional environments for assembly programming.

Part 2

a. What does the program do?


- The program executes the sum of the value of x and y and displays the
result.

b. Is the result of the program, correct?


- Yes, the result of the program is correct.

c. How much memory was utilized in the program execution?


- The memory utilized in the program execution is 348 kilobytes.

d. How long did it take to execute the program?


- The time it took to execute the program in 0.788 seconds.

e. Under what section were the x and y initialized?


- The x and y were initialized in the data segment section.
a) What does the program do?
The program performs a simple division operation. It divides the numeric value 9 by 3
and stores the result in the ax register. After the calculation, the program outputs the
message "The result is: 3" using system calls to display it on the console.
b) How many sections were used in the program?
There are three sections used in the program. The text section contains the executable
code where instructions like mov, add, and div are executed. The data section stores
initialized data, like the message to be printed, while the bss section is used for
reserving uninitialized storage space, such as for holding the result of the operation.
c) Identify at least three mnemonics (opcode/directive/macro) that were used in
the program.
The mnemonic add is used to perform addition, in this case, adding values stored in
registers.
The div mnemonic is used to execute an unsigned division operation, dividing the
values stored in the registers.
mov is used to copy data between registers or from memory to a register, transferring
values necessary for computation and output.
d) Identify at least three operands that were used in the program.
The ax operand is used to store results from operations and is often involved in
arithmetic and input/output tasks.
The message operand refers to a memory location holding the string "The result is: ",
which will be printed during program execution.
The immediate values 9 and 3 are used directly in arithmetic operations, representing
numbers to be processed by the program.
e) In the program, which lines of code indicate the storage space allocation for
the message and message length?
The storage space allocation for the message is defined in the data section, specifically
on the line where the message is declared as a string: message db "The result is: ". The
length of the message is defined immediately afterward with length equ $ - message,
indicating how many bytes the message occupies.

You might also like