Assembler (assembly language)
MASM (Microsoft’s Assembler) What’s a compiler? What’s an assembler?
Representing numbers (ints) Fixed, finite number of bits. bits bytes C/C++ Intel Sun 8 1 char [s]byte byte 16 2 short [s]word half 32 4 int or long [s]dword word 64 8 long long [s]qword xword
MASM (Microsoft’s Assembler) Defining data in MASM: [label] <tab> type <tab> val1[,…,valn] <tab> [;comment] For unsigned int data, type may be byte, word, or dword. For signed int data, type may be sbyte, sword, sdword.
MASM (Microsoft’s Assembler) [label] <tab> type <tab> val1[,…,valn] <tab> [;comment] .data ;begin data section count dword 0 ;counter - init to 0 tbl byte 1, 2, 4, 8, 16, 32, 64, 128 ;power-of-2 table . .code ;begin code section