* Minix assembly {{{ #!asm .sect .text; .sect .rom; .sect .data; .sect .bss; .extern _main, _printf, _scanf .sect .text _main: push ebp mov ebp, esp push x push fmt call _scanf add esp, 8 push (x) call quad add esp, 4 push eax push s call _printf add esp, 4 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 = (message*) malloc(sizeof(message)); msg->m_source = 0; msg->m_type = M1; msg->m1_i1 = 42; send(ANY, msg); return 0; } }}}