MASM ASSEMBLER PRESENTED BYRAMYA V 5 TH SEM
MASM ASSEMBLER PRESENTED BYRAMYA. V 5 TH SEM, ISE
Assembler means one that assembles a computer program which translates assembly language to an object file or machine language format.
• The Microsoft Macro Assembler (MASM) is an x 86 assembler that uses the Intel syntax for MS-DOS and Microsoft Windows. • Beginning with MASM 8. 0 there are two versions of the assembler - one for 16 -bit and 32 bit assembly sources and another (ML 64) for 64 -bit sources only.
MASM BASICS • SEGMENT: a collection segments, each segment is defined as belonging to a particular class, CODE, DATA, CONST, STACK registers: CS (code), SS (stack), DS (data), ES, FS, GS similar to program blocks in SIC • ASSUME: e. g. ASSUME ES: DATASEG 2 e. g. MOVE AX, DATASEG 2 MOVE ES, AX similar to BASE in SIC
MASM BASICS • JUMP with forward reference: near jump: 2 or 3 bytes far jump: 5 bytes e. g. JMP TARGET Warning: JMP FAR PTR TARGET Warning: JMP SHORT TARGET Pass 1: reserves 3 bytes for jump instruction phase error • PUBLIC, EXTRN: similar to EXTDEF, EXTREF in SIC
• Object program from MASM, maybe in several different formats to allow easy and efficient execution of the program in a variety of Operating environments. • Produce an instruction timing listing that shows the number of clock cycles required to execute each machine instruction. This allows the programmer to exercise a great deal of control in optimizing timing-critical sections of code.
- Slides: 8