Page 1 of 1

Use an .asciz assembler directive to create a string in the .data section. In the .text section: 1. Print the string who

Posted: Thu Jul 14, 2022 2:18 pm
by answerhappygod
Use an .asciz assembler directive to create a string in the.data section.
In the .text section:
1. Print the string whose address in in %eax.
2. Print this string character-by-character, not all at oncewith a single int 0x80.
.section .data.equ STDIN, 0.equ STDOUT,1.equ READ, 0.equ WRITE,4.equ EXIT,1.equ SUCESS,0
string:.asciz "hello, world\n"string_end:.equ len, string_end - string.section .text.globl _start
_start:movl $WRITE, %eaxmovl $STDOUT, %ebxmovl $string, %ecxmovl $1, %edxint $0X80mov %eax, %ecxinc $eaxpush %eaxmovl $EXIT, %eaxmovl $SUCCESS, %ebxint $0X80
Use this as a template. In simple AT&T syntax, originalanswer only.