Question

In: Computer Science

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)

Solutions

Expert Solution

Answer:

Note: In case of any query please comment.

// 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));
}
}

ASSEMBELY LANGUAGE OF THE ABOVE 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 IMAGE:

COMMENT: I hope my answer met all your requirements.Please Upvote. Thank You!!


Related Solutions

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
Write a program in assembly language that outputs the leap years between a beginning and an...
Write a program in assembly language that outputs the leap years between a beginning and an ending year. 1. Initialize $a0 and $a1 with the beginning and ending years. 2. Print out the leap years between 1970 and 2030. OUTPUT: From 1970 to 2030: 1972 … 2028
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 an assembly language program on the 9S12 CPU to read switches and drive LED's 1-Configure...
Create an assembly language program on the 9S12 CPU to read switches and drive LED's 1-Configure all bits of Port U for output using address DDRU. There are 8 LEDs connected to those pins. When you output a 1 to a bit, that bit will be enabled for output, so when you later write a 1 to a bit in port U (PTU) that LED will turn ON. 2. Switches are attached to Port T. They work by grounding the...
Q1: A. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS B. WRITE AN ASSEMBLY LANGUAGE...
Q1: A. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS B. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO SOLVE THE EQUATION Z=A+B-(C/D)+E please write the answer separately part A its own code and part B its own code this is microprocessor the ASSEMBLY LANGUAGE emu8086 should be written like this EX: mov ax,100h mov bx,200h etc
Assembly Language Programming Construct an assembly language program fragment equivalent to the following C/C++ statement: if...
Assembly Language Programming Construct an assembly language program fragment equivalent to the following C/C++ statement: if (M <= N + 3 && (C == ‘N’ || C == ‘n’)) C = ‘0’; else C = ‘1’; Assume that M and N are 32-bit signed integer variables, and C is an 8-bit ASCII character variable. All variables are stored in memory, and all general-purpose registers are available for use.
Code using assembly language Create a program using the Irvine32 procedures were the user can input...
Code using assembly language Create a program using the Irvine32 procedures were the user can input a list of 32-bit unsigned integers an “x” number of times, then display these integers to the console in reverse order. Hint: Use loops and PUSH & POP instructions. Extra Challenge: Inform the user with a message what to do; also, tell them what they are seeing.
MIPS Assembly LanguageWrite a MIPS assembly language program that asks the user toinput an...
MIPS Assembly LanguageWrite a MIPS assembly language program that asks the user to input an integer and then prints out a string that shows how that integer should be encoded using 16 bits. Your program should handle both positive and negative valued inputs. Your program should also print out an error message if the given input cannot be expressed as a 16 bit signed integer.As an example, if the input is 12, your program should output “0000000000001100”. If the input...
Hi this is Assembly Language MASM x86 program. Please write it in the language and please...
Hi this is Assembly Language MASM x86 program. Please write it in the language and please explain it with comments thank you Please answer it I really need help this question was refunded before so please answer. Thank you so much also these are two separate programs thank you. 1) Write a procedure to read in decimal or hex number (byte-sized) Then write a procedure using shifts and ANDS to convert the string to a binary number (if is backward,...
Solve in C language This program outputs a downwards facing arrow composed of a rectangle and...
Solve in C language This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width. (1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt) (2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT