Choose one (1) of the following applications and provide a complete Assembly Lan
ID: 3839895 • Letter: C
Question
Choose one (1) of the following applications and provide a complete Assembly Language program implementation, a) 32-bit and b) 64-bit.
App1: Geometric Shape Calculator Companion.
App 2: Computation Companion
App 3: Arithmetic, Logical and Relational Calculator Companion
App 4: Translator Companion, (various)
App5: Code and Histogram Analytics
The project details (design, implementation, code, runs) should show evidence of
technical proficiency with the following technological aspects:
1. a)Implementation using 32-bit programming. b)Re-implement using
64-bit programming.
2. Test plan; test cases implementing the test plan and screen shots displaying the
executing the test cases. Note: a test plan should include various Normal,
Boundary and Error cases .
3. Modular organization using procedures, subroutines and functions (PROC, ENDP,
CALL, RET).
4. Use of the system Stack to save and restore register values, pass arguments,
receive results (PUSH, POP).
5. Use of conditional control structures (Jcond, LoopCond, Boolean operations)
6. Use of Arithmetic operations.
7. A clear and comprehensive Project Report, for example, following the outline
provided in Appendix B.
Explanation / Answer
1) a) First, use 32-bit programming:
Taken as a example Hello world
section .text
global_start ;must be declared for linker (ld)
_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db 'Hello, world!', 0xa ;string to be printed
len equ $ - msg ;length of the string
b) example taken as a Hello world :
section .text
;initially declares the linker ID
global_start
;start which speifies the entry point
_start:
;specifies the message length
mov edx,len
;writing the message
mov ecx,msg
;file descriptor (stdout)
mov ebx,1
;system call number (sys_write)
mov eax,4
;call kernel
int 0x80
;system call number (sys_exit)
mov eax,1
;call kernel
int 0x80
section .data
;string to be printed
msg db 'Hello, world!', 0xa
;length of the string
len equ $ - msg