<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bsccs.stoney-wiki.com/w/index.php?action=history&amp;feed=atom&amp;title=Labels_and_Entry_Point_%28_start%29</id>
	<title>Labels and Entry Point ( start) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bsccs.stoney-wiki.com/w/index.php?action=history&amp;feed=atom&amp;title=Labels_and_Entry_Point_%28_start%29"/>
	<link rel="alternate" type="text/html" href="https://bsccs.stoney-wiki.com/w/index.php?title=Labels_and_Entry_Point_(_start)&amp;action=history"/>
	<updated>2026-05-04T20:16:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://bsccs.stoney-wiki.com/w/index.php?title=Labels_and_Entry_Point_(_start)&amp;diff=101&amp;oldid=prev</id>
		<title>Bfh-sts: Created page with &quot;= Labels and Entry Point (_start) = This page explains how labels work in assembly programming and how the program’s entry point is defined.  == What are labels == A label is a symbolic name for a memory address.   It marks a location in code or data that can be referenced later.  Syntax:  LabelName:  Example:  SECTION .data  EatMsg: db &quot;Eat at Joe’s&quot;   SECTION .text  mov rcx, EatMsg   ; rcx ← address of the string  mov rdx, [EatMsg] ; rdx ← first 8 bytes of the...&quot;</title>
		<link rel="alternate" type="text/html" href="https://bsccs.stoney-wiki.com/w/index.php?title=Labels_and_Entry_Point_(_start)&amp;diff=101&amp;oldid=prev"/>
		<updated>2025-10-20T13:46:52Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Labels and Entry Point (_start) = This page explains how labels work in assembly programming and how the program’s entry point is defined.  == What are labels == A label is a symbolic name for a memory address.   It marks a location in code or data that can be referenced later.  Syntax:  LabelName:  Example:  SECTION .data  EatMsg: db &amp;quot;Eat at Joe’s&amp;quot;   SECTION .text  mov rcx, EatMsg   ; rcx ← address of the string  mov rdx, [EatMsg] ; rdx ← first 8 bytes of the...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Labels and Entry Point (_start) =&lt;br /&gt;
This page explains how labels work in assembly programming and how the program’s entry point is defined.&lt;br /&gt;
&lt;br /&gt;
== What are labels ==&lt;br /&gt;
A label is a symbolic name for a memory address.  &lt;br /&gt;
It marks a location in code or data that can be referenced later.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 LabelName:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 SECTION .data&lt;br /&gt;
 EatMsg: db &amp;quot;Eat at Joe’s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 SECTION .text&lt;br /&gt;
 mov rcx, EatMsg   ; rcx ← address of the string&lt;br /&gt;
 mov rdx, [EatMsg] ; rdx ← first 8 bytes of the string&lt;br /&gt;
&lt;br /&gt;
Here:&lt;br /&gt;
* EatMsg refers to the address of the string.&lt;br /&gt;
* [EatMsg] refers to the contents at that address.&lt;br /&gt;
&lt;br /&gt;
== Why labels are needed ==&lt;br /&gt;
Labels replace hardcoded addresses and make programs relocatable:&lt;br /&gt;
* You don’t know where in memory your program will be loaded.&lt;br /&gt;
* The linker can adjust label references automatically.&lt;br /&gt;
* The code becomes modular and position-independent.&lt;br /&gt;
&lt;br /&gt;
== Code labels ==&lt;br /&gt;
Labels can also be attached to code lines.  &lt;br /&gt;
They mark destinations for jumps and branches, forming the basis for control flow.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 mov eax, 5&lt;br /&gt;
loop_start:&lt;br /&gt;
 dec eax&lt;br /&gt;
 jnz loop_start   ; jump back if eax ≠ 0&lt;br /&gt;
&lt;br /&gt;
Here, loop_start marks the instruction to jump to.  &lt;br /&gt;
Such code labels are essential for loops, branches, and function calls.&lt;br /&gt;
&lt;br /&gt;
== The _start label ==&lt;br /&gt;
_start: defines the entry point of an assembly program on Linux.  &lt;br /&gt;
It is the first instruction executed when the program runs.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 global _start&lt;br /&gt;
_start:&lt;br /&gt;
 mov rax, 60      ; system call for exit&lt;br /&gt;
 xor rdi, rdi     ; return code 0&lt;br /&gt;
 syscall&lt;br /&gt;
&lt;br /&gt;
* The keyword global makes _start visible to the linker.&lt;br /&gt;
* The operating system looks for this symbol to know where to begin execution.&lt;br /&gt;
&lt;br /&gt;
Every NASM program for Linux must define exactly one entry point, usually called _start.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
* Labels are symbolic names for addresses.&lt;br /&gt;
* Data labels point to memory locations.&lt;br /&gt;
* Code labels mark positions for jumps.&lt;br /&gt;
* The _start label defines where execution begins.&lt;br /&gt;
&lt;br /&gt;
[[Category:Assembly Programming]]&lt;/div&gt;</summary>
		<author><name>Bfh-sts</name></author>
	</entry>
</feed>