@nockdev/awf 6.2.6 → 6.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/config.yaml +2 -2
- package/.agent/core/AGENT_BEHAVIOR.md +1 -1
- package/.agent/core/AUDIT_POLICY.md +1 -1
- package/.agent/core/CACHE.md +1 -1
- package/.agent/core/DATA_SAFETY.md +1 -1
- package/.agent/core/MEMORY_PATHS.yaml +2 -2
- package/.agent/core/PERMISSIONS.md +1 -1
- package/.agent/core/README.md +1 -1
- package/.agent/core/VERSION.yaml +4 -4
- package/.agent/core/archive/ACTIVE_MEMORY.yaml +2 -2
- package/.agent/core/archive/CHECKPOINT.yaml +2 -2
- package/.agent/core/archive/CLEANUP_ENGINE.yaml +2 -2
- package/.agent/core/archive/CONTEXT_INJECTOR.yaml +2 -2
- package/.agent/core/archive/CONTEXT_LOADER.yaml +1 -1
- package/.agent/core/archive/CONTEXT_OPTIMIZATION.yaml +1 -1
- package/.agent/core/archive/CONTEXT_PRIORITY.yaml +2 -2
- package/.agent/core/archive/FLOW_ENGINE.yaml +1 -1
- package/.agent/core/archive/GRAPH_MEMORY.yaml +1 -1
- package/.agent/core/archive/HYBRID_ROUTER.yaml +1 -1
- package/.agent/core/archive/INTENT_DETECTION.yaml +1 -1
- package/.agent/core/archive/MEMORY_CONSOLIDATION.yaml +3 -3
- package/.agent/core/archive/MEMORY_ENGINE.yaml +2 -2
- package/.agent/core/archive/MEMORY_UTILS.yaml +1 -1
- package/.agent/core/archive/REFLECTION_ENGINE.yaml +1 -1
- package/.agent/core/archive/ROUTER.yaml +4 -4
- package/.agent/core/archive/SCORING_FORMULA.yaml +2 -2
- package/.agent/core/archive/SEMANTIC_ENGINE.yaml +1 -1
- package/.agent/core/archive/SKILLS_FLOW.yaml +1 -1
- package/.agent/core/archive/STATE_MACHINE.yaml +1 -1
- package/.agent/core/archive/SUMMARIZATION_ENGINE.yaml +2 -2
- package/.agent/core/archive/TOKEN_BUDGETS.yaml +2 -2
- package/.agent/core/archive/TOKEN_LOADING.yaml +2 -2
- package/.agent/core/archive/TOKEN_SUMMARY.yaml +2 -2
- package/.agent/core/reference/CODING_STYLES.yaml +1 -1
- package/.agent/core/reference/LIBRARY_REGISTRY.yaml +1 -1
- package/.agent/core/reference/MCP_TOOLS.yaml +2 -2
- package/.agent/core/reference/PATTERNS.yaml +1 -1
- package/.agent/core/reference/SKILL_SCHEMA.yaml +1 -1
- package/.agent/i18n/en.yaml +6 -6
- package/.agent/i18n/vi.yaml +6 -6
- package/.agent/ide/README.md +1 -1
- package/.agent/ide/amazonq.json +1 -1
- package/.agent/ide/amp.json +1 -1
- package/.agent/ide/antigravity.json +1 -1
- package/.agent/ide/augment.json +1 -1
- package/.agent/ide/claude.json +1 -1
- package/.agent/ide/cline.json +1 -1
- package/.agent/ide/cody.json +1 -1
- package/.agent/ide/continue.json +1 -1
- package/.agent/ide/cursor.json +1 -1
- package/.agent/ide/gemini.json +1 -1
- package/.agent/ide/jetbrains.json +1 -1
- package/.agent/ide/kiro.json +1 -1
- package/.agent/ide/opencode.json +1 -1
- package/.agent/ide/roo.json +1 -1
- package/.agent/ide/tabnine.json +1 -1
- package/.agent/ide/trae.json +1 -1
- package/.agent/ide/vscode.json +1 -1
- package/.agent/ide/windsurf.json +1 -1
- package/.agent/ide/zed.json +1 -1
- package/.agent/manifest.yaml +1 -1
- package/.agent/personas/README.md +1 -1
- package/.agent/personas/architect.md +1 -1
- package/.agent/personas/auditor.md +1 -1
- package/.agent/personas/debugger.md +1 -1
- package/.agent/personas/developer.md +1 -1
- package/.agent/personas/devops.md +1 -1
- package/.agent/personas/documenter.md +1 -1
- package/.agent/personas/orchestrator.md +1 -1
- package/.agent/personas/persona.schema.yaml +1 -1
- package/.agent/personas/planner.md +1 -1
- package/.agent/personas/researcher.md +1 -1
- package/.agent/personas/security.md +1 -1
- package/.agent/personas/tester.md +1 -1
- package/.agent/rules/README.md +1 -1
- package/.agent/rules/archive/constitutional/tier-0-core.yaml +5 -5
- package/.agent/rules/archive/constitutional/tier-1-safety.yaml +5 -5
- package/.agent/rules/archive/constitutional/tier-2-execution.yaml +6 -6
- package/.agent/rules/archive/context-management.yaml +1 -1
- package/.agent/rules/archive/duplication-prevention.md +1 -1
- package/.agent/rules/archive/evidence.yaml +1 -1
- package/.agent/rules/archive/project-detection.md +1 -1
- package/.agent/rules/archive/reflection.yaml +1 -1
- package/.agent/rules/archive/versioning.yaml +5 -5
- package/.agent/rules/data/build-systems.yaml +2 -2
- package/.agent/rules/modules/agent-delegation.yaml +2 -2
- package/.agent/rules/modules/edit-verification.yaml +1 -1
- package/.agent/rules/modules/git-workflow.yaml +1 -1
- package/.agent/rules/modules/language.yaml +1 -1
- package/.agent/rules/modules/online-research.yaml +1 -1
- package/.agent/rules/modules/performance-optimization.yaml +2 -2
- package/.agent/rules/modules/quality.yaml +1 -1
- package/.agent/rules/modules/stop-conditions.yaml +1 -1
- package/.agent/rules/modules/terminal-safety.yaml +1 -1
- package/.agent/rules/modules/yagni.yaml +1 -1
- package/.agent/rules/validation-framework.md +1 -1
- package/.agent/skills/README.md +1 -1
- package/.agent/skills/_categories.yaml +2 -2
- package/.agent/skills/ai-ml/rag-patterns/META.yaml +2 -0
- package/.agent/skills/core/api-design/META.yaml +1 -1
- package/.agent/skills/core/authentication/META.yaml +1 -1
- package/.agent/skills/core/error-handling/META.yaml +1 -1
- package/.agent/skills/core/logging/META.yaml +1 -1
- package/.agent/skills/core/observability/META.yaml +1 -1
- package/.agent/skills/core/security/META.yaml +1 -1
- package/.agent/skills/core/security/SKILL.md +1 -1
- package/.agent/skills/cross-cutting/accessibility/META.yaml +1 -1
- package/.agent/skills/cross-cutting/audit-pro/META.yaml +9 -1
- package/.agent/skills/cross-cutting/audit-pro/SKILL.md +61 -5
- package/.agent/skills/cross-cutting/bun/META.yaml +17 -8
- package/.agent/skills/cross-cutting/bun/SKILL.md +1 -1
- package/.agent/skills/cross-cutting/coding-rules/META.yaml +1 -1
- package/.agent/skills/cross-cutting/database/META.yaml +42 -1
- package/.agent/skills/cross-cutting/database/SKILL.md +44 -628
- package/.agent/skills/cross-cutting/database/references/nosql-patterns.md +194 -0
- package/.agent/skills/cross-cutting/database/references/orms-patterns.md +278 -0
- package/.agent/skills/cross-cutting/database/references/postgresql.md +144 -0
- package/.agent/skills/cross-cutting/deno/META.yaml +19 -10
- package/.agent/skills/cross-cutting/deno/SKILL.md +1 -1
- package/.agent/skills/cross-cutting/domyh-design/META.yaml +1 -1
- package/.agent/skills/cross-cutting/domyh-design/data/desktop-colors.yaml +1 -1
- package/.agent/skills/cross-cutting/electron/SKILL.md +15 -616
- package/.agent/skills/cross-cutting/electron/references/ipc-testing.md +114 -0
- package/.agent/skills/cross-cutting/electron/references/native-integrations.md +216 -0
- package/.agent/skills/cross-cutting/electron/references/performance-accessibility.md +118 -0
- package/.agent/skills/cross-cutting/electron/references/updates-persistence.md +165 -0
- package/.agent/skills/cross-cutting/seo/META.yaml +1 -1
- package/.agent/skills/cross-cutting/skill-creator/META.yaml +37 -0
- package/.agent/skills/cross-cutting/skill-creator/SKILL.md +163 -0
- package/.agent/skills/cross-cutting/skill-creator/references/patterns.md +58 -0
- package/.agent/skills/cross-cutting/skill-creator/references/schema-v2.md +44 -0
- package/.agent/skills/cross-cutting/sql/META.yaml +1 -1
- package/.agent/skills/cross-cutting/sql/SKILL.md +1 -1
- package/.agent/skills/cross-cutting/tailwind/META.yaml +1 -1
- package/.agent/skills/cross-cutting/tailwind/SKILL.md +1 -1
- package/.agent/skills/cross-cutting/tdd-workflow/META.yaml +1 -1
- package/.agent/skills/cross-cutting/testing/META.yaml +7 -1
- package/.agent/skills/cross-cutting/testing/SKILL.md +1 -1
- package/.agent/skills/cross-cutting/testing/data/frameworks.yaml +1 -1
- package/.agent/skills/cross-cutting/web-perf/META.yaml +1 -1
- package/.agent/skills/cross-cutting/web-perf/SKILL.md +1 -1
- package/.agent/skills/devops/aws/META.yaml +1 -1
- package/.agent/skills/devops/aws/SKILL.md +101 -16
- package/.agent/skills/devops/azure/SKILL.md +96 -30
- package/.agent/skills/devops/ci-cd/META.yaml +1 -1
- package/.agent/skills/devops/ci-cd/SKILL.md +114 -8
- package/.agent/skills/devops/docker/META.yaml +1 -1
- package/.agent/skills/devops/docker/SKILL.md +96 -8
- package/.agent/skills/devops/gcp/SKILL.md +106 -30
- package/.agent/skills/devops/kubernetes/META.yaml +1 -1
- package/.agent/skills/devops/kubernetes/SKILL.md +125 -8
- package/.agent/skills/frameworks/angular/META.yaml +1 -1
- package/.agent/skills/frameworks/angular/SKILL.md +1 -1
- package/.agent/skills/frameworks/flutter/META.yaml +1 -1
- package/.agent/skills/frameworks/flutter/SKILL.md +1 -1
- package/.agent/skills/frameworks/nextjs/META.yaml +1 -1
- package/.agent/skills/frameworks/nextjs/SKILL.md +1 -1
- package/.agent/skills/frameworks/nuxt/META.yaml +1 -1
- package/.agent/skills/frameworks/nuxt/SKILL.md +1 -1
- package/.agent/skills/frameworks/react/META.yaml +1 -1
- package/.agent/skills/frameworks/react/SKILL.md +24 -1
- package/.agent/skills/frameworks/react-native/META.yaml +1 -1
- package/.agent/skills/frameworks/react-native/SKILL.md +1 -1
- package/.agent/skills/frameworks/svelte/META.yaml +1 -1
- package/.agent/skills/frameworks/svelte/SKILL.md +1 -1
- package/.agent/skills/frameworks/vue/META.yaml +1 -1
- package/.agent/skills/frameworks/vue/SKILL.md +1 -1
- package/.agent/skills/index.json +2 -2
- package/.agent/skills/languages/asm/META.yaml +1 -1
- package/.agent/skills/languages/asm/SKILL.md +27 -436
- package/.agent/skills/languages/asm/references/advanced-architectures.md +191 -0
- package/.agent/skills/languages/asm/references/build-structure.md +150 -0
- package/.agent/skills/languages/asm/references/simd-programming.md +92 -0
- package/.agent/skills/languages/c/META.yaml +1 -1
- package/.agent/skills/languages/c/SKILL.md +14 -356
- package/.agent/skills/languages/c/references/data-structures.md +63 -0
- package/.agent/skills/languages/c/references/memory-management.md +74 -0
- package/.agent/skills/languages/c/references/platform-headers.md +230 -0
- package/.agent/skills/languages/clojure/META.yaml +1 -1
- package/.agent/skills/languages/clojure/SKILL.md +1 -1
- package/.agent/skills/languages/cpp/META.yaml +1 -1
- package/.agent/skills/languages/cpp/SKILL.md +22 -753
- package/.agent/skills/languages/cpp/references/headers-optimization.md +229 -0
- package/.agent/skills/languages/cpp/references/memory-concurrency.md +85 -0
- package/.agent/skills/languages/cpp/references/modern-cpp-features.md +126 -0
- package/.agent/skills/languages/cpp/references/platform-headers.md +202 -0
- package/.agent/skills/languages/cpp/references/stl-containers.md +57 -0
- package/.agent/skills/languages/crystal/META.yaml +1 -1
- package/.agent/skills/languages/crystal/SKILL.md +1 -1
- package/.agent/skills/languages/csharp/META.yaml +1 -1
- package/.agent/skills/languages/csharp/SKILL.md +1 -1
- package/.agent/skills/languages/elixir/META.yaml +1 -1
- package/.agent/skills/languages/elixir/SKILL.md +1 -1
- package/.agent/skills/languages/fsharp/META.yaml +1 -1
- package/.agent/skills/languages/fsharp/SKILL.md +1 -1
- package/.agent/skills/languages/go/META.yaml +1 -1
- package/.agent/skills/languages/go/SKILL.md +1 -1
- package/.agent/skills/languages/haskell/META.yaml +1 -1
- package/.agent/skills/languages/haskell/SKILL.md +1 -1
- package/.agent/skills/languages/java/META.yaml +1 -1
- package/.agent/skills/languages/java/SKILL.md +1 -1
- package/.agent/skills/languages/javascript/META.yaml +1 -1
- package/.agent/skills/languages/javascript/SKILL.md +1 -1
- package/.agent/skills/languages/julia/META.yaml +1 -1
- package/.agent/skills/languages/julia/SKILL.md +1 -1
- package/.agent/skills/languages/kotlin/META.yaml +1 -1
- package/.agent/skills/languages/kotlin/SKILL.md +1 -1
- package/.agent/skills/languages/lua/META.yaml +1 -1
- package/.agent/skills/languages/lua/SKILL.md +3 -3
- package/.agent/skills/languages/nim/META.yaml +1 -1
- package/.agent/skills/languages/nim/SKILL.md +1 -1
- package/.agent/skills/languages/ocaml/META.yaml +1 -1
- package/.agent/skills/languages/ocaml/SKILL.md +1 -1
- package/.agent/skills/languages/perl/META.yaml +1 -1
- package/.agent/skills/languages/perl/SKILL.md +1 -1
- package/.agent/skills/languages/php/META.yaml +1 -1
- package/.agent/skills/languages/php/SKILL.md +1 -1
- package/.agent/skills/languages/python/META.yaml +1 -1
- package/.agent/skills/languages/python/SKILL.md +1 -1
- package/.agent/skills/languages/r/META.yaml +1 -1
- package/.agent/skills/languages/r/SKILL.md +1 -1
- package/.agent/skills/languages/ruby/META.yaml +1 -1
- package/.agent/skills/languages/ruby/SKILL.md +1 -1
- package/.agent/skills/languages/rust/META.yaml +1 -1
- package/.agent/skills/languages/rust/SKILL.md +1 -1
- package/.agent/skills/languages/scala/META.yaml +1 -1
- package/.agent/skills/languages/scala/SKILL.md +1 -1
- package/.agent/skills/languages/solidity/META.yaml +1 -1
- package/.agent/skills/languages/solidity/SKILL.md +1 -1
- package/.agent/skills/languages/swift/META.yaml +1 -1
- package/.agent/skills/languages/swift/SKILL.md +1 -1
- package/.agent/skills/languages/typescript/META.yaml +19 -1
- package/.agent/skills/languages/typescript/SKILL.md +23 -1
- package/.agent/skills/languages/zig/META.yaml +1 -1
- package/.agent/skills/languages/zig/SKILL.md +1 -1
- package/.agent/templates/README.md +2 -2
- package/.agent/templates/chains/feature/step1-requirements.md +76 -0
- package/.agent/templates/chains/feature/step2-design.md +75 -0
- package/.agent/templates/chains/feature/step3-planning.md +81 -0
- package/.agent/templates/chains/feature/step4-implementation.md +74 -0
- package/.agent/templates/chains/feature/step5-testing.md +81 -0
- package/.agent/templates/debug-report.md +1 -1
- package/.agent/templates/deploy-plan.md +1 -1
- package/.agent/templates/doc-template.md +1 -1
- package/.agent/templates/feature-lifecycle.md +53 -0
- package/.agent/templates/index.yaml +53 -2
- package/.agent/templates/migrate-plan.md +1 -1
- package/.agent/templates/phase-template.md +1 -1
- package/.agent/templates/tasks/audit.yaml +1 -1
- package/.agent/templates/tasks/bug_fix.yaml +1 -1
- package/.agent/templates/tasks/code_implementation.yaml +1 -1
- package/.agent/templates/tasks/feature_development.yaml +89 -0
- package/.agent/templates/tasks/refactor.yaml +1 -1
- package/.agent/templates/test-report.md +1 -1
- package/.agent/workflows/doctor.md +124 -0
- package/.agent/workflows/feature.md +130 -0
- package/.agent/workflows/help.md +7 -5
- package/dist/commands/install.js +1 -1
- package/dist/commands/install.js.map +1 -1
- package/dist/constants/ide-install-specs.js +30 -30
- package/dist/constants/ide-install-specs.js.map +1 -1
- package/dist/constants/ides.d.ts.map +1 -1
- package/dist/constants/ides.js +7 -5
- package/dist/constants/ides.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/types/ide-install.d.ts +1 -1
- package/dist/types/ide-install.d.ts.map +1 -1
- package/package.json +2 -2
package/.agent/skills/index.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "6.2.
|
|
2
|
+
"version": "6.2.7",
|
|
3
3
|
"changelog": [
|
|
4
|
-
"v6.2.
|
|
4
|
+
"v6.2.7: Added 15 new skills across 2 new categories (tooling, ai-ml)",
|
|
5
5
|
"Migrated prompt-engineering + rag-patterns from cross-cutting → ai-ml",
|
|
6
6
|
"New: mcp, api-protocols, ide-extension, cli-dev, browser-agent (tooling)",
|
|
7
7
|
"New: ai-agents, vector-search, gemini-media-gen, gemini-tts, gemini-live (ai-ml)",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
---
|
|
1
|
+
---
|
|
2
2
|
name: asm
|
|
3
3
|
detect: ["*.asm", "*.s", "*.S", "__asm", "asm volatile"]
|
|
4
|
-
version: "6.2.
|
|
4
|
+
version: "6.2.7"
|
|
5
5
|
category: language
|
|
6
6
|
tier: 2
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# Assembly Language Patterns
|
|
9
|
+
# Assembly Language Patterns DOMYH Awesome Code
|
|
10
10
|
|
|
11
11
|
> Comprehensive guide for x86/x64, ARM64 assembly with C++ integration
|
|
12
12
|
|
|
@@ -47,12 +47,12 @@ code_patterns:
|
|
|
47
47
|
|
|
48
48
|
| Arch | Assembler | Syntax | Compiler | Inline Support |
|
|
49
49
|
| ---------------- | --------------- | ---------- | ---------------- | -------------- |
|
|
50
|
-
| **x86 (32-bit)** | NASM, MASM, GAS | Intel/AT&T | MSVC, GCC, Clang | ✅ Yes
|
|
51
|
-
| **x64 (64-bit)** | NASM, MASM, GAS | Intel/AT&T | GCC, Clang | ✅ Yes
|
|
50
|
+
| **x86 (32-bit)** | NASM, MASM, GAS | Intel/AT&T | MSVC, GCC, Clang | ✅ Yes |
|
|
51
|
+
| **x64 (64-bit)** | NASM, MASM, GAS | Intel/AT&T | GCC, Clang | ✅ Yes |
|
|
52
52
|
| **x64 (64-bit)** | MASM (ml64.exe) | Intel | MSVC | ❌ No inline\* |
|
|
53
|
-
| **ARM64** | GAS | UAL | GCC, Clang | ✅ Yes
|
|
54
|
-
| **ARM32** | GAS | UAL | GCC, Clang | ✅ Yes
|
|
55
|
-
| **RISC-V** | GAS | Standard | GCC | ✅ Yes
|
|
53
|
+
| **ARM64** | GAS | UAL | GCC, Clang | ✅ Yes |
|
|
54
|
+
| **ARM32** | GAS | UAL | GCC, Clang | ✅ Yes |
|
|
55
|
+
| **RISC-V** | GAS | Standard | GCC | ✅ Yes |
|
|
56
56
|
|
|
57
57
|
> \*MSVC x64 does NOT support inline assembly. Use external .asm files or intrinsics.
|
|
58
58
|
|
|
@@ -111,8 +111,8 @@ setup:
|
|
|
111
111
|
|
|
112
112
|
| Convention | Args | Cleanup | Return | Caller-saved | Use Case |
|
|
113
113
|
| ------------ | -------------- | ------- | ------ | ------------ | ----------- |
|
|
114
|
-
| **cdecl** | Stack R→L
|
|
115
|
-
| **stdcall** | Stack R→L
|
|
114
|
+
| **cdecl** | Stack R→L | Caller | EAX | EAX,ECX,EDX | Default C |
|
|
115
|
+
| **stdcall** | Stack R→L | Callee | EAX | EAX,ECX,EDX | Windows API |
|
|
116
116
|
| **fastcall** | ECX,EDX,Stack | Callee | EAX | EAX,ECX,EDX | Performance |
|
|
117
117
|
| **thiscall** | ECX=this,Stack | Callee | EAX | EAX,ECX,EDX | C++ methods |
|
|
118
118
|
|
|
@@ -257,7 +257,7 @@ static inline void cpuid(uint32_t level, uint32_t *eax, uint32_t *ebx,
|
|
|
257
257
|
}
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
### MSVC x64
|
|
260
|
+
### MSVC x64 Use Intrinsics Instead
|
|
261
261
|
|
|
262
262
|
```c
|
|
263
263
|
// MSVC x64 does NOT support inline asm
|
|
@@ -273,7 +273,7 @@ uint64_t rdtsc_msvc(void) {
|
|
|
273
273
|
extern "C" uint64_t custom_asm_function(uint64_t arg);
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
### External ASM File (MASM
|
|
276
|
+
### External ASM File (MASM Windows x64)
|
|
277
277
|
|
|
278
278
|
```asm
|
|
279
279
|
; custom_asm.asm
|
|
@@ -305,246 +305,27 @@ int main() {
|
|
|
305
305
|
|
|
306
306
|
---
|
|
307
307
|
|
|
308
|
-
##
|
|
309
|
-
|
|
310
|
-
### Intrinsics vs Inline ASM Decision
|
|
311
|
-
|
|
312
|
-
```yaml
|
|
313
|
-
recommendation:
|
|
314
|
-
use_intrinsics:
|
|
315
|
-
- Portable across compilers
|
|
316
|
-
- Compiler can optimize around them
|
|
317
|
-
- Easier to maintain
|
|
318
|
-
- Better for SSE/AVX/AVX-512
|
|
319
|
-
|
|
320
|
-
use_inline_asm:
|
|
321
|
-
- CPU-specific features not in intrinsics
|
|
322
|
-
- Precise instruction control needed
|
|
323
|
-
- Very small, critical code paths
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### SSE/AVX Intrinsics Example
|
|
327
|
-
|
|
328
|
-
```c
|
|
329
|
-
#include <immintrin.h>
|
|
330
|
-
|
|
331
|
-
// Add 8 floats using AVX
|
|
332
|
-
void vector_add_avx(float* result, const float* a, const float* b) {
|
|
333
|
-
__m256 va = _mm256_load_ps(a); // Load 8 floats from a
|
|
334
|
-
__m256 vb = _mm256_load_ps(b); // Load 8 floats from b
|
|
335
|
-
__m256 vr = _mm256_add_ps(va, vb); // Add
|
|
336
|
-
_mm256_store_ps(result, vr); // Store result
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Dot product using SSE
|
|
340
|
-
float dot_product_sse(const float* a, const float* b, int n) {
|
|
341
|
-
__m128 sum = _mm_setzero_ps();
|
|
342
|
-
for (int i = 0; i < n; i += 4) {
|
|
343
|
-
__m128 va = _mm_load_ps(&a[i]);
|
|
344
|
-
__m128 vb = _mm_load_ps(&b[i]);
|
|
345
|
-
sum = _mm_add_ps(sum, _mm_mul_ps(va, vb));
|
|
346
|
-
}
|
|
347
|
-
// Horizontal add
|
|
348
|
-
sum = _mm_hadd_ps(sum, sum);
|
|
349
|
-
sum = _mm_hadd_ps(sum, sum);
|
|
350
|
-
return _mm_cvtss_f32(sum);
|
|
351
|
-
}
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
### Runtime CPU Feature Detection
|
|
355
|
-
|
|
356
|
-
```c
|
|
357
|
-
#include <cpuid.h> // GCC/Clang
|
|
358
|
-
|
|
359
|
-
bool has_avx2(void) {
|
|
360
|
-
unsigned int eax, ebx, ecx, edx;
|
|
361
|
-
__cpuid(7, eax, ebx, ecx, edx);
|
|
362
|
-
return (ebx & (1 << 5)) != 0; // AVX2 bit
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Dispatch based on CPU features
|
|
366
|
-
void process_data(float* data, int n) {
|
|
367
|
-
if (has_avx2()) {
|
|
368
|
-
process_avx2(data, n);
|
|
369
|
-
} else if (has_sse4()) {
|
|
370
|
-
process_sse4(data, n);
|
|
371
|
-
} else {
|
|
372
|
-
process_scalar(data, n);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
### ARM64 NEON Intrinsics
|
|
378
|
-
|
|
379
|
-
```c
|
|
380
|
-
#include <arm_neon.h>
|
|
381
|
-
|
|
382
|
-
// Add 4 floats using NEON
|
|
383
|
-
void vector_add_neon(float* result, const float* a, const float* b) {
|
|
384
|
-
float32x4_t va = vld1q_f32(a); // Load 4 floats
|
|
385
|
-
float32x4_t vb = vld1q_f32(b); // Load 4 floats
|
|
386
|
-
float32x4_t vr = vaddq_f32(va, vb); // Add
|
|
387
|
-
vst1q_f32(result, vr); // Store
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
// Horizontal sum
|
|
391
|
-
float horizontal_sum_neon(float32x4_t v) {
|
|
392
|
-
float32x2_t sum = vadd_f32(vget_low_f32(v), vget_high_f32(v));
|
|
393
|
-
sum = vpadd_f32(sum, sum);
|
|
394
|
-
return vget_lane_f32(sum, 0);
|
|
395
|
-
}
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
---
|
|
399
|
-
|
|
400
|
-
## 📁 Program Structure Templates
|
|
308
|
+
## 📚 Deep-Dive References
|
|
401
309
|
|
|
402
|
-
|
|
310
|
+
- **SIMD Programming** — SSE, AVX, NEON intrinsics and patterns
|
|
311
|
+
→ See [references/simd-programming.md](references/simd-programming.md)
|
|
403
312
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
section .data
|
|
407
|
-
msg db "Hello, World!", 10
|
|
408
|
-
len equ $ - msg
|
|
409
|
-
|
|
410
|
-
section .bss
|
|
411
|
-
buffer resb 256
|
|
412
|
-
|
|
413
|
-
section .text
|
|
414
|
-
global _start
|
|
415
|
-
|
|
416
|
-
_start:
|
|
417
|
-
; sys_write(1, msg, len)
|
|
418
|
-
mov rax, 1 ; syscall: write
|
|
419
|
-
mov rdi, 1 ; fd: stdout
|
|
420
|
-
mov rsi, msg ; buffer
|
|
421
|
-
mov rdx, len ; count
|
|
422
|
-
syscall
|
|
423
|
-
|
|
424
|
-
; sys_exit(0)
|
|
425
|
-
mov rax, 60 ; syscall: exit
|
|
426
|
-
xor rdi, rdi ; status: 0
|
|
427
|
-
syscall
|
|
428
|
-
```
|
|
313
|
+
- **Build Commands & Program Structure** — NASM/MASM/GAS templates, Makefile patterns
|
|
314
|
+
→ See [references/build-structure.md](references/build-structure.md)
|
|
429
315
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
```asm
|
|
433
|
-
; program.asm
|
|
434
|
-
.data
|
|
435
|
-
msg db "Hello, World!", 0
|
|
436
|
-
|
|
437
|
-
.code
|
|
438
|
-
externdef printf:proc
|
|
439
|
-
|
|
440
|
-
main PROC
|
|
441
|
-
sub rsp, 40 ; Shadow space + alignment
|
|
442
|
-
lea rcx, msg ; First arg
|
|
443
|
-
call printf
|
|
444
|
-
add rsp, 40
|
|
445
|
-
xor eax, eax ; Return 0
|
|
446
|
-
ret
|
|
447
|
-
main ENDP
|
|
448
|
-
|
|
449
|
-
END
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
### GAS (ARM64)
|
|
453
|
-
|
|
454
|
-
```asm
|
|
455
|
-
// program.s
|
|
456
|
-
.data
|
|
457
|
-
msg: .ascii "Hello, World!\n"
|
|
458
|
-
len = . - msg
|
|
459
|
-
|
|
460
|
-
.text
|
|
461
|
-
.global _start
|
|
462
|
-
|
|
463
|
-
_start:
|
|
464
|
-
mov x8, #64 // sys_write
|
|
465
|
-
mov x0, #1 // fd: stdout
|
|
466
|
-
ldr x1, =msg // buffer
|
|
467
|
-
mov x2, #len // count
|
|
468
|
-
svc #0
|
|
469
|
-
|
|
470
|
-
mov x8, #93 // sys_exit
|
|
471
|
-
mov x0, #0 // status
|
|
472
|
-
svc #0
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
---
|
|
476
|
-
|
|
477
|
-
## 🔨 Build Commands
|
|
478
|
-
|
|
479
|
-
### NASM + LD (Linux)
|
|
480
|
-
|
|
481
|
-
```bash
|
|
482
|
-
# Compile
|
|
483
|
-
nasm -f elf64 program.asm -o program.o
|
|
484
|
-
|
|
485
|
-
# Link
|
|
486
|
-
ld program.o -o program
|
|
487
|
-
|
|
488
|
-
# Or with C runtime
|
|
489
|
-
nasm -f elf64 program.asm -o program.o
|
|
490
|
-
gcc program.o -o program -no-pie
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
### MASM + MSVC (Windows)
|
|
494
|
-
|
|
495
|
-
```powershell
|
|
496
|
-
# Compile ASM
|
|
497
|
-
ml64 /c program.asm /Fo program.obj
|
|
498
|
-
|
|
499
|
-
# Link with C++ code
|
|
500
|
-
cl /c main.cpp
|
|
501
|
-
link main.obj program.obj /OUT:main.exe
|
|
502
|
-
|
|
503
|
-
# Or combined in Visual Studio project
|
|
504
|
-
# Just add .asm file after enabling MASM build customization
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
### GAS + GCC (Cross-platform)
|
|
508
|
-
|
|
509
|
-
```bash
|
|
510
|
-
# Compile
|
|
511
|
-
as program.s -o program.o
|
|
512
|
-
|
|
513
|
-
# Link
|
|
514
|
-
ld program.o -o program
|
|
515
|
-
|
|
516
|
-
# Or with GCC
|
|
517
|
-
gcc -c program.s -o program.o
|
|
518
|
-
gcc main.c program.o -o main
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
### CMake Integration
|
|
522
|
-
|
|
523
|
-
```cmake
|
|
524
|
-
# Enable ASM
|
|
525
|
-
enable_language(ASM_NASM)
|
|
526
|
-
# or
|
|
527
|
-
enable_language(ASM_MASM)
|
|
528
|
-
|
|
529
|
-
# Add ASM sources
|
|
530
|
-
add_executable(myprogram
|
|
531
|
-
main.cpp
|
|
532
|
-
asm_routines.asm
|
|
533
|
-
)
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
---
|
|
316
|
+
- **Advanced Architectures** — Legacy DOS, RISC-V, Intel AVX10/AMX, modern IDE tools
|
|
317
|
+
→ See [references/advanced-architectures.md](references/advanced-architectures.md)
|
|
537
318
|
|
|
538
319
|
## ✅ Best Practices Checklist
|
|
539
320
|
|
|
540
|
-
- [ ] **Avoid inline ASM if possible**
|
|
541
|
-
- [ ] **Profile before optimizing**
|
|
542
|
-
- [ ] **Keep ASM sections minimal**
|
|
543
|
-
- [ ] **Use runtime CPU detection**
|
|
544
|
-
- [ ] **Align data properly**
|
|
545
|
-
- [ ] **Follow calling conventions**
|
|
546
|
-
- [ ] **Document thoroughly**
|
|
547
|
-
- [ ] **Test on target hardware**
|
|
321
|
+
- [ ] **Avoid inline ASM if possible** Use intrinsics, compiler optimizations
|
|
322
|
+
- [ ] **Profile before optimizing** Don't guess, measure
|
|
323
|
+
- [ ] **Keep ASM sections minimal** Maintain only critical paths
|
|
324
|
+
- [ ] **Use runtime CPU detection** Support multiple instruction sets
|
|
325
|
+
- [ ] **Align data properly** 16/32/64-byte for SIMD operations
|
|
326
|
+
- [ ] **Follow calling conventions** Preserve callee-saved registers
|
|
327
|
+
- [ ] **Document thoroughly** ASM is harder to understand
|
|
328
|
+
- [ ] **Test on target hardware** SIMD behavior varies
|
|
548
329
|
|
|
549
330
|
---
|
|
550
331
|
|
|
@@ -561,193 +342,3 @@ add_executable(myprogram
|
|
|
561
342
|
---
|
|
562
343
|
|
|
563
344
|
## 🏛️ Legacy Assemblers & DOS
|
|
564
|
-
|
|
565
|
-
### Assembler Comparison
|
|
566
|
-
|
|
567
|
-
| Assembler | Syntax | Linker | 16-bit | Direct .COM | Best For |
|
|
568
|
-
| --------- | --------- | ------ | ------ | ----------- | --------------------- |
|
|
569
|
-
| **NASM** | Intel | LD/GCC | ✅ | ✅ | Cross-platform |
|
|
570
|
-
| **MASM** | Intel | LINK | ✅ | ❌ | Windows/Visual Studio |
|
|
571
|
-
| **GAS** | AT&T | LD | ✅ | ❌ | GCC/Linux ecosystem |
|
|
572
|
-
| **TASM** | Intel | TLINK | ✅ | ✅ | DOS + Turbo Debugger |
|
|
573
|
-
| **FASM** | Intel | None | ✅ | ✅ | Self-contained, fast |
|
|
574
|
-
| **A86** | Custom | None | ✅ | ✅ | Simple DOS programs |
|
|
575
|
-
| **YASM** | NASM-like | LD | ✅ | ✅ | NASM alternative |
|
|
576
|
-
| **HLA** | High-lvl | Link | ❌ | ❌ | Learning ASM |
|
|
577
|
-
|
|
578
|
-
### 16-bit Real Mode (8086/8088)
|
|
579
|
-
|
|
580
|
-
```asm
|
|
581
|
-
; NASM 16-bit DOS .COM program
|
|
582
|
-
org 0x100 ; .COM files load at 100h
|
|
583
|
-
|
|
584
|
-
section .text
|
|
585
|
-
start:
|
|
586
|
-
mov ah, 09h ; DOS print string
|
|
587
|
-
mov dx, message
|
|
588
|
-
int 21h
|
|
589
|
-
|
|
590
|
-
mov ah, 4Ch ; DOS exit
|
|
591
|
-
int 21h
|
|
592
|
-
|
|
593
|
-
section .data
|
|
594
|
-
message db "Hello, DOS!", 13, 10, "$"
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
### DOSBox Development Setup
|
|
598
|
-
|
|
599
|
-
```yaml
|
|
600
|
-
setup:
|
|
601
|
-
1. Install DOSBox/DOSBox-X
|
|
602
|
-
2. Mount work directory: mount c c:\asm
|
|
603
|
-
3. Install assembler (TASM/MASM/NASM)
|
|
604
|
-
4. Use DEBUG.EXE or Turbo Debugger
|
|
605
|
-
|
|
606
|
-
debuggers:
|
|
607
|
-
DEBUG.EXE: "Built-in DOS debugger (line-oriented)"
|
|
608
|
-
Turbo Debugger: "Full-screen, source-level debugging"
|
|
609
|
-
D86: "A86's companion debugger"
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
### CPU Evolution (16 → 32 → 64-bit)
|
|
613
|
-
|
|
614
|
-
| CPU | Year | Bits | Address | Mode | Memory |
|
|
615
|
-
| ------- | ---- | ---- | ------- | ------------ | ------ |
|
|
616
|
-
| 8086 | 1978 | 16 | 20-bit | Real | 1 MB |
|
|
617
|
-
| 8088 | 1979 | 16 | 20-bit | Real | 1 MB |
|
|
618
|
-
| 80286 | 1982 | 16 | 24-bit | Real/Prot | 16 MB |
|
|
619
|
-
| 80386 | 1985 | 32 | 32-bit | Real/Prot/V8 | 4 GB |
|
|
620
|
-
| 80486 | 1989 | 32 | 32-bit | Real/Prot/V8 | 4 GB |
|
|
621
|
-
| Pentium | 1993 | 32 | 32-bit | Real/Prot/V8 | 4 GB |
|
|
622
|
-
| x64 | 2003 | 64 | 48-bit | Long | 256 TB |
|
|
623
|
-
|
|
624
|
-
---
|
|
625
|
-
|
|
626
|
-
## 🆕 RISC-V Assembly
|
|
627
|
-
|
|
628
|
-
### Register Map (RV64I)
|
|
629
|
-
|
|
630
|
-
| ABI Name | Reg | Role | Preserved |
|
|
631
|
-
| -------- | ------ | --------------- | --------- |
|
|
632
|
-
| zero | x0 | Hard-wired zero | N/A |
|
|
633
|
-
| ra | x1 | Return address | No |
|
|
634
|
-
| sp | x2 | Stack pointer | Yes |
|
|
635
|
-
| gp | x3 | Global pointer | N/A |
|
|
636
|
-
| tp | x4 | Thread pointer | N/A |
|
|
637
|
-
| t0-t2 | x5-7 | Temporaries | No |
|
|
638
|
-
| s0/fp | x8 | Saved/Frame ptr | Yes |
|
|
639
|
-
| s1 | x9 | Saved register | Yes |
|
|
640
|
-
| a0-a7 | x10-17 | Args / Return | No |
|
|
641
|
-
| s2-s11 | x18-27 | Saved registers | Yes |
|
|
642
|
-
| t3-t6 | x28-31 | Temporaries | No |
|
|
643
|
-
|
|
644
|
-
### Calling Convention
|
|
645
|
-
|
|
646
|
-
```asm
|
|
647
|
-
# RISC-V function example
|
|
648
|
-
my_function:
|
|
649
|
-
addi sp, sp, -16 # Allocate stack
|
|
650
|
-
sd ra, 8(sp) # Save return address
|
|
651
|
-
sd s0, 0(sp) # Save s0
|
|
652
|
-
|
|
653
|
-
# ... function body ...
|
|
654
|
-
# Args in a0-a7, return in a0/a1
|
|
655
|
-
|
|
656
|
-
ld s0, 0(sp) # Restore s0
|
|
657
|
-
ld ra, 8(sp) # Restore ra
|
|
658
|
-
addi sp, sp, 16 # Deallocate
|
|
659
|
-
ret
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
### Common Extensions
|
|
663
|
-
|
|
664
|
-
| Ext | Description |
|
|
665
|
-
| --- | ------------------- |
|
|
666
|
-
| M | Multiply/Divide |
|
|
667
|
-
| A | Atomics |
|
|
668
|
-
| F | Single-precision FP |
|
|
669
|
-
| D | Double-precision FP |
|
|
670
|
-
| C | Compressed (16-bit) |
|
|
671
|
-
| V | Vector extension |
|
|
672
|
-
|
|
673
|
-
---
|
|
674
|
-
|
|
675
|
-
## 🆕 Intel AVX10 & AMX (2025-2026)
|
|
676
|
-
|
|
677
|
-
### AVX10.2 (June 2025)
|
|
678
|
-
|
|
679
|
-
```yaml
|
|
680
|
-
features:
|
|
681
|
-
- Mixed-precision: FP16, BF16 operations
|
|
682
|
-
- IEEE-754-2019 NaN propagation
|
|
683
|
-
- Unified P-core/E-core support
|
|
684
|
-
- Embedded rounding in 256-bit mode
|
|
685
|
-
- 32 vector registers (ZMM0-31)
|
|
686
|
-
|
|
687
|
-
detection:
|
|
688
|
-
CPUID: Check AVX10 version via CPUID.07H
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
### Intel AMX (Sapphire Rapids+)
|
|
692
|
-
|
|
693
|
-
```yaml
|
|
694
|
-
description: "Accelerate matrix operations for AI/ML"
|
|
695
|
-
|
|
696
|
-
tiles:
|
|
697
|
-
count: 8 (TMM0-TMM7)
|
|
698
|
-
max_size: 16 rows × 64 bytes
|
|
699
|
-
|
|
700
|
-
data_types:
|
|
701
|
-
- BF16 (Brain Float 16)
|
|
702
|
-
- INT8 (8-bit integer)
|
|
703
|
-
- FP16 (Half precision)
|
|
704
|
-
|
|
705
|
-
speedup: "Up to 10x for deep learning"
|
|
706
|
-
```
|
|
707
|
-
|
|
708
|
-
### AMX Intrinsics Example
|
|
709
|
-
|
|
710
|
-
```c
|
|
711
|
-
#include <immintrin.h>
|
|
712
|
-
|
|
713
|
-
void amx_matmul_bf16(void* c, void* a, void* b) {
|
|
714
|
-
_tile_loadd(0, a, 64); // Load A → TMM0
|
|
715
|
-
_tile_loadd(1, b, 64); // Load B → TMM1
|
|
716
|
-
_tile_dpbf16ps(2, 0, 1); // C += A × B (BF16)
|
|
717
|
-
_tile_stored(2, c, 64); // Store result
|
|
718
|
-
}
|
|
719
|
-
```
|
|
720
|
-
|
|
721
|
-
---
|
|
722
|
-
|
|
723
|
-
## 🛠️ Modern IDE Tools (2025-2026)
|
|
724
|
-
|
|
725
|
-
### VS Code Extensions
|
|
726
|
-
|
|
727
|
-
| Extension | Purpose |
|
|
728
|
-
| ------------------------- | ---------------------- |
|
|
729
|
-
| `ms-vscode.cpptools` | C/C++ IntelliSense |
|
|
730
|
-
| `maziac.asm-code-lens` | ASM syntax + debugging |
|
|
731
|
-
| `dan-c-underwood.arm` | ARM assembly support |
|
|
732
|
-
| `13xforever.language-x86` | x86/x64 syntax |
|
|
733
|
-
| `Cortex-Debug` | ARM embedded debugging |
|
|
734
|
-
|
|
735
|
-
### ARM-Specific Tools
|
|
736
|
-
|
|
737
|
-
| Tool | Description |
|
|
738
|
-
| -------------- | ------------------------------- |
|
|
739
|
-
| ArmLS | ARM64 language server (LSP) |
|
|
740
|
-
| Arm Dev Studio | Full IDE + Performance Analyzer |
|
|
741
|
-
| QEMU | ARM64/RISC-V emulation |
|
|
742
|
-
|
|
743
|
-
### Online Assembly Tools
|
|
744
|
-
|
|
745
|
-
| Tool | URL |
|
|
746
|
-
| ------------------ | ------------------------ |
|
|
747
|
-
| Compiler Explorer | godbolt.org |
|
|
748
|
-
| ASM Editor (specy) | asm-editor.specy.app |
|
|
749
|
-
| onlinegdb | onlinegdb.com/online_asm |
|
|
750
|
-
|
|
751
|
-
---
|
|
752
|
-
|
|
753
|
-
_DOMYH Awesome Code • Assembly Language Skill • Comprehensive Guide_
|