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

Using expressions with symbols Create a program for NASM that contains the follo

ID: 3590278 • Letter: U

Question

Using expressions with symbols Create a program for NASM that contains the following items .Amessage variable that holds the text (preserving line breaks) 3.2 You already know what the next variable will be, don' t you? A length variable that holds the size of the message variable A length5 variable (also in the data section) that holds the result of adding 5 to length (use EQU) A one-operand instruction that adds 1 to the value in the length5 variable (think outside the box for this requirement)

Explanation / Answer

section .text

global _start ;must be declared for linker (ld)

_start:

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 edx,len1

mov ecx,len ;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 "You already know what the next",0xa,"variable will be, don't you?"

len equ $ - msg

len1 equ $ - len

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote