[완료]cygwin에서 어셈블리 개발 불가능??

esanai의 이미지

참고로 운영체제는 Win XP에 cygwin을 설치하였습니다.

http://asm.sourceforge.net/howto/hello.html 에 있던 소스를 그대로 복사해서
NASM과 GAS로 각각의 실행파일을 만드는 데에 성공했습니다.
허나

NASM에선
$ ./hello
bash: ./hello: Permission denied
라고 뜨고

GAS에선 첨부파일에 포함된 것 처럼 에러창이 뜹니다.

ㅜㅜ...
방법이 없을까요??

File attachments: 
첨부파일 크기
Image icon error.jpg106.25 KB
익명 사용자의 이미지

리눅스가 아닌 시스템에서 리눅스 시스템 콜은 사용불가능 할듯 하네요..

익명 사용자의 이미지

여건이 안되신다면 coLinux상에서 해보심이~

esanai의 이미지

학교 과제로 간단한 C언어 컴파일러를 만드는 중입니다.
어셈블리 코드를 생성하고 어셈블해서 실행파일까지 만들고 싶습니다.
cygwin 상에서 flex와 bison을 이용하고 있습니다.

VMware와 리눅스를 설치하는 방법은 일단 제외합니다. 번거럽기도 하고 노트북 사양도 낮아서요... ㅜㅜ
cygwin 상에서 생성한 어셈블리 코드를 윈도로 가져와 MASM으로 어셈블하는 방법도 있습니다만, 실행파일 생성 시 마다 수작업이 동원되므로 깔끔하지가 못합니다.
되도록이면 cygwin 상에서 모두 해결하고 싶습니다.

그렇다면 cygwin 상에서 실행파일을 만들려면 어떻게 해야 할까요?
GAS나 NASM이 아닌 다른 어셈블러로 바꿔야 하나요?
아니면, 어셈블러는 그대로 두고 리눅스 시스템 콜이 아닌 윈도 시스템 콜을 써야 하나요?
┌----------------------------------
www.eSanai.com -----------
│내 멋 대로 산다. ----------
└-----------------


┌----------------------------------
www.eSanai.com -----------
│내 멋 대로 산다. ----------
└-----------------

wkpark의 이미지

cygwin상에서 MASM path만 잡아주셔도 MASM을 곧바로 쓰실 수 있습니다.

온갖 참된 삶은 만남이다 --Martin Buber

Necromancer의 이미지

어셈블러 문제는 아니고요.
리눅스에서 시스템콜로 사용하는 int 80h은 윈도에서 지원 안해주기 때문에 생기는 문제죠.

도스 기준으로 맞추기 바랍니다. 16비트에서는 int 21h를 주로 써야 하고,
32비트가 정말 필요하다면 DPMI 인터페이스를 이용한 보호모드 전환을 하셔야 합니다.
아님.. win32 exe로 만드시던가.

Written By the Black Knight of Destruction

Written By the Black Knight of Destruction

esanai의 이미지

cygwin에서 MASM 사용이 가능했군요.. ㅡㅡ;
간단한 걸 왜 몰랐을까 싶네요.

int 21h로 바꿔서도 되는지 해봐야겠네요.. ^^
도움 주신 분들 정말 감사합니다.

┌----------------------------------
www.eSanai.com -----------
│내 멋 대로 산다. ----------
└-----------------


┌----------------------------------
www.eSanai.com -----------
│내 멋 대로 산다. ----------
└-----------------

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.