{"id":31649259,"url":"https://github.com/farhanxtanvir/sap1","last_synced_at":"2026-05-15T01:37:58.887Z","repository":{"id":318377467,"uuid":"1070951789","full_name":"FarhanXTanvir/SAP1","owner":"FarhanXTanvir","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-06T20:08:35.000Z","size":267,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T21:25:48.415Z","etag":null,"topics":["assembler","assembly-language","sap1"],"latest_commit_sha":null,"homepage":"https://farhanxtanvir.github.io/SAP1/","language":"TypeScript","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/FarhanXTanvir.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T16:55:07.000Z","updated_at":"2025-10-06T20:14:21.000Z","dependencies_parsed_at":"2025-10-06T21:26:02.464Z","dependency_job_id":"f023b755-9adb-4fd2-a9c6-e35a203e1dec","html_url":"https://github.com/FarhanXTanvir/SAP1","commit_stats":null,"previous_names":["farhanxtanvir/sap1"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/FarhanXTanvir/SAP1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanXTanvir%2FSAP1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanXTanvir%2FSAP1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanXTanvir%2FSAP1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanXTanvir%2FSAP1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FarhanXTanvir","download_url":"https://codeload.github.com/FarhanXTanvir/SAP1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanXTanvir%2FSAP1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278740831,"owners_count":26037480,"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-10-07T02:00:06.786Z","response_time":59,"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":["assembler","assembly-language","sap1"],"created_at":"2025-10-07T07:41:48.959Z","updated_at":"2025-10-07T07:41:50.756Z","avatar_url":"https://github.com/FarhanXTanvir.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔧 Assembly Code Editor \u0026 Assembler\n\nA modern, web-based assembly language editor and assembler built with React, TypeScript, and Vite. This project provides an interactive environment for writing, assembling, and learning assembly language programming with a custom instruction set.\n\n## ✨ Features\n\n- **🖥️ Interactive Code Editor**: Write assembly code with syntax highlighting\n- **⚡ Real-time Assembly**: Convert assembly instructions to binary and hexadecimal\n- **💾 Program Management**: Save, load, and manage your assembly programs locally\n- **📊 Visual Output**: View assembled code in multiple formats (binary, hex, instruction table)\n- **📚 Learning Resources**: Comprehensive documentation and tutorials\n- **🎨 Modern UI**: Clean, responsive interface built with Tailwind CSS\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js (v18 or higher)\n- pnpm (recommended) or npm\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/FarhanXTanvir/SAP1\n   cd sap1\n   ```\n\n2. **Install dependencies**\n\n   If you don't have `pnpm` installed in your device then install it:\n\n   ```bash\n     npm install -g pnpm\n   ```\n\n   Finally:\n\n   ```bash\n   pnpm install\n   ```\n\n3. **Start the development server**\n\n   ```bash\n   pnpm dev\n   ```\n\n4. **Open your browser**\n   Navigate to `http://localhost:5173` to start using the assembler.\n\n### Building for Production\n\n```bash\npnpm build\n```\n\n## 📖 Usage\n\n### Writing Assembly Code\n\n1. **Navigate to the Home page** to access the code editor\n2. **Write your assembly code** using the supported instruction set\n3. **Click \"Assemble\"** to convert your code to machine language\n4. **View the output** in binary, hexadecimal, and tabular formats\n5. **Save your programs** for later use with custom titles\n\n### Example Program\n\n```assembly\nLDA 5        ; Load immediate value 5 into accumulator A\nLDB 3        ; Load immediate value 3 into accumulator B\nADD          ; Add B to A\nSTA 10       ; Store result at memory address 10\nHLT          ; Halt program execution\n```\n\n### Memory Instructions\n\nYou can also initialize memory locations using the `mem[]` syntax:\n\n```assembly\nmem[0] = 0x0A    ; Set memory address 0 to hexadecimal 0A\nmem[1] = 0b1010  ; Set memory address 1 to binary 1010\nmem[2] = 15      ; Set memory address 2 to decimal 15\n```\n\n## 🔧 Instruction Set Reference\n\nThe assembler supports a comprehensive instruction set with both 4-bit and 5-bit opcodes:\n\n### Data Movement Instructions\n\n| Opcode | Binary | Description                             | Example  |\n| ------ | ------ | --------------------------------------- | -------- |\n| LDA    | 0000   | Load immediate value into accumulator A | `LDA 5`  |\n| LDB    | 0001   | Load immediate value into accumulator B | `LDB 3`  |\n| STA    | 0010   | Store accumulator A to memory address   | `STA 10` |\n\n### Control Flow Instructions\n\n| Opcode | Binary | Description                   | Example |\n| ------ | ------ | ----------------------------- | ------- |\n| JMP    | 0011   | Unconditional jump to address | `JMP 8` |\n| JZ     | 0100   | Jump if zero flag is set      | `JZ 5`  |\n| JNZ    | 0101   | Jump if zero flag is not set  | `JNZ 7` |\n\n### Shift and Rotate Instructions\n\n| Opcode | Binary | Description                           | Example |\n| ------ | ------ | ------------------------------------- | ------- |\n| SHL    | 0110   | Shift left by specified amount (0-7)  | `SHL 2` |\n| SHR    | 0111   | Shift right by specified amount (0-7) | `SHR 1` |\n| ROL    | 1000   | Rotate left by specified amount       | `ROL 3` |\n| ROR    | 1001   | Rotate right by specified amount      | `ROR 2` |\n\n### Arithmetic Instructions (5-bit opcodes)\n\n| Opcode | Binary | Description                   | Example |\n| ------ | ------ | ----------------------------- | ------- |\n| ADD    | 01010  | Add accumulator B to A        | `ADD`   |\n| SUB    | 01011  | Subtract accumulator B from A | `SUB`   |\n| INC    | 01100  | Increment accumulator A       | `INC`   |\n| DEC    | 01101  | Decrement accumulator A       | `DEC`   |\n| REV    | 01110  | Reverse bits in accumulator A | `REV`   |\n\n### Control Instructions (5-bit opcodes)\n\n| Opcode | Binary | Description                  | Example |\n| ------ | ------ | ---------------------------- | ------- |\n| HLT    | 01111  | Halt program execution       | `HLT`   |\n| NOP    | 11010  | No operation                 | `NOP`   |\n| CMP    | 11011  | Compare accumulators A and B | `CMP`   |\n\n### Bitwise Operations (5-bit opcodes)\n\n| Opcode | Binary | Description                  | Example  |\n| ------ | ------ | ---------------------------- | -------- |\n| BW_OR  | 11100  | Bitwise OR of A and B        | `BW_OR`  |\n| BW_AND | 11101  | Bitwise AND of A and B       | `BW_AND` |\n| BW_NOT | 11110  | Bitwise NOT of accumulator A | `BW_NOT` |\n| BW_XOR | 11111  | Bitwise XOR of A and B       | `BW_XOR` |\n\n### Operand Formats\n\nThe assembler supports multiple operand formats:\n\n- **Decimal**: `LDA 15` (loads decimal 15)\n- **Hexadecimal**: `LDA 0xF` (loads hexadecimal F = decimal 15)\n- **Binary**: `LDA 0b1111` (loads binary 1111 = decimal 15)\n\n### Constraints\n\n- **Operand Range**: 0-15 (4-bit values)\n- **Shift Amounts**: 0-7 for SHL/SHR operations\n- **Memory Addresses**: 0-255 (8-bit addressing)\n\n## 🏗️ Project Structure\n\n```\nsrc/\n├── App.tsx              # Main application component\n├── main.tsx             # Application entry point\n├── CodeEditor.tsx       # Assembly code editor component\n├── Header.tsx           # Navigation header\n├── pages/\n│   ├── Home.tsx         # Main editor page\n│   └── Learn.tsx        # Documentation and tutorials\n├── scripts/\n│   └── assembler.ts     # Core assembler logic\n└── assets/              # Static assets\n```\n\n## 🛠️ Technology Stack\n\n- **Frontend Framework**: React 19\n- **Language**: TypeScript\n- **Build Tool**: Vite\n- **Styling**: Tailwind CSS\n- **Routing**: React Router v7\n- **Code Quality**: ESLint with TypeScript support\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Commit your changes (`git commit -m 'Add some amazing feature'`)\n5. Push to the branch (`git push origin feature/amazing-feature`)\n6. Open a Pull Request\n\n## 📝 Development\n\n### Code Style\n\nThe project uses ESLint with TypeScript and React-specific rules. Run the linter with:\n\n```bash\npnpm lint\n```\n\n### Building and Testing\n\n```bash\n# Development build\npnpm dev\n\n# Production build\npnpm build\n\n# Preview production build\npnpm preview\n```\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Built with modern web technologies for an optimal developer experience\n- Inspired by classic assembly language programming and computer architecture concepts\n- Designed for educational purposes and learning assembly language fundamentals\n\n---\n\n**Happy Coding! 🎉**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhanxtanvir%2Fsap1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarhanxtanvir%2Fsap1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhanxtanvir%2Fsap1/lists"}