Why is a 32 bit memset acccepting only 8-bit data?i586coder wrote:any comments
Graphic Primitives
- 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: Graphic Primitives
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Graphic Primitives
Have you tested it? We can't really reply and comment without results, other than the fact that I think your using of assembly for a memset is completely unnecessary. You can do it all in C without any asm needed.
<This space reserved for fix, comment, congratz, witty remark, or smartassery. >
<This space reserved for fix, comment, congratz, witty remark, or smartassery. >
Maybe it's a memset for a 32-bit OS? Kinda silly, though, imho.Combuster wrote:Why is a 32 bit memset acccepting only 8-bit data?i586coder wrote:any comments
- 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: Graphic Primitives
No I haven't tested things, but I can do manual instruction counting based on what code a compiler can produce.
And he's not using a common compiler... (If I had to guess, its Turbo C which doesn't optimize at all)
And he's not using a common compiler... (If I had to guess, its Turbo C which doesn't optimize at all)
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: Graphic Primitives
Code: Select all
/*
Lots of comments
even more comments
some more comments
*/
Regards
Shrek
Re: Graphic Primitives
Why are you writing a 32 bit OS in a 16 bit compiler? I assume you are using Turbo C by your usage of its ES directive. (Or has Borland released a 32 bit version of Turbo C that I am not aware of?)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: Graphic Primitives
OK,
I'm using
1)nontraditional TURBO C++ 3.X PATCH AS FIRST STAGE COMPILING TO PRODUCE 32BIT ASSEMBLY INSTRUCTIONS
2)TURBO ASM 32BIT TO INTEGRATED WITH TURBO C,AND THIS IS THE IMPORTANT PART
so to be clear, C/C++ source file --> TCC --> ASM -->manual modification --> TASM --> OBJ
--> EXE
CheerS,
a.T.d
I'm using
1)nontraditional TURBO C++ 3.X PATCH AS FIRST STAGE COMPILING TO PRODUCE 32BIT ASSEMBLY INSTRUCTIONS
2)TURBO ASM 32BIT TO INTEGRATED WITH TURBO C,AND THIS IS THE IMPORTANT PART
so to be clear, C/C++ source file --> TCC --> ASM -->manual modification --> TASM --> OBJ
--> EXE
good question, in pixel art i need to repeat one pixel(byte) N timesCombuster wrote:Why is a 32 bit memset acccepting only 8-bit data?i586coder wrote:any comments
CheerS,
a.T.d
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
but it does make you part of a larger picture.
- 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: Graphic Primitives
You so totally missed the point.i586coder wrote:good question, in pixel art i need to repeat one pixel(byte) N timesCombuster wrote:Why is a 32 bit memset acccepting only 8-bit data?i586coder wrote:any comments
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Graphic Primitives
Sorry Com, was aiming my post at the OPCombuster wrote:No I haven't tested things, but I can do manual instruction counting based on what code a compiler can produce.