Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COMPUTER ASSEMBLY LANGUAGE modify our classic Hello, world program to print the text in a fancy way: diagonally. The output of your program should look

COMPUTER ASSEMBLY LANGUAGE

image text in transcribed

image text in transcribed

image text in transcribed

modify our classic "Hello, world" program to print the text in a fancy way: diagonally. The output of your program should look like this at all. You can use any of the instructions we have learned so far, but you'll mostly need inc and dec, cmp. and the various conditional jumps. You can either use syscalls or the C standard ibrary functions Heres the syscall-style Hello, world! program: hello.s Prints "Hello, world! 939 section .data msg MSGLEN db equ "Hello, world!", 18, 8 $-nsg section .text global start start: mOv mov rdi, 1 mov rsi, g mov rdx, HSGLEN syscall ; Syscall code in rax ;1st arg, file desc. to urite to ; 2nd arg, addr. of message ; 3rd arg, num. of chars to print rax, 1 ; Terminate process mov mov rdi, e syscall ; Syscall code in rax ; First paraneter in rdi ; End process rax, 60 And here it is using the C library ;;; hello.s Prints "Hello, world!" section .data ; Note: sg it nul-terminated db "Hello, world!", 18, 0 nsg section .text extern printf global start start: push rbp Bov rbp, rsp mov rdi, mSg call printf pop rbp mov rax, 8 re modify our classic "Hello, world" program to print the text in a fancy way: diagonally. The output of your program should look like this at all. You can use any of the instructions we have learned so far, but you'll mostly need inc and dec, cmp. and the various conditional jumps. You can either use syscalls or the C standard ibrary functions Heres the syscall-style Hello, world! program: hello.s Prints "Hello, world! 939 section .data msg MSGLEN db equ "Hello, world!", 18, 8 $-nsg section .text global start start: mOv mov rdi, 1 mov rsi, g mov rdx, HSGLEN syscall ; Syscall code in rax ;1st arg, file desc. to urite to ; 2nd arg, addr. of message ; 3rd arg, num. of chars to print rax, 1 ; Terminate process mov mov rdi, e syscall ; Syscall code in rax ; First paraneter in rdi ; End process rax, 60 And here it is using the C library ;;; hello.s Prints "Hello, world!" section .data ; Note: sg it nul-terminated db "Hello, world!", 18, 0 nsg section .text extern printf global start start: push rbp Bov rbp, rsp mov rdi, mSg call printf pop rbp mov rax, 8 re

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions