Code Snippets Motorola 68K Assembly

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

usermodeStack.s

[esp + 16] ss ; the stack segment selector we want for user mode [esp + 12] esp ; the user mode stack pointer [esp + 8] eflags ; the control flags we want to use in user mode [esp + 4] cs ; the code segment selector [esp + 0] eip ; the instruction […]

CodesForUpdateToLoader.s

extern kernel_virtual_start extern kernel_virtual_end extern kernel_physical_start extern kernel_physical_end ; … push kernel_physical_end push kernel_physical_start push kernel_virtual_end push kernel_virtual_start call kmain

BrainF*** -> qbe -> assembly

99 Bottles of Beer in Urban Mueller’s BrainF*** (The actual name is impolite) by Ben Olmstead ANSI C interpreter available on the internet; due to constraints in comments the address below needs to have the stuff in parenthesis replaced with the appropriate symbol: http://www(dot)cats(dash)eye(dot)com/cet/soft/lang/bf/ Believe it or not this language is indeed Turing complete! Combines […]

newloader.s

global loader ; the entry symbol for ELF extern kernel_virtual_start ; extern kernel_virtual_end ; extern kernel_physical_start ; extern kernel_physical_end ; extern kmain ; function kmain is defined elsewhere MAGIC_NUMBER equ 0x1BADB002 ; define the magic number constant ALIGN_MODULES equ 0x00000001 ; tell GRUB to align modules ; calculate the checksum (all options + checksum should […]

paging_enable.s

global enablePaging enablePaging: ; load page directory (eax has the address of the page directory) mov eax, [esp+4] mov cr3, eax ; enable 4MBpage ; mov ebx, cr4 ; read current cr4 ; or ebx, 0x00000010 ; set PSE – enable 4MB page ; mov cr4, ebx ; update cr4 ; enable paging mov ebx, […]