Question

write a program in x86 Processor Assembly Language that uses the variables below and only mov...

write a program in x86 Processor Assembly Language that uses the variables below and only mov instructions to copy the value from Var1 to Var2 reversing the order of the bytes.

.data

Var1 DWORD 56942145h; reversing means should become 45219456h

Var2 DWORD?

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Data Segment str1 db 'String_Reverse','$' strlen1 dw $-str1 strrev db 20 dup(' ') Data Ends Code Segment Assume cs:code, ds:data Begin: mov ax, data mov ds, ax mov es, ax mov cx, strlen1 add cx, -2 lea si, str1 lea di, strrev add si, strlen1 add si, -2 L1: mov al, [si] mov [di], al dec si inc di loop L1 mov al, [si] mov [di], al inc di mov dl, '$' mov [di], dl Print: mov ah, 09h lea dx, strrev int 21h Exit: mov ax, 4c00h int 21h Code Ends End Begin
Add a comment
Know the answer?
Add Answer to:
write a program in x86 Processor Assembly Language that uses the variables below and only mov...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write an ASM program that uses the variables below and MOV instructions to copy the value...

    Write an ASM program that uses the variables below and MOV instructions to copy the value from bigEndian to littleEndian, reversing the order of the bytes. The number’s 32- bit value is understood to be 12345678h. .data bigEndian BYTE 12h, 34h, 56h, 78h littleEndian DWORD ?

  • Task is to implement the following algorithms in Assembly language for x86 processor

    Task is to implement the following algorithms in Assembly language for x86 processor1) Insertion sort Demonstrate Sorted Array of 10 elements in Watch Window for each one Running time of each algorithmsample bubble sort code:;----------------------------------------------------------BubbleSort PROC USES eax ecx esi,pArray:PTR DWORD, ; pointer to arrayCount:DWORD ; array size;; Sort an array of 32-bit signed integers in ascending; order, using the bubble sort algorithm.; Receives: pointer to array, array size; Returns: nothing;-----------------------------------------------------------mov ecx,Countdec ecx ; decrement count by 1L1: push ecx ; save outer...

  • Convert the following assembly language program into a C program: *Update: The variables are initialized, in...

    Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. include "p24Hxxxx.inc" global__reset bss: Uninitialized data section: Variables start at location 0x0800 x: .space 2: Allocating space (two bytes) to variable. y: .space 2;Allocating space (two bytes) to...

  • QUESTION 2 The following program is written in the assembly language of 8085 processor: LXI B,...

    QUESTION 2 The following program is written in the assembly language of 8085 processor: LXI B, 20DF LXI H, 2B44 MOV A, C SUBB MOV A, L ADDH INX B DCXH HLT (a) Complete Table 1 with the machine codes and memory addresses for the whole program. [6 marks] (b) Determine the total number of bytes needed to execute the whole program. [1 mark] (c) State final value of all registers involved in the program. [3 marks)

  • MASM Assembly Language x86 Processor. Must use windows32 framework Write a non-recursive algorithm to find the...

    MASM Assembly Language x86 Processor. Must use windows32 framework Write a non-recursive algorithm to find the greatest common divisor of two positive numbers. . • Your program should read the two positive integers using dialog boxes. If they are not positive, a message box should be displayed with an appropriate message. • Your program needs to have a procedure that takes two positive integers as parameters. • You need to follow cdecl protocol for parameter passing. • Display the valid...

  • MASM Assembly Language x86 Processor. Must use windows32 framework Write a non-recursive algorithm to find the greatest...

    MASM Assembly Language x86 Processor. Must use windows32 framework Write a non-recursive algorithm to find the greatest common divisor of two positive numbers. . • Your program should read the two positive integers using dialog boxes. If they are not positive, a message box should be displayed with an appropriate message. • Your program needs to have a procedure that takes two positive integers as parameters. • You need to follow cdecl protocol for parameter passing. • Display the valid...

  • write a program in x86 assembly language that sorts 10 integers entered from the keyboard and displays them in order

    write a program in x86 assembly language that sorts 10 integers entered from the keyboard and displays them in order

  • NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors...

    NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors - Irvine) that has two procedures, a main procedure and a procedure called Fib. The fib procedure is to uses a loop to calculate and printout the first N Fibonacci numbers. Fibonacci sequence is described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). The value of N is to be communicated to this...

  • Assembly Language: Write and run a program to find the values of each destination operand: .data...

    Assembly Language: Write and run a program to find the values of each destination operand: .data varB BYTE 65h,31h,02h,05h varW WORD 6543h,1202h varD DWORD 12345678h .code mov ax, WORD PTR [varB+2] ; a= mov bl, BYTE PTR varD ; b= mov bl, BYTE PTR [varW+2] ; c= mov ax, WORD PTR [varD+2] ; d= mov eax,DWORD PTR varW   ; e=

  • This is a question from Assembly Language for x86 7th Edition by Kip Irvine, but the...

    This is a question from Assembly Language for x86 7th Edition by Kip Irvine, but the solution is not there. Programming exercise 12.7 #2. The code must be in assembly language for Intel using Kip Irvine library. An example of the source code would be: INCLUDE Irvine32.inc .code main PROC mov ax,4000h mov bx,1000h mov cx,1500h sub ax,bx sub ax,cx call DumpRegs exit main ENDP END main Question: Write a procedure that receives a single-precision floating-point binary value and displays...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT