Question

In: Computer Science

create a program that outputs a picture that represents halloween in ascii art (jack-o-lantern, witch's hat,...

create a program that outputs a picture that represents halloween in ascii art (jack-o-lantern, witch's hat, etc)

ASSEMBLY LANGUAGE PROGRAM

Solutions

Expert Solution

ANSWER

// JAVA PROGRAM

class M{
static String c(int n){
char a = n == 31
? 94
: n > 31
? 'o'
: 32,
b = n < 31
? '^'
: 32;
return (" _____I_____ \n~~~~~~|\n~|"+a+"|"+b+"|"+a+"|"+b+"~|\n~~|"
+(n > 31
? 94
:a)
+"|"+b+"~~|\n~"
+(n < 31
? "~|VvVvV|"
: n == 31
? "|VvVvV~|"
: "|XXXXX~|")
+" |\n|_|_|_|_|_|_|")
.replace("~", "| ");
}

public static void main(String[] a){
System.out.println(c(12));
System.out.println();
System.out.println(c(31));
System.out.println();
System.out.println(c(100));
}
}

ASSEMBLY LANGUAGE OF THIS PROGRAM :

   .section __TEXT, __text, regular, pure_instructions
   .macosx_version_min 10, 12
   .globl _main
   .align 4, 0x90
_main:                               ## @main
   .cfi_startproc
## BB#0:
   pushq %rbp
Ltmp0:
   .cfi_def_cfa_offset 16
Ltmp1:
   .cfi_offset %rbp, -16
   movq %rsp, %rbp
Ltmp2:
   .cfi_def_cfa_register %rbp
   subq $16, %rsp
   leaq L_.str(%rip), %rdi
   leaq _s(%rip), %rsi
   movl $2000, -4(%rbp)       ## imm = 0x7D0
   movl $17, -8(%rbp)
   movl -4(%rbp), %eax
   addl -8(%rbp), %eax
   movl %eax, %edx
   movb $0, %al
   callq _printf
   xorl %edx, %edx
   movl %eax, -12(%rbp)       ## 4-byte Spill
   movl %edx, %eax
   addq $16, %rsp
   popq %rbp
   retq
   .cfi_endproc

   .section __DATA, __data
   .globl _s                   ## @s
_s:
   .asciz

   .section __TEXT, __cstring, cstring_literals
L_.str:                               ## @.str
   .asciz "%s %d \n"


.subsections_via_symbols

OUTPUT OF PROGRAM IS ABOVE IN SNAPSHOT :


Related Solutions

Assembly language program create a program that outputs a picture that represents halloween in ASCll art...
Assembly language program create a program that outputs a picture that represents halloween in ASCll art (jack-o-lantern, witch's hat, etc)
Write a simple java program that produces any text art ("ASCII art") picture. Your program can...
Write a simple java program that produces any text art ("ASCII art") picture. Your program can produce any picture you like, with the following restrictions: • The picture should consist of between 3 and 200 lines of output, with no more than 100 characters per line. • The code must use at least one for loop or static method but should not contain infinite loops.
Create program which sorts letters of a string based on ASCII value. The program will then...
Create program which sorts letters of a string based on ASCII value. The program will then print the sorted string to stdout. Use C programming language. - Only use stdio.h - Input prompt should say "Enter string of your choice: " - Remove any newline \n from input string - Implement sorting operation as a function. Should use selection sort algorithm, but you may use a different algorithm - Output should print sorted string on new line Example:     Enter...
Create a program in JAVA that displays a design or picture for someone in your quarantine...
Create a program in JAVA that displays a design or picture for someone in your quarantine household/group: a pet, a parent, a sibling, a friend. Make them a picture using the tools in TurtleGraphics and run your program to share it with them! Use a pen object, as well as any of the shape class objects to help you create your design. You must use and draw at least 5 shape objects. - You must use a minimum of 4...
Objective: CODE IN JAVA Create a program that displays a design or picture for someone in...
Objective: CODE IN JAVA Create a program that displays a design or picture for someone in your quarantine household/group: a pet, a parent, a sibling, a friend. Make them a picture using the tools in TurtleGraphics and run your program to share it with them! Use a pen object, as well as any of the shape class objects to help you create your design. You must use and draw at least 5 shape objects. You must use a minimum of...
>>python Question: Create program which acquires an integer in the range 1-17, and then outputs a...
>>python Question: Create program which acquires an integer in the range 1-17, and then outputs a times table from that acquired figure. Function should print times table and another function which acquires and returns the ranged integer. Therefore they are distinct functions. Specific details to include: You can also in the central area of the code script allocate a value which is returned aside a function to a variable.(For example table=yourchoiceinteger(1,17).) Therefore that table which is the variable will be...
Create a program called BubleSort.java that implements the Bubble Sort algorithm (The Art of Computer Programming...
Create a program called BubleSort.java that implements the Bubble Sort algorithm (The Art of Computer Programming - Donald Knuth). The algorithm is as follows: The program should be able to do the following: accepts one command line parameter. The parameter specifies the path to a text file containing the integers to be sorted. The structure of the file is as follows: There will be multiple lines in the file (number of lines unknown). Each line will contain multiple integers, separated...
Create a program called BubleSort.java that implements the Bubble Sort algorithm (The Art of Computer Programming...
Create a program called BubleSort.java that implements the Bubble Sort algorithm (The Art of Computer Programming - Donald Knuth). The algorithm is as follows: The program should be able to do the following: accepts one command line parameter. The parameter specifies the path to a text file containing the integers to be sorted. The structure of the file is as follows: There will be multiple lines in the file (number of lines unknown). Each line will contain multiple integers, separated...
Objective: Create a program that displays a design or picture for someone in your quarantine household/group:...
Objective: Create a program that displays a design or picture for someone in your quarantine household/group: a pet, a parent, a sibling, a friend. Make them a picture using the tools in TurtleGraphics and run your program to share it with them! Use a pen object, as well as any of the shape class objects to help you create your design. You must use and draw at least 5 shape objects. You must use a minimum of 4 different colors...
Use C++ Black Jack Create a program that uses methods and allows the user to play...
Use C++ Black Jack Create a program that uses methods and allows the user to play the game of blackjack against the computer dealer. Rules of Blackjack to remember include: 1. You need one 52 card deck of cards with cards from  2-Ace (4 cards of each number). 2. Jacks, Queens and Kings count as 10 points. 3. An Ace can be used as either 1 or 11 depending on what the user decides during the hand. 4. Draw randomly two...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT