Turbo C issues

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Turbo C issues

Post by Troy Martin »

I'm going to write a 16-bit kernel in C, so I decided that TC is the only viable option to use under windoze. I've run into a few problems:

- How the hell do I do inline asm in this thing without it complaining about "inline assembly not allowed" or even "undefined symbol 'mov'" or anything like that?
- Will it compile to a simple flat binary?

EDIT: I'm using version 2.01.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
i586coder
Member
Member
Posts: 143
Joined: Sat Sep 20, 2008 6:43 am

Re: Turbo C issues

Post by i586coder »

Hi,

coding OS under TC is realy cooool 8)

to use assembly inside c code

first,let TC active 32bit opcode,using TASM5
(turbo assembler)

Code: Select all

 #pragma inline
note:
by default TASM is not in TC package ,you need to add it in your /tc/bin

to add your assembly code use -> asm <-

Code: Select all

main(){

 asm{.386
          mov eax,0x12345678
 }

}
finally,i invite you to use TC3.1 becuse it easy to do 32bit shift by <<,>> operator

you may use .286x,.236x,.486x,.586x
where x=no things || p

to make flat binary
it's difficult to convert .exe to .bin result to segmentation in exe,but if you make a .exe in tiny memory model you can
i recomended EXE2BIN.exe to do that

good luck :mrgreen:
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
Post Reply