3 ms·
Ask HN: Best blog tutorial explaining Assembly code?
- westurner 3y agohttps://news.ycombinator.com/item?id=23930335#23931373 https://news.ycombinator.com/item?id=23930335#23931373 ; the HLA book: https://en.wikipedia.org/wiki/High_Level_Assembly https://en.wikipedia.org/wiki/High_Level_Assembly Code a sum function, Compile artifact1; Mutate/Change a line, Compile artifact2; and bindiff artifact1 artifact2 HLA is easier to follow than diffing to see what ASM gcc builds from C without flags to simplify the output bytecode. https://news.ycombinator.com/item?id=36454485 https://news.ycombinator.com/item?id=36454485 Learn X in Y minutes > MIPS Assembly: https://learnxinyminutes.com/docs/mips/ https://learnxinyminutes.com/docs/mips/
- westurner 3y agoThis is almost Hello World: https://stackoverflow.com/questions/2246748/assembly-linking-problem-with-nasm-and-ld/2246826#2246826 https://stackoverflow.com/questions/2246748/assembly-linking... ~: cat hello.asm # section .text # jmp [rax] nasm -f elf64 hello.asm objdump -Sr hello.o /? nasm helloworld: https://www.google.com/search?q=nasm+helloworld https://www.google.com/search?q=nasm+helloworld : - https://www.devdungeon.com/content/hello-world-nasm-assembler https://www.devdungeon.com/content/hello-world-nasm-assemble... : succinct Hello World program; 32bit ; - [ ] port this to 64bit - "NASM Tutorial" https://cs.lmu.edu/~ray/notes/nasmtutorial/ https://cs.lmu.edu/~ray/notes/nasmtutorial/ ; a good "blog tutorial explaining Assembly code" per OT "What is better "int 0x80" or "syscall" [or "sysenter" or VDSO] in 32-bit code on Linux?" https://stackoverflow.com/questions/12806584/what-is-better-int-0x80-or-syscall-in-32-bit-code-on-linux/12806910#12806910 https://stackoverflow.com/questions/12806584/what-is-better-... links to https://stackoverflow.com/questions/12776340/system-calls-implementation https://stackoverflow.com/questions/12776340/system-calls-im... which links to the vDSO Wikipedia article, which explains that vDSO supports ASLR and is more portable than `int 80` (which is the old 32bit way to syscall) vDSO: https://en.wikipedia.org/wiki/VDSO https://en.wikipedia.org/wiki/VDSO "Linux Assembly HOWTO" http://tldp.org/HOWTO/Assembly-HOWTO/ http://tldp.org/HOWTO/Assembly-HOWTO/
- westurner 3y agoMASM only works on Windows. NASM works on Lin/Mac/Win; there's also a nasm.exe. And, like MASM, NASM assembles Intel ASM syntax (unlike GNU Assembler (`gas`)) /? nasm masm differences: https://www.google.com/search?q=nasm+masm+differences https://www.google.com/search?q=nasm+masm+differences /? Yasm Fasm: x86 Assembly/x86 Assemblers: https://en.wikibooks.org/wiki/X86_Assembly/x86_Assemblers https://en.wikibooks.org/wiki/X86_Assembly/x86_Assemblers ; GAS, YASM; MASM, JWASM; NASM, FASM, YASM; HLA
- westurner 3y agoWASM: WebAssembly > Specification > Wasm program > Code representation > C source code and corresponding WebAssembly https://en.wikipedia.org/wiki/WebAssembly#Code_representation https://en.wikipedia.org/wiki/WebAssembly#Code_representatio... WASI: https://en.wikipedia.org/wiki/WebAssembly https://en.wikipedia.org/wiki/WebAssembly : > WebAssembly System Interface (WASI) is a simple interface (ABI and API) designed by Mozilla intended to be portable to any platform.[84] It provides POSIX-like features like file I/O constrained by capability-based security.[85][86] There are also a few other proposed ABI/APIs.[87][88] [88]: webassembly/wasm-c-api: https://github.com/WebAssembly/wasm-c-api https://github.com/WebAssembly/wasm-c-api /? WASM tutorial: https://www.google.com/search?q=wasm+tutorial https://www.google.com/search?q=wasm+tutorial /? WASM helloworld: https://www.google.com/search?q=wasm+helloworld https://www.google.com/search?q=wasm+helloworld Learn X in Y minutes > WebAssembly: https://learnxinyminutes.com/docs/wasm/ https://learnxinyminutes.com/docs/wasm/ WebAssembly/WABT: The WebAssembly Binary Toolkit: https://github.com/WebAssembly/wabt https://github.com/WebAssembly/wabt https://docs.docker.com/desktop/wasm/ https://docs.docker.com/desktop/wasm/ : docker run \ --runtime=io.containerd.wasmedge.v1 \ --platform=wasi/wasm \ secondstate/rust-example-hello > Docker Desktop downloads and installs the following runtimes that you can use to run Wasm workloads: io.containerd.slight.v1 io.containerd.spin.v2 io.containerd.wasmedge.v1 io.containerd.wasmtime.v1 io.containerd.lunatic.v1 io.containerd.wws.v1 io.containerd.wasmer.v1 Do all of these have WASI?