Using CYGWIN to assemble

Has anyone used Cygwin to compile and run an assembler program. If so can you please tell me how to get Cygwin to work. This is how I have been doing it. First my code:
[code]
section .data

msg db "Hello", 0xA
len equ $ - msg

section .text

global main

main:
mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, len
int 0x80

mov eax, 1
mov ebx, 0
int 0x80
[/code]

At the command line of cygwin I am doing:
> nasm -f elf hello.asm
>gcc -o hello hello.o

I am also using MinGW to, but it does the same thing.

Any help would be appreciated!!


Comments

  • : Has anyone used Cygwin to compile and run an assembler program. If so can you please tell me how to get Cygwin to work. This is how I have been doing it. First my code:
    : [code]
    : section .data
    :
    : msg db "Hello", 0xA
    : len equ $ - msg
    :
    : section .text
    :
    : global main
    :
    : main:
    : mov eax, 4
    : mov ebx, 1
    : mov ecx, msg
    : mov edx, len
    : int 0x80
    :
    : mov eax, 1
    : mov ebx, 0
    : int 0x80
    : [/code]
    :
    : At the command line of cygwin I am doing:
    : > nasm -f elf hello.asm
    : >gcc -o hello hello.o
    :
    : I am also using MinGW to, but it does the same thing.
    :
    : Any help would be appreciated!!

    I'm very new to assembly so this is just a shot in the dark, but I believe that int 0x80 is the Linux kernel system call. Cygwin is just an emulation layer running on Windows. I bet you'll find that you need to use DOS interrupts. (0x21 perhaps? I'm not sure about all this)


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion