Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started