Code Snippets Assembly

Short texts Assembly 🧑‍💻 Code snippets Assembly ✍️ Reading lists Assembly 👀

https://github.com/ClangBuiltLinux/linux/issues/1302 reduction

long hweight_long_w; amd_numa_init_nb, amd_numa_init_base, amd_numa_init_limit; static hweight_long() { return __builtin_constant_p(hweight_long_w) ? (hweight_long_w & 1) + hweight_long_w + !(hweight_long_w & 2) + !(hweight_long_w & 3) + !!(hweight_long_w & 4) + !!hweight_long_w 8 > 3) + !(hweight_long_w >> 4) + 5 + !(hweight_long_w >> 6) + !(hweight_long_w >> 7) + hweight_long_w >> 6 & !(hweight_long_w >> 1) […]

ELF- Processor Brand

; Processor Brand ; ; CPUBRAND.ASM ; Copyright (C) 2021 Boo Khan Ming ; ; MIT license apply ; ; “AuthenticAMD” – AMD ; “GenuineIntel” – Intel ; format ELF64 executable 3 segment readable executable entry $ xor eax, eax cpuid mov dword [cpu], ebx mov dword [cpu + 4], edx mov dword [cpu + […]

PE- Processor Name

; Processor Name ; ; CPUNAME.ASM ; Copyright (C) 2021 Boo Khan Ming ; ; MIT license apply ; format PE GUI 4.0 entry start include ‘win32a.inc’ section ‘.data’ readable writable _caption db ‘Processor Name’,0 section ‘.code’ code readable writable executable _name rb 48 start: mov eax, 0x80000002 cpuid mov dword [_name], eax mov dword […]

PE- Open File and Read File

; Open File and Read File (Extended Version with Command Line File Name Support) ; ; DUMPFILE.ASM ; Copyright (C) 2021 Boo Khan Ming ; ; MIT license apply ; format PE console entry start include ‘win32a.inc’ section ‘.data’ readable writable _message1 db ‘INVALID_HANDLE_VALUE’,13,10,0 _msglen1 = $ – _message1 _message2 db ‘ReadFile FALSE’,13,10,0 _msglen2 = […]

KEYZX – keyboard driver for CP/M on ZX Spectrum

; KEYZX – keyboard driver for CP/M on ZX Spectrum ; (c) 2021 ZXLDR ; ; [email protected] ; get char routine (wait for key) Get_Char: ; out: a – char code IF DEFINED ACCEPT_NO_RST38_HOOK ld hl, (0x39) ld bc, rst_38_routine or a sbc hl, bc ; check Rst38 routine jr z, continue_keyboard_scan ; cheap keyboard […]