x86, difference between BYTE and BYTE PTR

Summary: NASM/YASM requires word [ecx] when the operand-size isn’t implied by the other operand. (Otherwise [ecx] is ok). MASM/TASM requires word ptr [ecx] when the operand-size isn’t implied by the other operand. (Otherwise [ecx] is ok). They each choke on the other’s syntax. WARNING: This is very strange area without any ISO standards or easy-to-find … Read more

Difference between “section” and “segment” in NASM

From the nasm documentation: The SECTION directive (SEGMENT is an exactly equivalent synonym) Nasm can produce output in various formats, some of which support sections. Certain section names can be arbitrary (such as the three you listed), for them only the section flags count. The predefined ones are just convenience shortcuts, .text is marked as … Read more

Base pointer and stack pointer

When the function is called, the stack looks like: +————-+ | Parameter 2 | +————-+ | Parameter 1 | +————-+ | Return Addr | <– esp +————-+ then after the “stack frame” is set up: +————-+ | Parameter 2 | <– [ebp + 12] +————-+ | Parameter 1 | <– [ebp + 8] +————-+ | … Read more

ASM: MASM, NASM, FASM?

MASM (Microsoft Assembler) is the popular assembler for Windows. MASM is for 16-bit and 32-bit applications(x86). ML64 is the one for 64 bit sources (AMD64/x86-64) NASM (Netwide Assembler) is the popular assembler for Linux but is available on Windows too. NASM supports 16-bit, 32 bit and 64 bit programs. FASM (Flat Assembler) is available for … Read more

A good NASM/FASM tutorial? [closed]

There is e.g. Writing A Useful Program With NASM and of course the obvious http://www.nasm.us/doc/nasmdoc3.html. There are a couple of sample programs at http://www.csee.umbc.edu/help/nasm/sample.shtml If you are looking for a more general introduction to assembly programming there is The Art of Assembly Programming and the wikipedia page on NASM references Assembly Language Step by Step … Read more

What are the sizes of tword, oword and yword operands?

Looking at the nasm source, it looks like: ‘oword”https://stackoverflow.com/”DO’ is 8 times as big as “word” (O for “octoword”), synonymous with dqword (“double-quad”); that would be 128 bits, corresponding to the size of an SSE vector register. ‘tword”https://stackoverflow.com/”DT’ is 80 bits (T for “ten bytes”), the full size of an Intel x87 floating point register. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)