{"id":21876955,"url":"https://github.com/irfanshadikrishad/emu8086","last_synced_at":"2025-09-08T07:38:09.763Z","repository":{"id":264969835,"uuid":"894688285","full_name":"irfanshadikrishad/emu8086","owner":"irfanshadikrishad","description":"Assembly 🐙","archived":false,"fork":false,"pushed_at":"2024-12-13T00:43:35.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T23:43:16.590Z","etag":null,"topics":["assembly","assembly-language","emu8086"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irfanshadikrishad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-26T20:02:01.000Z","updated_at":"2024-12-13T00:43:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee53b4cf-819c-4a93-a486-f173ed4b9552","html_url":"https://github.com/irfanshadikrishad/emu8086","commit_stats":null,"previous_names":["irfanshadikrishad/emu8086"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/irfanshadikrishad/emu8086","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfanshadikrishad%2Femu8086","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfanshadikrishad%2Femu8086/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfanshadikrishad%2Femu8086/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfanshadikrishad%2Femu8086/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irfanshadikrishad","download_url":"https://codeload.github.com/irfanshadikrishad/emu8086/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfanshadikrishad%2Femu8086/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274152651,"owners_count":25231291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembly","assembly-language","emu8086"],"created_at":"2024-11-28T08:07:25.020Z","updated_at":"2025-09-08T07:38:09.738Z","avatar_url":"https://github.com/irfanshadikrishad.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"### **Directives and Their Purpose**\n\n1. **`.model`**\n\n   - Defines the **memory model** for the program.\n   - Memory models determine how the code and data are organized in memory, affecting how large the code and data can be and how they are accessed.\n   - Common options for `.model`:\n     - **`small`**: Code and data fit within one 64KB segment each.\n     - **`medium`**: Code can span multiple segments, but data is within one segment.\n     - **`compact`**: Data can span multiple segments, but code is within one segment.\n     - **`large`**: Both code and data can span multiple segments.\n     - **`huge`**: Like `large`, but arrays can exceed 64KB.\n\n   **Example**:\n\n   ```asm\n   .model small   ; Code and data are in one segment each\n   ```\n\n2. **`.data`**\n\n   - Used to define the **data segment**, where variables and constants are stored.\n   - Any initialized or uninitialized data should be declared here.\n\n   **Example**:\n\n   ```asm\n   .data\n   var1 db 10    ; Declare a byte variable with value 10\n   msg db 'Hello, World!', 0Dh, 0Ah, '$'  ; String terminated with $\n   ```\n\n3. **`.code`**\n\n   - Used to define the **code segment**, where the executable instructions of the program are placed.\n   - All instructions for the program should go inside this segment.\n\n   **Example**:\n\n   ```asm\n   .code\n   main proc      ; Start of the main procedure\n       mov ax, 4C00h ; Exit program\n       int 21h\n   main endp\n   ```\n\n### Common General-Purpose Registers (16-bit and their 8-bit counterparts):\n\n- **AX: The Accumulator register.**\n  - AH: High 8 bits of AX.\n  - AL: Low 8 bits of AX.\n- **BX: The Base register.**\n  - BH: High 8 bits of BX.\n  - BL: Low 8 bits of BX.\n- **CX: The Count register, often used for loops.**\n  - CH: High 8 bits of CX.\n  - CL: Low 8 bits of CX.\n- **DX: The Data register, used in I/O operations and certain calculations.**\n  - DH: High 8 bits of DX.\n  - DL: Low 8 bits of DX.\n\n### **Common Data Types in Assembly:**\n\n1. **`db` (Define Byte)**:\n\n   - **Purpose**: Used to define one or more bytes of data.\n   - **Syntax**: `db \u003cvalue(s)\u003e`\n   - **Usage**: Used to define data that fits within a byte (8 bits). Values can be numbers or ASCII characters.\n\n   **Example**:\n\n   ```asm\n   myByte db 5     ; Defines a byte with the value 5\n   myChar db 'A'   ; Defines a byte with the ASCII value of 'A'\n   myString db 'Hello, World!', 0  ; Defines a string terminated by a null byte (0)\n   ```\n\n2. **`dw` (Define Word)**:\n\n   - **Purpose**: Used to define **word**-sized data (2 bytes, or 16 bits).\n   - **Syntax**: `dw \u003cvalue(s)\u003e`\n   - **Usage**: Defines values that require 2 bytes of memory. Typically used for 16-bit values (e.g., integer or pointer).\n\n   **Example**:\n\n   ```asm\n   myWord dw 12345    ; Defines a word with the value 12345\n   ```\n\n3. **`dd` (Define Doubleword)**:\n\n   - **Purpose**: Used to define **doubleword**-sized data (4 bytes, or 32 bits).\n   - **Syntax**: `dd \u003cvalue(s)\u003e`\n   - **Usage**: Used for 32-bit values, such as larger integers or addresses.\n\n   **Example**:\n\n   ```asm\n   myDoubleWord dd 1234567890    ; Defines a doubleword with a large integer\n   ```\n\n4. **`dq` (Define Quadword)**:\n\n   - **Purpose**: Used to define **quadword**-sized data (8 bytes, or 64 bits).\n   - **Syntax**: `dq \u003cvalue(s)\u003e`\n   - **Usage**: Defines values that require 8 bytes of memory. This is typically used for 64-bit integers or large structures.\n\n   **Example**:\n\n   ```asm\n   myQuadWord dq 1234567890123456789    ; Defines a quadword with a large integer\n   ```\n\n5. **`dt` (Define Ten-byte)**:\n\n   - **Purpose**: Used to define data of **ten bytes**.\n   - **Syntax**: `dt \u003cvalue(s)\u003e`\n   - **Usage**: Mostly used for floating point or complex types, but it is not as common as the other data types.\n\n   **Example**:\n\n   ```asm\n   myTenByte dt 0.0   ; Defines a ten-byte floating-point value\n   ```\n\n### **Summary of Common Directives:**\n\n| Directive | Purpose                          | Size     |\n| --------- | -------------------------------- | -------- |\n| `db`      | Define byte                      | 1 byte   |\n| `dw`      | Define word                      | 2 bytes  |\n| `dd`      | Define doubleword                | 4 bytes  |\n| `dq`      | Define quadword                  | 8 bytes  |\n| `dt`      | Define ten-byte (floating point) | 10 bytes |\n\n### **Examples of Using Data Types:**\n\n- **`db`** for storing characters:\n\n  ```asm\n  msg db 'Hello, world!', 0  ; null-terminated string\n  ```\n\n- **`dw`** for storing 16-bit integers:\n\n  ```asm\n  num1 dw 1234   ; 16-bit integer\n  ```\n\n- **`dd`** for storing 32-bit integers or addresses:\n\n  ```asm\n  bigNum dd 100000  ; 32-bit integer\n  ```\n\n- **`dq`** for storing 64-bit integers:\n  ```asm\n  longNum dq 10000000000  ; 64-bit integer\n  ```\n\nThese data types are used to allocate space in memory and initialize it with specific values, providing the program with variables that are later accessed and manipulated by instructions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firfanshadikrishad%2Femu8086","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firfanshadikrishad%2Femu8086","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firfanshadikrishad%2Femu8086/lists"}