
Learn to write code for x86 assembly, access registers and memory addresses, and master data transfer, addressing, procedures, stack operations, and conditional jumps for beginners.
Master assembly language for x86 and Intel 64 processors, from number systems and data representation to moves and registers, enabling optimization and hardware control on Windows with Visual Studio 2022.
Install Visual Studio 2022 Community edition by visiting the Visual Studio site, selecting Community 2022, running the installer, enabling desktop development with C++ and creating a Microsoft account.
Set up MASM with Visual Studio 2022 by downloading the zip from GitHub, extracting files, opening the project, and configuring the console subsystem and main entry.
Explore decimal, binary, and hexadecimal number systems, each defined by its base and digits, and learn how to compute values using powers of the base and the least significant digit.
Convert binary to hexadecimal by grouping bits in fours from the right, padding the left with zeros, and mapping each group to hex; the example yields 2c8d.
Convert hexadecimal digits to binary by mapping each hex digit to its 4-bit value. Show how 2c8d becomes 0010 1100 1000 1101.
Convert binary numbers to decimal by multiplying each digit by two raised to its positional power and summing the results, starting from the right with the least significant digit.
Convert hexadecimal to decimal by multiplying each digit by sixteen raised to its positional power and summing. For example, 52B hex equals 1323 decimal, with B representing eleven.
Convert decimal numbers to binary by dividing by two and recording remainders to assemble the bits. See the process in action with 83 decimal, which yields 1010011 in binary.
Convert decimal to hexadecimal by dividing by 16, tracking quotients and remainders, and assembling digits from last remainder as the most significant. For example, 298 decimal equals 12a hexadecimal.
Explore binary addition and subtraction in x86 assembly fundamentals, demonstrating carry propagation and borrowing from higher bits through bitwise operations.
Practice hexadecimal addition by adding hex numbers step by step, tracking carries and remainders, and converting sums between hexadecimal and decimal to arrive at the final result.
Subtract 69176583 hex from f32b0028 hex in a step-by-step guide, illustrating borrowing across digits, digit-level operations, and hex-to-decimal checks to verify intermediate results.
Explore how 8-bit x86 memory stores signed numbers, where 0–7 indicates positives up to 7fffffff. See how two's complement encodes negatives; -1 becomes 11111111, or ff hex.
Explore overflow in x86 style addition by converting digits to binary, adding hexadecimal numbers, and noting when final carries differ.
Explore integer constants and expressions in x86 assembly, including optional signs and radices (decimal, binary, octal, hexadecimal), with 32-bit evaluation under operator precedence, parentheses, unary plus/minus, multiply/divide, and modulus.
Store character constants in memory as ASCII codes from quotes, e.g., M 77; m 109. Represent string constants as sequences stored as byte values, e.g., WXYZ 57, 58, 59, 5A.
Identify reserved words, instruction mnemonics like mov, add, and sub, register names such as al and ax, directives such as .data and .code, and identifiers.
Differentiate directives from instructions in assembly language, showing how directives allocate storage, define segments, and declare variables, and how instructions transfer control and move data with operands and comments.
Identify and differentiate data and code labels in assembly, understanding how labels serve as addresses for variables and as jump targets, with code labels ending in a colon.
Explore how mnemonics map to x86 instructions and how operands range from zero to three, with examples like mov, add, sub, mul, div, cmp, jmp, and inc.
Explore two comment styles in x86 assembly—single line comments with a semicolon and block comments with symbols—and learn how the NOP instruction aligns code to four-byte boundaries and even addresses.
Define byte and signed byte data with unsigned and signed ranges, including uninitialized data and character literals. Use directives for byte, word, double word, and quad word with dup.
Explore x86 registers as high-speed cpu storage, detailing general-purpose registers like al/ax and eax for arithmetic and data movement, plus segment registers cs, ds, es, and eip/eflags.
Compare little-endian and big-endian data order as used in x86 processors, and understand how the least significant byte is stored at the lowest address in memory.
discover how to write a 32-bit assembly template without Irvine32, using dot 386 directive, flat memory model, std call, 4096 byte stack, and main procedure that calls dumpregs and exits.
Create an Irvine32 IA32 32-bit assembly template with a title, semicolon-delimited description, a data segment for variables, a code segment, and main proc entry with exit macro for win32 console.
Define strings in x86 assembly using the data and code segments, irvine32.inc, declare null-terminated strings, and display them with write a string, CRLF, and string concatenation using backslash.
Create a simple x86 assembly hello world program using irvine32.inc, with data and code segments, loading the string into edx and calling writestring and crlf to display it.
Create an assembly program in a project named project32_vs2022 without irvine32, using .386 and flat memory model with a 4096-byte stack, perform 1+4-2, and display registers with dumpRegs, then exit.
Learn assembly basics with an Irvine32 example that initializes hex variables, uses mov, add, and sub to compute results in eax, and updates finalval.
Create an unsigned integer to binary, decimal, and hexadecimal converter in x86 assembly using Irvine32.inc, demonstrating input, display, and line breaks with a simple example program.
Write an x86 assembly program that reverses a big-endian value to little-endian using only move instructions, then display the hexadecimal results for both endianness.
Learn how the mov instruction copies data from source to destination, with the first operand as destination and the second as source, and operands must be the same size.
Explore the movzx instruction for zero-extending unsigned data in x86, covering three variants from eight- or sixteen-bit sources to sixteen- or thirty-two-bit destinations with register and memory examples.
Explore the movsx instruction for signed integers across x86, showing three variants that sign-extend from 8- or 16-bit sources to 16- or 32-bit destinations, with hex examples.
Learn how the xchg instruction exchanges values between operands, covering register-register, memory-register, and register-memory variants, with examples using var1 and var2 in 32-, 16-, and 8-bit contexts.
Build an x86 assembly B-Example program that reads a lowercase character and converts it to uppercase using a 20h difference, then displays the result with Irvine32.inc.
learn to implement a 32-bit signed integer expression in x86 assembly for beginners by computing (A-B)+(C-D) using eax, ebx, ecx, edx, and displaying the result with DumpRegs.
Learn to implement an 8-bit unsigned arithmetic expression in x86 assembly. Compute A=(A+B)-(C+D) using Irvine32 and DumpRegs to display results.
Understand the align directive and how it aligns variables on byte, word, double word, or paragraph boundaries in the DOT data segment, and how esi offsets change with align values.
Use the lengthof operator to count elements in the dot data segment declarations. Move the length to eax to validate 6 (byte1), 20 (array1), and 30 (array2).
Use the ptr operator to override a label’s type and access parts of a double‑word in memory, demonstrating byte and word extractions in little‑endian x86 dot data segment.
Demonstrates how the sizeof operator returns a value by multiplying lengthof by type in the dot data segment, across byte, word, and double word element sizes.
Type operator returns the size in bytes of a data element. Declare var1 to var4 with sizes byte, word, double word, quad word, and move type to eax.
Explore how addition and subtraction affect the x86 ALU status flags, including zero, sign, carry, auxiliary carry, parity, and overflow, based on the contents of the destination operand.
Demonstrate inc and dec instructions on register or memory, with a doubleword var initialized to 0x10000000 in the data and code segments, moved to eax; show increment and subsequent decrement.
Learn indirect addressing as a pointer-based approach to array processing in x86 assembly, using ESI to step through byte, word, and double word arrays with incremental addressing.
Explore indexed operands that form effective addresses by adding a constant to a register, with index scaling of arrays loaded by mov in dot data and code segments.
Master pointers in x86 assembly by declaring an offset pointer in data segment, a word array w with hex values, and moving the first element to ax, producing 1000 hexadecimal.
Demonstrates an x86 assembly program that doubles each array element and computes the total sum, using Irvine32.inc and a .data segment with my array and my sum.
The call instruction transfers execution to a procedure by pushing a return address on stack and loading the target address into EIP, then ret pops the address and restores ESP.
demonstrate stack frame creation for x86 calls, push arguments and return address, save ebp, and illustrate passing by value and by reference via a recursive factorial up to 12.
Explore how the pop instruction copies from the stack (ESP) into a destination register or memory, increments ESP by four bytes in 32-bit mode, and supports 16-bit and 32-bit formats.
See how the CPU manages the runtime stack with the ESP register, and how push operations decrement ESP by four and store values in little endian.
Show how the lea instruction loads the address from memory into a register, enabling runtime address calculation and setting esi to the array's first element.
The B-Example program in assembly language for x86 demonstrates reading a lowercase string, excluding non-alphabetic characters, reversing it, and converting to uppercase. It then displays the reversed uppercase string.
Implement an x86 assembly program that reads a string up to 128 characters, reverses it, toggles letter cases, displays the transformed string, and shows the lowercase count.
Apply the and instruction to perform a boolean operation on two operands, masking bits to clear one byte while preserving the other, transforming the ASCII character m to capital M.
Apply the not instruction to invert all bits of a destination operand, yielding the ones complement, and demonstrate with the AL register converting 11111110 to 00000001.
Explain how the or instruction performs a boolean or between bits and how to set selected bits while preserving others, using AL with 00110000 to yield 00110101.
Learn the x86 test instruction that non-destructively tests matching bits between operands and updates the zero flag, using a bit mask to test bits 0 and 1 with AL.
Learn how the xor instruction performs a boolean exclusive or on two operands to invert bits, keep bytes unchanged, and test parity by xoring with zero using the parity flag.
Explore unconditional jmp behavior, distinguishing global versus local labels, and note jmp l2 in main procedure triggers an error, while jmp l1 in sub procedure is valid; loop uses ecx.
Demonstrate unsigned 32-bit conditionals in x86 assembly by comparing ebx, ecx, edx, and var1 to assign var2 as 1 or 2 using ja and jna.
Explore jump instructions in x86 assembly—je, jne, jcxz, and jecxz—driven by cmp results and register values (cx, ecx, eax), with msg1 'success' and msg2 'failed' displayed on screen.
Demonstrate signed comparisons and conditional jumps in x86 assembly, using jg, jge, jl, jle, jnl, and jnge to steer program flow, yielding success or failed outcomes based on operands.
Learn unsigned comparison jumps in x86 assembly, using ja, jae, jnb, jb, jna, jnae, and related instructions, and see how eax values determine success or failed messages.
Explore jumps based on x86 flags for beginners, including zero, carry, overflow, sign, and parity, using jz, jnz, jc, jnc, jo, jno, js, jns, jp, and jnp.
Explain loopz loopnz loope and loopne x86 instructions, showing how they decrement ecx and conditionally jump to a destination based on the zero flag and ecx being greater than zero.
Show how a while loop in x86 assembly compares eax with ebx, uses jae to exit, increments eax when eax is less than ebx, and jumps back to the top.
Learn to write an asm program that reads 30 signed 32-bit integers from keyboard, sums positive values at even positions, counts negative values at odd positions, and displays the results.
Write an x86 assembly program to find the largest integer in an array using esi, ecx, eax, and ebx, then display the maximum; after deleting positives, the max is -1.
Translate a Java while loop to x86 assembly by mapping x and y to ax and bx, using jae and jnze jumps to control the loop.
Learn to generate and display random numbers in x86 assembly using the irvine32 library, with looping, range control (0–999 to 0–99), and formatted output.
Copy a string from source to destination in x86 assembly by looping 19 times with ecx, moving bytes from al to target, then displaying the result.
Read an integer N and display the first N Fibonacci numbers using F(0)=0, F(1)=1, and F(N)=F(N-2)+F(N-1) in x86 assembly with a dot data segment and an L1 loop.
This course focuses on programming microprocessors that compatible with Intel and AMD processors with 32 bit and 64 bit of Microsoft Windows.
In this course we will use MASM (Microsoft Macro Assembler) which is included in Microsoft Visual Studio using Irvine.
In this course, you will learn basic principles about assembly language, also you will learn the architecture of Intel processor, this course will make you better in Assembly programming and debugging, hardware manipulation and data representation.
For this course, you should have programmed in at least one high-level language such as Python, Java, C.
This course will cover the following topics:
1-Numbering systems and data representation (Decimal, Binary and Hexadecimal, Binary and Hexadecimal addition and subtraction).
2- Assembly Language Fundamentals and defining data (types of registers, defining string, Mnemonics, Operands, Directives, Instructions and labels).
3-Data transfer instructions (MOV, MOVZX, MOVSX and XCHG)
4-Data related operators and directives (ALIGN, LENGTHOF, OFFSET, PTR, SIZEOF and TYPE).
5-Inderict addressing ( Indexed operands and Pointers).
6-Addition and subtraction (Flags affected by addition and subtraction, INC and DEC instructions).
7-Procedures and stack operations (CALL and RET instructions, Stack parameters, POP and PUSH and LEA instructions).
8-Boolean and comparisons instructions (AND, NOT, OR, TEST and XOR instructions)
9-Conditional jumps and loop instructions (Conditional structure, Unconditional JMP and LOOP instructions, Jump based on equality JE JNE JCXZ JECXZ, Jump based on signed comparisons, Jump based on unsigned comparisons, Jumps based on specific flag values, LOOPZ LOOPNZ LOOPE and LOOPNE instructions, While loops).
10-Shift and rotate instructions (RCL, RCR, ROL, ROR, SHL, SHR, SHLD and SHRD).
11-Multiplications and division instructions (MUL, IMUL, DIV and IDIV).