== Assembly MINIX == * Minix assembly (man 9 as) {{{ #!asm .sect .text; .sect .rom; .sect .data; .sect .bss; .define _main .extern _printf, _scanf, exit .sect .text _main: push ebp mov ebp, esp push x push fmt call _scanf pop ecx pop ecx push (x) call quad pop ecx push eax push s call _printf pop ecx poecx push 0 call _exit mov esp, ebp pop ebp ret quad: push ebp mov ebp, esp mov eax, 8(ebp) imul eax, eax mov esp, ebp pop ebp ret .sect .data x: .data4 0 .sect .rom s: .asciz "Il risultato: %d\n" fmt: .asciz "%d" }}} * messaggi in Minix {{{ #!c #include #include #include #include #include #include int send(int, message*); int main(void){ message msg; msg.m_source = 0; msg.m_type = M1; msg.m1_i1 = 42; send(ANY, &msg); return 0; } }}}