assmbly language please. Proof of your solutions and test results: To show the operation of your program and to verify results from execution, you should use procedures WriteString, WriteInt, DumpMem and DumpReg, whichever applicable for a particular exercise, to display the results.please Make sure the library file Irvine32.inc is included on top of your program; this .inc file includes all the procedures mentioned above, and more. And ntegrate the calls to these procedures to output the results onto the console. Write a 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 12345678 hexadecimal. .data bigEndian BYTE 12h,34h,56h,78h littleEndian DWORD? Hint: Using DumpMem is the best way to show the effect - byte orders "before" and "after" Sample output: DumpMem output showing Big Endian Byte Order Dump of offset 001E6000 ------------------------------- 12 34 56 78 DumpMem output showing Little Endian Byte Order Dump of offset 001E6004 ------------------------------- 78 56 34 12 IMPORTANT: for this exercise, NOT allowable to use any one of these directives: .IF, .ELSE, .ELSEIF, .WHILE, .REPEAT, etc
assmbly language please. Proof of your solutions and test results: To show the operation of your program and to verify results from execution, you should use procedures WriteString, WriteInt, DumpMem and DumpReg, whichever applicable for a particular exercise, to display the results.please Make sure the library file Irvine32.inc is included on top of your program; this .inc file includes all the procedures mentioned above, and more. And ntegrate the calls to these procedures to output the results onto the console.
Write a 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 12345678 hexadecimal.
.data
bigEndian BYTE 12h,34h,56h,78h littleEndian DWORD?
Hint: Using DumpMem is the best way to show the effect - byte orders "before" and "after"
Sample output:
DumpMem output showing Big Endian Byte Order
Dump of offset 001E6000
-------------------------------
12 34 56 78
DumpMem output showing Little Endian Byte Order
Dump of offset 001E6004
-------------------------------
78 56 34 12
IMPORTANT: for this exercise, NOT allowable to use any one of these directives: .IF, .ELSE, .ELSEIF, .WHILE, .REPEAT, etc
Assembly code :
INCLUDE Irvine32.inc
.data
bigEndian BYTE 12h, 34h, 56h, 78h
littleEndian DWORD ?
.code
main PROC
mov esi, OFFSET bigEndian
xor eax,eax
mov al, [esi+3] ;Isolate 5678h
mov ah, [esi+2]
mov ebx, 0
mov bl, [esi+1] ;Isolate 1234h
mov bh, [esi]
mov esi, OFFSET littleEndian
mov [esi], eax ;Move 5678h into lower 16bits of littleEndian
mov [esi+2], bx ;Move 1234h into higher 16bits of littleEndian
invoke ExitProcess, 0
main ENDP
END main
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images