Code Snippets Unix Assembly

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

AT&T assembly syntax and IA-32 instructions

# ——– # Hardware # ——– # Opcode – operational code # Assebly mnemonic – abbreviation for an operation # Instruction Code Format (IA-32) # – Optional instruction prefix # – Operational code # – Optional modifier(s) # – Optional data element(s) # Micro operations (micro-ops or μops) are detailed low-level instructions # used in […]

https://github.com/ClangBuiltLinux/linux/issues/1447

# $ arm-linux-gnueabi-as -mthumb -march=armv7-a foo.s -o foo.o # $ clang –target=arm-linux-gnueabi -Wa,-mthumb -Wa,-march=armv7-a -c foo.s .syntax unified .globl v7wbi_flush_kern_tlb_range .align 0 v7wbi_flush_kern_tlb_range: bx lr .type v7wbi_flush_kern_tlb_range, %function .size v7wbi_flush_kern_tlb_range, .-v7wbi_flush_kern_tlb_range .section “.init.text”,”ax” .type v7wbi_tlb_fns, #object .globl v7wbi_tlb_fns .align 0 v7wbi_tlb_fns: .long v7wbi_flush_user_tlb_range .long v7wbi_flush_kern_tlb_range

out_clang.s

/* * This file is part of open_agb_firm * Copyright (C) 2021 derrek, profi200 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at […]

out_gcc.s

/* * This file is part of open_agb_firm * Copyright (C) 2021 derrek, profi200 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at […]

Enabling_paging.s

; eax has the address of the page directory mov cr3, eax mov ebx, cr4 ; read current cr4 or ebx, 0x00000010 ; set PSE mov cr4, ebx ; update cr4 mov ebx, cr0 ; read current cr0 or ebx, 0x80000000 ; set PG mov cr0, ebx ; update cr0 ; now paging is enabled