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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply