Пытаюсь писать в Visual Studio 2008. В проекте из main вызывает asm-функция clear: Код (Text): .586 ;Target processor. Use instructions for Pentium class machines .MODEL FLAT, C ;Use the flat memory model. Use C calling conventions .STACK ;Define a stack segment of 1KB (Not required for this example) .DATA ;Create a near data segment. Local variables are declared after ;this directive (Not required for this example) .CODE ;Indicates the start of a code segment. clear PROC xor eax, eax xor ebx, ebx ret clear ENDP END помогите, пожалуйста, добавить в этот код вывод строки ("hello, world"). Желательно, используя вызов функцию printf стандартной библиотека stdio.h. Заранее благодарен.
Всем спасибо за внимание, извините, что побеспокоил))) оказалось всё просто)))) Код (Text): .586 ;Target processor. Use instructions for Pentium class machines .MODEL FLAT, C ;Use the flat memory model. Use C calling conventions .STACK ;Define a stack segment of 1KB (Not required for this example) .DATA ;Create a near data segment. Local variables are declared after ;this directive (Not required for this example) msg db "hello, world!" .CODE ;Indicates the start of a code segment. EXTERN printf:near clear PROC xor eax, eax xor ebx, ebx push offset msg call printf pop eax ret clear ENDP END
Код (Text): push offset msg call printf pop eax http://en.wikipedia.org/wiki/X86_calling_conventions#cdecl