0% found this document useful (0 votes)
283 views

Program For Converting From Big Endian To Little Endian in Assembly Language Using Visual Studio

The document describes a program that converts a number from big endian to little endian format in assembly language using Visual Studio. The program defines variables to store the big endian and little endian values. It then uses MOV instructions to copy the bytes from big endian to little endian, reversing their order to convert between the two formats. The number's hexadecimal value is understood to be 12345678.

Uploaded by

Dilawar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
283 views

Program For Converting From Big Endian To Little Endian in Assembly Language Using Visual Studio

The document describes a program that converts a number from big endian to little endian format in assembly language using Visual Studio. The program defines variables to store the big endian and little endian values. It then uses MOV instructions to copy the bytes from big endian to little endian, reversing their order to convert between the two formats. The number's hexadecimal value is understood to be 12345678.

Uploaded by

Dilawar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

12/9/2018 1.

Program for converting from Big Endian to Little Endian in Assembly Language using Visual Studio

Programming Tutorials
SUBSCRIBE

1. Program for converting from Big Endian


to Little Endian in Assembly Language using
Visual Studio
December 13, 2017

Chapter 4

Data Transfers, Addressing, and Arithmetic

Assembly Language Programming Exercise

Problem # 1:

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

Solution:

; Program Name: bigEndian to LittleEndian

.386

.model flat,stdcall
.stack 4096

ExitProcess PROTO, dwExitCode:DWORD

.data
bigEndian BYTE 12h,34h,56h,78h

littleEndian DWORD ?

http://csprogrammingtutorial.blogspot.com/2017/12/Converting-from-Big-Endian-to-Little-Endian.html 1/3
12/9/2018 1. Program for converting from Big Endian to Little Endian in Assembly Language using Visual Studio

.code
Programming Tutorials
main PROC
SUBSCRIBE
mov al,[bigEndian+3]

mov BYTE PTR [littleEndian],al

mov al,[bigEndian+2]

mov BYTE PTR [littleEndian+1],al

mov al,[bigEndian+1]

mov BYTE PTR [littleEndian+2],al

mov al,[bigEndian]
mov BYTE PTR [littleEndian+3],al

INVOKE ExitProcess,0

main ENDP

END main

Let me know in the comment sec on if you have any ques on.

Previous Post:

Program to AddVariables Program in Assembly Language using Visual Studio

Next Post:

Exchanging Pairs of Array Values

ASSEMBLY BASICS ASSEMBLY LANGUAGE FOR X86 PROCESSORS CHAPTER 4

COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE COMPUTER SCIENCE

DATA TRANSFERS ADDRESSING AND ARITHMETIC EXERCISE SOLUTION VISUAL STUDIO

Reactions: funny (0) interesting (0) cool (0)

http://csprogrammingtutorial.blogspot.com/2017/12/Converting-from-Big-Endian-to-Little-Endian.html 2/3

You might also like