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 7719515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:26:09+00:00 2026-06-01T03:26:09+00:00

So far i have an assembly script that lets you boot from it and

  • 0

So far i have an assembly script that lets you boot from it and write hello world to the screen. now i want to be able to write some c code and be able to have my assembly script run it somehow. Im using mingw gcc for my compiler. This is my bootloader in assembly:

 org 7C00h
 jmp short Start  
 Msg:    db "Hello, world"  EndMsg:  Start:  mov bx, 000Fh   
 mov cx, 1       
 xor dx, dx  
 mov ds, dx
 cld               Print:  mov si, Msg   

          Char:   mov ah, 2      
 int 10h
 lodsb


 mov ah, 9   
 int 10h
 inc dl      
 cmp dl, 80      
 jne Skip
 xor dl, dl
 inc dh
 cmp dh, 25    
 jne Skip
 xor dh, dh  
 Skip:   cmp si, EndMsg
 jne Char        
 jmp Print        times 0200h - 2 - ($ - $$)  db 0    
 dw 0AA55h

My question is how to compile the c code so that the assembly script will execute it? also how would i edit my current boot loader so that would be possible?

  • 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-01T03:26:10+00:00Added an answer on June 1, 2026 at 3:26 am

    First, you should select a compiler to use and study its specifics. C programs can be compiled for “hosted” environment which supposes standard initialization, main() as entry point and standard library, and “freestanding” environment where such guarantees aren’t provided. To call C code you shall do appropriate environment setup (stack, data segments, etc.) in the bootloader. Details for this are compiler-specific. Converting of object code to form suitable for your bootloader can also be problem.
    For 16-bit code, there are at least Turbo C and Watcom C available for free use. Watcom is more progressive and modern and is open source now.
    Note that standard library is unavailable in such setup, so C code shall be specially written for your environment; this includes such underwater stones as e.g. multiplication of 32-bit longs was usually implemented in library, despite you don’t write library call.

    [In general, I’m confused with your request to use precisely C; as soon as bootloader unlikely needs execution speed, it’s more proper to use something more applicable for such context, as Forth. There are ready to use implementations (see FreeBSD bootloader).]

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

Sidebar

Related Questions

So far I have managed to write some code that should print the source
What I have so far: I have a form in PHP that contain the
I have an issue that has me stumped. We have a model assembly and
I have a dll that contains a number of classes that all inherit from
I have code that uses the DllImport attribute to talk with an unmanaged assembly.
I have some assembly that references NUnit and creates a single test class with
So far I have encountered adjacency list, nested sets and nested intervals as models
So far i have got the code below which works lovely when trying an
So far I have been creating Web Portal but recently I had a request
So far I have learned about generating thread dump and heap dump using jstack

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.