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

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...
>>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...
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...
Create the following java program with class list that outputs: //output List Empty List Empty List...
Create the following java program with class list that outputs: //output List Empty List Empty List Empty Item not found Item not found Item not found Original list Do or do not. There is no try. Sorted Original List Do There do is no not. or try. Front is Do Rear is try. Count is 8 Is There present? true Is Dog present? false List with junk junk Do or moremorejunk do not. There is no try. morejunk Count is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT