this is my code
is there anyone help me analyze this problem,thanks
asm & c compile problem
asm & c compile problem
Last edited by hatling on Thu Jun 07, 2012 5:52 am, edited 1 time in total.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: asm & c compile problem
Don't use a 32 or 64-bit compiler if you expect 16-bit code.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: asm & c compile problem
Actually, it should be fine with GCC, if DS = ES and the code fits one segment. Isn't that what they do with GRUB?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: asm & c compile problem
Not without doing the hack that makes it emit 16-bit code.Love4Boobies wrote:Actually, it should be fine with GCC, if DS = ES and the code fits one segment. Isn't that what they do with GRUB?
The OP is executing 32-bit opcodes in 16-bit mode and wonders why the compiler is "broken". The problem gets ever more interesting when you end up using a mingw32 (educated guess) compiler to make a DOS .COM binary in a "bootloader" folder. Add to that that the OP can't even formulate a proper question chances are likely he doesn't even understand what he's doing - in which case guessing the right fix is rather dangerous.
Re: asm & c compile problem
thanksCombuster wrote:Not without doing the hack that makes it emit 16-bit code.Love4Boobies wrote:Actually, it should be fine with GCC, if DS = ES and the code fits one segment. Isn't that what they do with GRUB?
The OP is executing 32-bit opcodes in 16-bit mode and wonders why the compiler is "broken". The problem gets ever more interesting when you end up using a mingw32 (educated guess) compiler to make a DOS .COM binary in a "bootloader" folder. Add to that that the OP can't even formulate a proper question chances are likely he doesn't even understand what he's doing - in which case guessing the right fix is rather dangerous.
when i add
Code: Select all
asm(".code16gcc\n\t");
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: asm & c compile problem
Combuster wrote:Add to that that the OP can't even formulate a proper question chances are likely he doesn't even understand what he's doing
hatling wrote:...
I agree with half of that, Berkus.berkus wrote:
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: asm & c compile problem
Well, you just wasted both your hands on one stupidity. There might be more to come. That is, unless the OP finally gets the hint and stops posting symptoms of an unmentioned problem.
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: asm & c compile problem
Both hands? Those were two one-handed facepalms
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: asm & c compile problem
And two heads obviously.