Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7935283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:52:23+00:00 2026-06-03T21:52:23+00:00

How do I compile 16-bit C code with GCC? I am trying to write

  • 0

How do I compile 16-bit C code with GCC? I am trying to write a flat bootloader that just writes “Hello World!” to the computer and halts.

int main(int argc, char** argv)
{
    char* value = "Hello World!";
    __asm
    {
        mov si, value
    loop:
        lodsb
        cmp al, 0
    halt:
        je halt
        mov bx, 0x0007 ; Black BG, White TXT
        mov ah, 0x0E   ; Teletype output
        int 0x10
        jmp loop
    }
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:52:24+00:00Added an answer on June 3, 2026 at 9:52 pm

    You don’t. You can’t. GCC doesn’t generate 16-bit x86 code.

    Use Open Watcom C/C++ or the ancient Turbo C++ (v 1.01 is freely available online).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to compile a 64 bit linux kernel using gcc, I see the
i found this code online and im trying to compile it, but gcc keeps
Can I set the gcc-compiler to only compile C-code? My main concern is, that
I have the following bit of legacy C++ code that does not compile: #include
I'm having a bit of an odd problem while trying to compile some code
I was a bit surprised when the following code wouldn't compile: -- Code 1
I am using Lazarus v0.9.30 (32 bit compiler). I have the following code that
I'm trying to learn a little bit C++ and Boost.Asio. I'm trying to compile
I am trying to write 2GB to a file using pwrite, but my code
I am trying to cross-compile a very simple program for Android that worked with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.