What is MASM? which we usually use to study assembler code?

In the 8086 processor we use different characters ... I think they are 16 bits long ... but we practice the code on 64-bit computers. How is this possible? MaSm really ??? and can you explain to me where i can get the software ....

+4
source share
4 answers

MASM is a macro assembler. Microsoft Assembler has been operating since 1981 and is being updated by Microsoft to keep abreast of the needs of the operating system and processor development. for compatibility issues check this

can be downloaded from here

+2
source

MASM is an assembler of Microsoft Macro. This is an assembler. It takes your code preprocesses it and converts it to binary. Links to an executable or OBJect file.

all Intel processors 32bit and em64t processors (80386 and higher) support 8086 compatibility mode called "real mode". This means that all PCs to this day are backward compatible with MS-DOS and all the games that were used to work on the IBM XT. They will work on modern machines, but very quickly, so they will be unplayable :-)

All computers to this day are loaded with the processor in real mode, and modern operating systems translate the processor into 32-bit / 64-bit "protected mode".

Basically, what happens in real mode, the CPU knows that it works like 8086. For example: all operations are on 16-bit registers, and the memory is addressed by a segment: pair offset. Memory addresses are physical memory addresses, and you have access to the first 1 MB of RAM. The physical address is calculated by the segment shifted to the left by 4 bits + offset. Thus, 8000h: 100h is the same address as 8010h: 0h, the physical address is 80100h in memory.

Some modern machines have EFI instead of BIOS, and from the very beginning boot in "protected mode". MAC machines are like that.

+2
source

Repl. MASM: Microsoft Macro Assembler Assembler Microsoft Macro (MASM) is an assembler for the x86 family of microprocessors, originally created by the Microsoft MS-DOS operating system. It supported a large number of macrolevels and structured programming idioms, including high-level constructs for looping, procedure calls, and interleaving (which is why MASM is an example of high-level assembler). Later versions added the ability to release programs for Windows operating systems that were released for subsequent work with MS-DOS. MASM is one of the few Microsoft development tools for which there was no separate 16-bit and 32-bit version. Assembler allows the programmer to seek additional performance using three approaches to performance-based solutions. MASM can create very small, high-performance executables that are well suited for measuring size and speed. When other languages ​​require additional performance, MASM can improve the performance of these languages ​​with small, fast and powerful dynamic link libraries. For programmers working in Microsoft Visual C / C ++, MASM creates modules and libraries that are in the same format, so a C / C ++ programmer can create modules or libraries in MASM and directly link them to their own C / C programs C ++. This allows the C / C ++ programmer to focus on critical areas of his code in a very efficient and convenient way, by graphical manipulations, games, very high-speed manipulations and data processing, analyzing at speeds that most programmers have never seen, encryption, compression, and any other form processing information that is intensively processed by the processor.

+1
source

MASM stands for Macro Assembler. In modern (32 and 64 bit), the so-called "real mode" is used here, which supports 16 and even 8-bit registers for backward compatibility. Basically, the processor “emulates” the older one, so programs designed for this processor will work even on newer ones. For MASM, just ask Google.
I suggest you use Easy Code using MASM. This is an IDE that allows you to create win32 executables using assembly language.

0
source

Source: https://habr.com/ru/post/1336101/


All Articles