[질문]gcc compile시 문의

wsmin의 이미지

Linux에서 dos programing을 물어 보기가 죄송하군요..
gcc로 dos용 프로그램을 작성하고 있는데, 기존의 dos 프로그램이
near, far pointer를 사용하고 있습니다.
이를 gcc로 compile하면 parse error가 발생하는데...
gcc 컴파일러 옵션을 찾아보아도 이에 대한 내용은 없네요...
기존 dos 프로그램의 near, far를 없애면 에러는 발생하지 않는데,
문제는 없는지요.
고수님들 조언 바랍니다.

cedar의 이미지

DOS용 gcc라면 djgpp를 쓰시나요? djgpp는 32비트 컴파일러이므로 16비트 코드와 호환성이 없습니다.
djgpp의 비공식적인(거의 테스팅이 안되어 있는 것 같습니다.) 16비트 버전이 있기는 있지만, (http://www.delorie.com/djgpp/16bit/gcc/)
far 포인터를 아예 지원하지 않습니다. 게다가 C++도 안됩니다.

글쎄요, 현재로서는 x86(8086, 8088, 80186, 80286)을 사용한 16비트 임베디드 시스템 프로그래밍을 할 것이 아니라면, near니 far니 하는 16비트 코드는 아예 모르셔도 됩니다.

익명 사용자의 이미지

16비트 DOS 프로그램을 32비트로 포팅하려는게 아니라면
그냥 TurboC (혹은 BorlandC)를 구해서 쓰세요.
정품을 구입하시는건 어렵고 Borland 사이트를 뒤지다 보면 free commandline tools 가 공개되어 있습니다.

32비트 DJGPP로 포팅하시는 경우라면 그냥 지워버리면 됩니다.
DJGPP는 DPMI 플랫메모리를 지원하므로 near/far pointer를 구분하지 않습니다.

cedar의 이미지

seearomi wrote:
16비트 DOS 프로그램을 32비트로 포팅하려는게 아니라면
그냥 Turbo C (혹은 Borland C++)를 구해서 쓰세요.
정품을 구입하시는건 어렵고 Borland 사이트를 뒤지다 보면 free command line tools 가 공개되어 있습니다.

볼랜드에 있는 free command line compiler 는 Borland C++ 5.5인데요,
http://www.borland.com/products/downloads/download_cbuilder.html
이건 32비트 컴파일러입니다. 16비트 컴파일이 불가능합니다.
물론 IDE가 없기 때문에 별도의 에디터를 써야 합니다. 열심히 make 파일을 만드는 수고도 필요하지요. 8)

이외에 볼랜드에서 공식적으로 프리웨어로 푼 16비트 C/C++ 컴파일러는
Turbo C 2.0과 Turbo C++ 1.0 입니다.
볼랜드 사이트에 처음 가신 분은 찾기가 상당히 어려운데,
http://community.borland.com/museum/ 에 가시면 됩니다.
(과거의 추억을 되살리는 재밌는 기사들이 있습니다. :) )

그 외의 버전은 물론 상용입니다만, 최후의 도스용 IDE였던 Borland C++ 3.1은 정보문화사를 비롯한 국내 출판사에 나온 몇권의 C/C++에 번들되었습니다. 그래서 사실상 무료로 풀린 거나 마찬가지가 되었습니다. 정보문화사 공개자료실에도 번듯이 올라와 있네요.

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.