473,834 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bitwise rotation

Greetings,

I am simulating an assembly language bit rotation in C# and it works
wonderfully

---------
....
public uint Value;
....
public uint RotateRight(byt e count) {
Value = ((Value >> count) | (Value << (32-count)));
return Value;
}
---------

as long is the value is 32-bit or 64-bit (because of a limitation of the
shift operator). I need it to work on an 8-bit or 16-bit value, as well. I
presume I'd have to have knowledge of the intended size of the value and do
the shift and move the bit and the 0 or 7, or 0 or 15 bit position and clear
the extra bits if there are any. That seems like a lot of work.

Is there a way to simulate an 8 or 16-bit rotate with a 32-bit or 64-bit
value?
Thanks,
Shawn
Nov 15 '05
33 2566
I this has been completed. It works great. I would have never thought of
it in this manner and yet it is so simple, I was hoping more for a Bit type
of syntax but this works great. I didn't get rid of GetBit/SetBit (just
made them private) because the code that they perform doesn't "feel" right
in the indexer code, just looks weird. I'll make it look "right" soon but
for now...
Thanks,
Shawn
"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:us******** ******@TK2MSFTN GP11.phx.gbl...
Hi Shawn,

In GetBit, SetBit or in shift operators, you don't need to check of are shifting 0 steps, just do it anyway. It will return the correct value.
Couldn't you have an indexer on the BinaryXX class itself?
Then you'd say,
BinaryX[0] = 1;
BinaryX[2] = BinaryX[0];

For me, that would make more sense than a separate Bit class.

public int this [int index] // Indexer declaration
{
get
{
//GetBit here
}
set
{
//SetBit here
}
}
--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message

news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Robert,

You're first suggestion crossed my mind, I have already started eliminating the temp variables thus far (thus far only in the 8-bit operator overloads region area). Just be happy you didn't see the earlier version I first
posted, it didn't cast because I kept getting compile errors, it ran
everything through a Convert.ToUIntX () call but I've since removed those...
I also plan to move the Shift function logic into the overload to avoid the extra function call.

The GetBit optimization hint you provided is what I've been wanting to do but didn't quite put it they way you did... I'll try that and see how it
works. I don't know what to do about that check in it, though. I feel like it's necessary. Perhaps I could just make the if based on some calculation and then just throw an exception at the end of the function and avoid that early check, perhaps that would be a better approach. Such as (if (Value == 0 && Value < SIZE-1) {)

There is one thing I need help on.
I don't like the GetBit, SetBit approach. I would rather be able to say x = BinaryX.Bit[0]; BinaryX.Bit[0] = 1; I created a Bit class that had an
indexer but it had problems. Not the least of which was a circular
reference that ended up being a memory leak, not what I wanted in the
innermost loop of an emulator. The second being that I could easily say x = x.Bit[0] but not easily say x.Bit[0] = 1.

Do you have any ideas how I might approach this? I was using a property
get/set at first but that didn't work, instead I just created a public
module variable "public Bit Bit;" and then it had a constructor to pass a reference of the Binary class into it so it would be able to change the bit if a bit was set. Not a good approach. Do you have any ideas?
Thanks for your help,
Shawn
"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:O9******** *****@TK2MSFTNG P10.phx.gbl...
Hi Shawn,

I've looked at it, and no optimization suggestions other than
some obvious simple ones:

public int GetBit(byte index) {
if (index > (byte)SIZE-1) {
throw new IndexOutOfRange Exception("Bit " + index.ToString( ) + "
does not exist.");
}
uint val = (uint)Value;
byte shift = (byte)(index - 1);
if (index == 0)
return (int)(val & 0x01);
else
return (int)(val >> shift) & 0x01;
}

This is very verbose, and you're creating lots of temp variables
I'd rather write something like (untested):

public int GetBit(byte index) {
if (index > (byte)SIZE-1) {
throw new IndexOutOfRange Exception("Bit " + index.ToString( ) +
" does not exist.");
}
return (int)((Value >> index-1) & 0x01;
}

The check to avoid a shift probably just hurts performance anyway.
Also for SetBit, the two if else must result in unwanted branches:

public void SetBit(byte index, int value) {
if (index > (byte)SIZE-1) {
throw new IndexOutOfRange Exception("Bit " + index.ToString( ) +
" does not exist.");
}
byte shift = index;
if (index == 0) {
if (value == 0)
Value &= unchecked((usho rt)~0x01);
else
Value |= 0x01;
}
else {
if (value == 0)
Value &= ((ushort)~(0x01 << shift));
else
Value |= (ushort)(0x01 << shift);
}
}

How about this instead (also untested):

public void SetBit(byte index, int value) {
if (index > (byte)SIZE-1) {
throw new IndexOutOfRange Exception("Bit " + index.ToString( ) +
" does not exist.");
}
if (value == 0)
Value &= ((ushort)~(0x01 << index));
else
Value |= (ushort)(0x01 << index);
}

This is the only type of optimizations I came up with, so I thought it

wasn't worth posting. :)


--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message

news:%2******** *******@tk2msft ngp13.phx.gbl.. .
> Well, I've posted it twice and no one is jumpting to optimize it...

perhaps
> it's just so well working that there's no need? he he
>
>
>
>
> Thanks,
> Shawn
>
> "Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
> news:Oi******** ******@TK2MSFTN GP09.phx.gbl...
> > Do post it here!
> > I'd be interested to see, as I'm sure many others would.
> > You'll probably get a ton of optimization hints from it. :)
> >
> >
> > --
> > Robert Jeppesen
> > robert.jeppesen %at%durius-dot-se
> >
> >
> > "Shawn B." <le****@html.co m> wrote in message
> news:OW******** ******@tk2msftn gp13.phx.gbl...
> > > Don't miss a thing, d'ya? =))
> > >
> > > I'm writing a processor Simulator for the 8-bit 6502, 8-bit
65c02, and
> the
> > > 16-bit 65816. In particular, I'm doing this so I can debug (I
have the
> > > ability to modify the assembly language while the debugger is

running
> > > (similar to VB6 and VC++ Edit-and-Continue). I can only see raw
> > > instructions. I'm not designing it to be a particular piece of

hardware
> > > (such as the Apple, Atari, Commadore, etc.). I can supply it

plugins so
> my
> > > plugins can treat an area of memory as a dedicated "something"
such as
> text
> > > display or graphics display, etc. For now, I'm concerned not
even with
> the
> > > text display. My end result, is actually more akin to being
able to > debug
> > > my NES games I've been into writing lately. Also I want to be ready > with my
> > > own debugger for Andre LaMothe's upcoming XGameStation console

(don't
> know
> > > whether he'll have a debugger or not) but I want a debugger that

allows
> me
> > > to change the code while it's being debugged and my simulator allows for
> it
> > > (as long as the source code file is available -- else if it was

loading
> as a
> > > .bin file then it won't be editable during a debug session).
> > >
> > > So it's really more than a simulator. It's an integrated
> (non-seperable)
> > > assembly, linker, dissassembler, debugger, simulator, etc. kind
of a > beast.
> > > I chose C# because it's not the kind of thing I'd want to do in

VB.NET
> (I'm
> > > primarly a VB.NET programmer) but didn't feel like doing it in

Managed
> C++
> > > but also wanted it to target the .NET framework (as much as is
> reasonable
> > > and I'll find out what that really means when its mature enough to start
> > > using reliably).
> > >
> > > I can do a decent job emulating 1-5MHz in C# on my PIII 1000MHz
CPU with
> > > GeForce II 64MB and 512MB Ram. I don't know how well it'll do

emulating
> the
> > > 16-bit processor as I haven't deciphered the specs for the CPU
yet (the
> > > 8-bit CPU is very easy compared to the 16-bit version of the

processor).
> I
> > > ultimately will make this Interfacable so I can write a Z80
core, as > well.
> > >
> > > These bit manipulations are the utmost inner-loop so I have to make them
> > > tight. Looking at the JIT'd code for these methods seems to be

decent
> but I
> > > have to make too many function calls (read, jumps) for my tastes
but > doesn't
> > > seem to be hurting me at the moment). Since I can't inline in ..NET, > I'll
> > > have to live with it. Also, being an 8-bit and 16-bit CPU, it can't > > > generate the best code for the rotates and shifts because I have to > emulate
> > > 8-bit and 16-bit shifts and rotates. I'm also trying to work out a > better
> > > way for simulating memory manipulation. Now I'm creating a string of
> (64kb
> > > in length) but manipulating each byte by substrings has got to
be > expensive.
> > > I'm looking into whether a byte array would be better.
> > >
> > >
> > > Thanks for the help,
> > > if interested, I'll post my binary class here for all to see.
> > >
> > > I've completed the Rotates, Shift, converting numerics into binary > (string
> > > of 1's and 0's). I know now have to read the binary back to a

numeric,
> and
> > > allow a way to get/set/toggle individual bits.
> > >
> > >
> > > Thanks,
> > > Shawn
> > >
> > >
> > > "Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message > > > news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > > > So, you're writing an emulator for which processor??
> > > >
> > > > --
> > > > Bob Powell [MVP]
> > > > C#, System.Drawing
> > > >
> > > > September's edition of Well Formed is now available.
> > > > http://www.bobpowell.net/currentissue.htm
> > > >
> > > > Answer those GDI+ questions with the GDI+ FAQ
> > > > http://www.bobpowell.net/gdiplus_faq.htm
> > > >
> > > >
> > > >
> > > > "Shawn B." <le****@html.co m> wrote in message
> > > > news:O9******** *****@TK2MSFTNG P11.phx.gbl...
> > > > > Greetings,
> > > > >
> > > > > I am simulating an assembly language bit rotation in C# and it works
> > > > > wonderfully
> > > > >
> > > > > ---------
> > > > > ...
> > > > > public uint Value;
> > > > > ...
> > > > > public uint RotateRight(byt e count) {
> > > > > Value = ((Value >> count) | (Value << (32-count)));
> > > > > return Value;
> > > > > }
> > > > > ---------
> > > > >
> > > > > as long is the value is 32-bit or 64-bit (because of a

limitation of
> the
> > > > > shift operator). I need it to work on an 8-bit or 16-bit
value, as
> > > well.
> > > > I
> > > > > presume I'd have to have knowledge of the intended size of
the value
> and
> > > > do
> > > > > the shift and move the bit and the 0 or 7, or 0 or 15 bit

position
> and
> > > > clear
> > > > > the extra bits if there are any. That seems like a lot of
work. > > > > >
> > > > > Is there a way to simulate an 8 or 16-bit rotate with a

32-bit or
> 64-bit
> > > > > value?
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Shawn
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #31
Hey Shawn,

So now getting or setting bits costs an extra method call? Get used to it and remove the extra method call. :)
--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message news:e2******** *****@TK2MSFTNG P12.phx.gbl...
I this has been completed. It works great. I would have never thought of
it in this manner and yet it is so simple, I was hoping more for a Bit type
of syntax but this works great. I didn't get rid of GetBit/SetBit (just
made them private) because the code that they perform doesn't "feel" right
in the indexer code, just looks weird. I'll make it look "right" soon but
for now...
Thanks,
Shawn
"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:us******** ******@TK2MSFTN GP11.phx.gbl...
Hi Shawn,

In GetBit, SetBit or in shift operators, you don't need to check of are

shifting 0 steps, just do it anyway. It will return the
correct value.
Couldn't you have an indexer on the BinaryXX class itself?
Then you'd say,
BinaryX[0] = 1;
BinaryX[2] = BinaryX[0];

For me, that would make more sense than a separate Bit class.

public int this [int index] // Indexer declaration
{
get
{
//GetBit here
}
set
{
//SetBit here
}
}
--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message

news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Robert,

You're first suggestion crossed my mind, I have already started eliminating the temp variables thus far (thus far only in the 8-bit operator overloads region area). Just be happy you didn't see the earlier version I first
posted, it didn't cast because I kept getting compile errors, it ran
everything through a Convert.ToUIntX () call but I've since removed those...
I also plan to move the Shift function logic into the overload to avoid the extra function call.

The GetBit optimization hint you provided is what I've been wanting to do but didn't quite put it they way you did... I'll try that and see how it
works. I don't know what to do about that check in it, though. I feel like it's necessary. Perhaps I could just make the if based on some calculation and then just throw an exception at the end of the function and avoid that early check, perhaps that would be a better approach. Such as (if (Value == 0 && Value < SIZE-1) {)

There is one thing I need help on.
I don't like the GetBit, SetBit approach. I would rather be able to say x = BinaryX.Bit[0]; BinaryX.Bit[0] = 1; I created a Bit class that had an
indexer but it had problems. Not the least of which was a circular
reference that ended up being a memory leak, not what I wanted in the
innermost loop of an emulator. The second being that I could easily say x = x.Bit[0] but not easily say x.Bit[0] = 1.

Do you have any ideas how I might approach this? I was using a property
get/set at first but that didn't work, instead I just created a public
module variable "public Bit Bit;" and then it had a constructor to pass a reference of the Binary class into it so it would be able to change the bit if a bit was set. Not a good approach. Do you have any ideas?
Thanks for your help,
Shawn
"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:O9******** *****@TK2MSFTNG P10.phx.gbl...
> Hi Shawn,
>
> I've looked at it, and no optimization suggestions other than
> some obvious simple ones:
>
> public int GetBit(byte index) {
> if (index > (byte)SIZE-1) {
> throw new IndexOutOfRange Exception("Bit " + index.ToString( ) + " does not exist.");
> }
> uint val = (uint)Value;
> byte shift = (byte)(index - 1);
> if (index == 0)
> return (int)(val & 0x01);
> else
> return (int)(val >> shift) & 0x01;
> }
>
> This is very verbose, and you're creating lots of temp variables
> I'd rather write something like (untested):
>
> public int GetBit(byte index) {
> if (index > (byte)SIZE-1) {
> throw new IndexOutOfRange Exception("Bit " + index.ToString( ) + " does not exist.");
> }
> return (int)((Value >> index-1) & 0x01;
> }
>
> The check to avoid a shift probably just hurts performance anyway.
> Also for SetBit, the two if else must result in unwanted branches:
>
> public void SetBit(byte index, int value) {
> if (index > (byte)SIZE-1) {
> throw new IndexOutOfRange Exception("Bit " + index.ToString( ) + " does not exist.");
> }
> byte shift = index;
> if (index == 0) {
> if (value == 0)
> Value &= unchecked((usho rt)~0x01);
> else
> Value |= 0x01;
> }
> else {
> if (value == 0)
> Value &= ((ushort)~(0x01 << shift));
> else
> Value |= (ushort)(0x01 << shift);
> }
> }
>
> How about this instead (also untested):
>
> public void SetBit(byte index, int value) {
> if (index > (byte)SIZE-1) {
> throw new IndexOutOfRange Exception("Bit " + index.ToString( ) + " does not exist.");
> }
> if (value == 0)
> Value &= ((ushort)~(0x01 << index));
> else
> Value |= (ushort)(0x01 << index);
> }
>
> This is the only type of optimizations I came up with, so I thought it
wasn't worth posting. :)
>
>
> --
> Robert Jeppesen
> robert.jeppesen %at%durius-dot-se
>
>
> "Shawn B." <le****@html.co m> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
> > Well, I've posted it twice and no one is jumpting to optimize it...
perhaps
> > it's just so well working that there's no need? he he
> >
> >
> >
> >
> > Thanks,
> > Shawn
> >
> > "Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
> > news:Oi******** ******@TK2MSFTN GP09.phx.gbl...
> > > Do post it here!
> > > I'd be interested to see, as I'm sure many others would.
> > > You'll probably get a ton of optimization hints from it. :)
> > >
> > >
> > > --
> > > Robert Jeppesen
> > > robert.jeppesen %at%durius-dot-se
> > >
> > >
> > > "Shawn B." <le****@html.co m> wrote in message
> > news:OW******** ******@tk2msftn gp13.phx.gbl...
> > > > Don't miss a thing, d'ya? =))
> > > >
> > > > I'm writing a processor Simulator for the 8-bit 6502, 8-bit 65c02, and
> > the
> > > > 16-bit 65816. In particular, I'm doing this so I can debug (I have the
> > > > ability to modify the assembly language while the debugger is
running
> > > > (similar to VB6 and VC++ Edit-and-Continue). I can only see raw
> > > > instructions. I'm not designing it to be a particular piece of
hardware
> > > > (such as the Apple, Atari, Commadore, etc.). I can supply it
plugins so
> > my
> > > > plugins can treat an area of memory as a dedicated "something" such as
> > text
> > > > display or graphics display, etc. For now, I'm concerned not even with
> > the
> > > > text display. My end result, is actually more akin to being able to > > debug
> > > > my NES games I've been into writing lately. Also I want to be ready > > with my
> > > > own debugger for Andre LaMothe's upcoming XGameStation console
(don't
> > know
> > > > whether he'll have a debugger or not) but I want a debugger that
allows
> > me
> > > > to change the code while it's being debugged and my simulator allows for
> > it
> > > > (as long as the source code file is available -- else if it was
loading
> > as a
> > > > .bin file then it won't be editable during a debug session).
> > > >
> > > > So it's really more than a simulator. It's an integrated
> > (non-seperable)
> > > > assembly, linker, dissassembler, debugger, simulator, etc. kind of a > > beast.
> > > > I chose C# because it's not the kind of thing I'd want to do in
VB.NET
> > (I'm
> > > > primarly a VB.NET programmer) but didn't feel like doing it in
Managed
> > C++
> > > > but also wanted it to target the .NET framework (as much as is
> > reasonable
> > > > and I'll find out what that really means when its mature enough to start
> > > > using reliably).
> > > >
> > > > I can do a decent job emulating 1-5MHz in C# on my PIII 1000MHz CPU with
> > > > GeForce II 64MB and 512MB Ram. I don't know how well it'll do
emulating
> > the
> > > > 16-bit processor as I haven't deciphered the specs for the CPU yet (the
> > > > 8-bit CPU is very easy compared to the 16-bit version of the
processor).
> > I
> > > > ultimately will make this Interfacable so I can write a Z80 core, as > > well.
> > > >
> > > > These bit manipulations are the utmost inner-loop so I have to make them
> > > > tight. Looking at the JIT'd code for these methods seems to be
decent
> > but I
> > > > have to make too many function calls (read, jumps) for my tastes but > > doesn't
> > > > seem to be hurting me at the moment). Since I can't inline in .NET, > > I'll
> > > > have to live with it. Also, being an 8-bit and 16-bit CPU, it can't > > > > generate the best code for the rotates and shifts because I have to > > emulate
> > > > 8-bit and 16-bit shifts and rotates. I'm also trying to work out a > > better
> > > > way for simulating memory manipulation. Now I'm creating a string of
> > (64kb
> > > > in length) but manipulating each byte by substrings has got to be > > expensive.
> > > > I'm looking into whether a byte array would be better.
> > > >
> > > >
> > > > Thanks for the help,
> > > > if interested, I'll post my binary class here for all to see.
> > > >
> > > > I've completed the Rotates, Shift, converting numerics into binary > > (string
> > > > of 1's and 0's). I know now have to read the binary back to a
numeric,
> > and
> > > > allow a way to get/set/toggle individual bits.
> > > >
> > > >
> > > > Thanks,
> > > > Shawn
> > > >
> > > >
> > > > "Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message > > > > news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > > > > So, you're writing an emulator for which processor??
> > > > >
> > > > > --
> > > > > Bob Powell [MVP]
> > > > > C#, System.Drawing
> > > > >
> > > > > September's edition of Well Formed is now available.
> > > > > http://www.bobpowell.net/currentissue.htm
> > > > >
> > > > > Answer those GDI+ questions with the GDI+ FAQ
> > > > > http://www.bobpowell.net/gdiplus_faq.htm
> > > > >
> > > > >
> > > > >
> > > > > "Shawn B." <le****@html.co m> wrote in message
> > > > > news:O9******** *****@TK2MSFTNG P11.phx.gbl...
> > > > > > Greetings,
> > > > > >
> > > > > > I am simulating an assembly language bit rotation in C# and it works
> > > > > > wonderfully
> > > > > >
> > > > > > ---------
> > > > > > ...
> > > > > > public uint Value;
> > > > > > ...
> > > > > > public uint RotateRight(byt e count) {
> > > > > > Value = ((Value >> count) | (Value << (32-count)));
> > > > > > return Value;
> > > > > > }
> > > > > > ---------
> > > > > >
> > > > > > as long is the value is 32-bit or 64-bit (because of a
limitation of
> > the
> > > > > > shift operator). I need it to work on an 8-bit or 16-bit value, as
> > > > well.
> > > > > I
> > > > > > presume I'd have to have knowledge of the intended size of the value
> > and
> > > > > do
> > > > > > the shift and move the bit and the 0 or 7, or 0 or 15 bit
position
> > and
> > > > > clear
> > > > > > the extra bits if there are any. That seems like a lot of work. > > > > > >
> > > > > > Is there a way to simulate an 8 or 16-bit rotate with a 32-bit or
> > 64-bit
> > > > > > value?
> > > > > >
> > > > > >
> > > > > > Thanks,
> > > > > > Shawn
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #32
This extra method call isn't the performance bottleneck, the real kicker
that I'm trying to solve is the fact that this value is immutable. It has
to return a new instance of the class everytime you do something with it.
MS solved that with the string object by providing us a stringbuilder class.
I'd like to be able to make this class mutable, as well.

And no, my intentions are not to keep that extra method call for the set/get
bit, and for the shifts either.
Thanks,
Shawn

"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:eb******** ******@TK2MSFTN GP11.phx.gbl...
Hey Shawn,

So now getting or setting bits costs an extra method call? Get used to it and remove the extra method call. :)

--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message

news:e2******** *****@TK2MSFTNG P12.phx.gbl...
I this has been completed. It works great. I would have never thought of it in this manner and yet it is so simple, I was hoping more for a Bit type of syntax but this works great. I didn't get rid of GetBit/SetBit (just
made them private) because the code that they perform doesn't "feel" right in the indexer code, just looks weird. I'll make it look "right" soon but for now...
Thanks,
Shawn
"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:us******** ******@TK2MSFTN GP11.phx.gbl...
Hi Shawn,

In GetBit, SetBit or in shift operators, you don't need to check of are
shifting 0 steps, just do it anyway. It will return the
correct value.
Couldn't you have an indexer on the BinaryXX class itself?
Then you'd say,
BinaryX[0] = 1;
BinaryX[2] = BinaryX[0];

For me, that would make more sense than a separate Bit class.

public int this [int index] // Indexer declaration
{
get
{
//GetBit here
}
set
{
//SetBit here
}
}
--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message

news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
> Robert,
>
> You're first suggestion crossed my mind, I have already started

eliminating
> the temp variables thus far (thus far only in the 8-bit operator

overloads
> region area). Just be happy you didn't see the earlier version I
first > posted, it didn't cast because I kept getting compile errors, it ran
> everything through a Convert.ToUIntX () call but I've since removed

those...
>
> I also plan to move the Shift function logic into the overload to avoid the
> extra function call.
>
> The GetBit optimization hint you provided is what I've been wanting
to do
> but didn't quite put it they way you did... I'll try that and see
how it > works. I don't know what to do about that check in it, though. I feel like
> it's necessary. Perhaps I could just make the if based on some

calculation
> and then just throw an exception at the end of the function and
avoid that
> early check, perhaps that would be a better approach. Such as (if

(Value ==
> 0 && Value < SIZE-1) {)
>
> There is one thing I need help on.
>
>
> I don't like the GetBit, SetBit approach. I would rather be able to
say x =
> BinaryX.Bit[0]; BinaryX.Bit[0] = 1; I created a Bit class that had
an > indexer but it had problems. Not the least of which was a circular
> reference that ended up being a memory leak, not what I wanted in the > innermost loop of an emulator. The second being that I could easily say x =
> x.Bit[0] but not easily say x.Bit[0] = 1.
>
> Do you have any ideas how I might approach this? I was using a
property > get/set at first but that didn't work, instead I just created a public > module variable "public Bit Bit;" and then it had a constructor to pass a
> reference of the Binary class into it so it would be able to change
the bit
> if a bit was set. Not a good approach. Do you have any ideas?
>
>
> Thanks for your help,
> Shawn
>
>
> "Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
> news:O9******** *****@TK2MSFTNG P10.phx.gbl...
> > Hi Shawn,
> >
> > I've looked at it, and no optimization suggestions other than
> > some obvious simple ones:
> >
> > public int GetBit(byte index) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > uint val = (uint)Value;
> > byte shift = (byte)(index - 1);
> > if (index == 0)
> > return (int)(val & 0x01);
> > else
> > return (int)(val >> shift) & 0x01;
> > }
> >
> > This is very verbose, and you're creating lots of temp variables
> > I'd rather write something like (untested):
> >
> > public int GetBit(byte index) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > return (int)((Value >> index-1) & 0x01;
> > }
> >
> > The check to avoid a shift probably just hurts performance anyway.
> > Also for SetBit, the two if else must result in unwanted branches:
> >
> > public void SetBit(byte index, int value) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > byte shift = index;
> > if (index == 0) {
> > if (value == 0)
> > Value &= unchecked((usho rt)~0x01);
> > else
> > Value |= 0x01;
> > }
> > else {
> > if (value == 0)
> > Value &= ((ushort)~(0x01 << shift));
> > else
> > Value |= (ushort)(0x01 << shift);
> > }
> > }
> >
> > How about this instead (also untested):
> >
> > public void SetBit(byte index, int value) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > if (value == 0)
> > Value &= ((ushort)~(0x01 << index));
> > else
> > Value |= (ushort)(0x01 << index);
> > }
> >
> > This is the only type of optimizations I came up with, so I
thought it > wasn't worth posting. :)
> >
> >
> > --
> > Robert Jeppesen
> > robert.jeppesen %at%durius-dot-se
> >
> >
> > "Shawn B." <le****@html.co m> wrote in message
> news:%2******** *******@tk2msft ngp13.phx.gbl.. .
> > > Well, I've posted it twice and no one is jumpting to optimize it... > perhaps
> > > it's just so well working that there's no need? he he
> > >
> > >
> > >
> > >
> > > Thanks,
> > > Shawn
> > >
> > > "Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
> > > news:Oi******** ******@TK2MSFTN GP09.phx.gbl...
> > > > Do post it here!
> > > > I'd be interested to see, as I'm sure many others would.
> > > > You'll probably get a ton of optimization hints from it. :)
> > > >
> > > >
> > > > --
> > > > Robert Jeppesen
> > > > robert.jeppesen %at%durius-dot-se
> > > >
> > > >
> > > > "Shawn B." <le****@html.co m> wrote in message
> > > news:OW******** ******@tk2msftn gp13.phx.gbl...
> > > > > Don't miss a thing, d'ya? =))
> > > > >
> > > > > I'm writing a processor Simulator for the 8-bit 6502, 8-bit

65c02,
> and
> > > the
> > > > > 16-bit 65816. In particular, I'm doing this so I can debug (I have
> the
> > > > > ability to modify the assembly language while the debugger
is > running
> > > > > (similar to VB6 and VC++ Edit-and-Continue). I can only see raw > > > > > instructions. I'm not designing it to be a particular piece of > hardware
> > > > > (such as the Apple, Atari, Commadore, etc.). I can supply it > plugins so
> > > my
> > > > > plugins can treat an area of memory as a dedicated "something" such
> as
> > > text
> > > > > display or graphics display, etc. For now, I'm concerned
not even
> with
> > > the
> > > > > text display. My end result, is actually more akin to being

able to
> > > debug
> > > > > my NES games I've been into writing lately. Also I want to
be ready
> > > with my
> > > > > own debugger for Andre LaMothe's upcoming XGameStation
console > (don't
> > > know
> > > > > whether he'll have a debugger or not) but I want a debugger that > allows
> > > me
> > > > > to change the code while it's being debugged and my simulator allows
> for
> > > it
> > > > > (as long as the source code file is available -- else if it
was > loading
> > > as a
> > > > > .bin file then it won't be editable during a debug session).
> > > > >
> > > > > So it's really more than a simulator. It's an integrated
> > > (non-seperable)
> > > > > assembly, linker, dissassembler, debugger, simulator, etc. kind of a
> > > beast.
> > > > > I chose C# because it's not the kind of thing I'd want to do
in > VB.NET
> > > (I'm
> > > > > primarly a VB.NET programmer) but didn't feel like doing it in > Managed
> > > C++
> > > > > but also wanted it to target the .NET framework (as much as is > > > reasonable
> > > > > and I'll find out what that really means when its mature enough to
> start
> > > > > using reliably).
> > > > >
> > > > > I can do a decent job emulating 1-5MHz in C# on my PIII
1000MHz CPU
> with
> > > > > GeForce II 64MB and 512MB Ram. I don't know how well it'll
do > emulating
> > > the
> > > > > 16-bit processor as I haven't deciphered the specs for the CPU yet
> (the
> > > > > 8-bit CPU is very easy compared to the 16-bit version of the
> processor).
> > > I
> > > > > ultimately will make this Interfacable so I can write a Z80

core, as
> > > well.
> > > > >
> > > > > These bit manipulations are the utmost inner-loop so I have
to make
> them
> > > > > tight. Looking at the JIT'd code for these methods seems to
be > decent
> > > but I
> > > > > have to make too many function calls (read, jumps) for my tastes but
> > > doesn't
> > > > > seem to be hurting me at the moment). Since I can't inline
in .NET,
> > > I'll
> > > > > have to live with it. Also, being an 8-bit and 16-bit CPU,
it can't
> > > > > generate the best code for the rotates and shifts because I
have to
> > > emulate
> > > > > 8-bit and 16-bit shifts and rotates. I'm also trying to
work out a
> > > better
> > > > > way for simulating memory manipulation. Now I'm creating a

string
> of
> > > (64kb
> > > > > in length) but manipulating each byte by substrings has got
to be
> > > expensive.
> > > > > I'm looking into whether a byte array would be better.
> > > > >
> > > > >
> > > > > Thanks for the help,
> > > > > if interested, I'll post my binary class here for all to
see. > > > > >
> > > > > I've completed the Rotates, Shift, converting numerics into

binary
> > > (string
> > > > > of 1's and 0's). I know now have to read the binary back to a > numeric,
> > > and
> > > > > allow a way to get/set/toggle individual bits.
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Shawn
> > > > >
> > > > >
> > > > > "Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in

message
> > > > > news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > > > > > So, you're writing an emulator for which processor??
> > > > > >
> > > > > > --
> > > > > > Bob Powell [MVP]
> > > > > > C#, System.Drawing
> > > > > >
> > > > > > September's edition of Well Formed is now available.
> > > > > > http://www.bobpowell.net/currentissue.htm
> > > > > >
> > > > > > Answer those GDI+ questions with the GDI+ FAQ
> > > > > > http://www.bobpowell.net/gdiplus_faq.htm
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Shawn B." <le****@html.co m> wrote in message
> > > > > > news:O9******** *****@TK2MSFTNG P11.phx.gbl...
> > > > > > > Greetings,
> > > > > > >
> > > > > > > I am simulating an assembly language bit rotation in C# and it
> works
> > > > > > > wonderfully
> > > > > > >
> > > > > > > ---------
> > > > > > > ...
> > > > > > > public uint Value;
> > > > > > > ...
> > > > > > > public uint RotateRight(byt e count) {
> > > > > > > Value = ((Value >> count) | (Value << (32-count)));
> > > > > > > return Value;
> > > > > > > }
> > > > > > > ---------
> > > > > > >
> > > > > > > as long is the value is 32-bit or 64-bit (because of a
> limitation of
> > > the
> > > > > > > shift operator). I need it to work on an 8-bit or
16-bit value,
> as
> > > > > well.
> > > > > > I
> > > > > > > presume I'd have to have knowledge of the intended size
of the
> value
> > > and
> > > > > > do
> > > > > > > the shift and move the bit and the 0 or 7, or 0 or 15
bit > position
> > > and
> > > > > > clear
> > > > > > > the extra bits if there are any. That seems like a lot

of work.
> > > > > > >
> > > > > > > Is there a way to simulate an 8 or 16-bit rotate with a

32-bit
> or
> > > 64-bit
> > > > > > > value?
> > > > > > >
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Shawn
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #33
Okay, check out the new files. I removed the shift and the get/set bit
methods and they now take place without the overhead of a jump.
Thanks,
Shawn
"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:eb******** ******@TK2MSFTN GP11.phx.gbl...
Hey Shawn,

So now getting or setting bits costs an extra method call? Get used to it and remove the extra method call. :)

--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message

news:e2******** *****@TK2MSFTNG P12.phx.gbl...
I this has been completed. It works great. I would have never thought of it in this manner and yet it is so simple, I was hoping more for a Bit type of syntax but this works great. I didn't get rid of GetBit/SetBit (just
made them private) because the code that they perform doesn't "feel" right in the indexer code, just looks weird. I'll make it look "right" soon but for now...
Thanks,
Shawn
"Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
news:us******** ******@TK2MSFTN GP11.phx.gbl...
Hi Shawn,

In GetBit, SetBit or in shift operators, you don't need to check of are
shifting 0 steps, just do it anyway. It will return the
correct value.
Couldn't you have an indexer on the BinaryXX class itself?
Then you'd say,
BinaryX[0] = 1;
BinaryX[2] = BinaryX[0];

For me, that would make more sense than a separate Bit class.

public int this [int index] // Indexer declaration
{
get
{
//GetBit here
}
set
{
//SetBit here
}
}
--
Robert Jeppesen
robert.jeppesen %at%durius-dot-se
"Shawn B." <le****@html.co m> wrote in message

news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
> Robert,
>
> You're first suggestion crossed my mind, I have already started

eliminating
> the temp variables thus far (thus far only in the 8-bit operator

overloads
> region area). Just be happy you didn't see the earlier version I
first > posted, it didn't cast because I kept getting compile errors, it ran
> everything through a Convert.ToUIntX () call but I've since removed

those...
>
> I also plan to move the Shift function logic into the overload to avoid the
> extra function call.
>
> The GetBit optimization hint you provided is what I've been wanting
to do
> but didn't quite put it they way you did... I'll try that and see
how it > works. I don't know what to do about that check in it, though. I feel like
> it's necessary. Perhaps I could just make the if based on some

calculation
> and then just throw an exception at the end of the function and
avoid that
> early check, perhaps that would be a better approach. Such as (if

(Value ==
> 0 && Value < SIZE-1) {)
>
> There is one thing I need help on.
>
>
> I don't like the GetBit, SetBit approach. I would rather be able to
say x =
> BinaryX.Bit[0]; BinaryX.Bit[0] = 1; I created a Bit class that had
an > indexer but it had problems. Not the least of which was a circular
> reference that ended up being a memory leak, not what I wanted in the > innermost loop of an emulator. The second being that I could easily say x =
> x.Bit[0] but not easily say x.Bit[0] = 1.
>
> Do you have any ideas how I might approach this? I was using a
property > get/set at first but that didn't work, instead I just created a public > module variable "public Bit Bit;" and then it had a constructor to pass a
> reference of the Binary class into it so it would be able to change
the bit
> if a bit was set. Not a good approach. Do you have any ideas?
>
>
> Thanks for your help,
> Shawn
>
>
> "Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
> news:O9******** *****@TK2MSFTNG P10.phx.gbl...
> > Hi Shawn,
> >
> > I've looked at it, and no optimization suggestions other than
> > some obvious simple ones:
> >
> > public int GetBit(byte index) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > uint val = (uint)Value;
> > byte shift = (byte)(index - 1);
> > if (index == 0)
> > return (int)(val & 0x01);
> > else
> > return (int)(val >> shift) & 0x01;
> > }
> >
> > This is very verbose, and you're creating lots of temp variables
> > I'd rather write something like (untested):
> >
> > public int GetBit(byte index) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > return (int)((Value >> index-1) & 0x01;
> > }
> >
> > The check to avoid a shift probably just hurts performance anyway.
> > Also for SetBit, the two if else must result in unwanted branches:
> >
> > public void SetBit(byte index, int value) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > byte shift = index;
> > if (index == 0) {
> > if (value == 0)
> > Value &= unchecked((usho rt)~0x01);
> > else
> > Value |= 0x01;
> > }
> > else {
> > if (value == 0)
> > Value &= ((ushort)~(0x01 << shift));
> > else
> > Value |= (ushort)(0x01 << shift);
> > }
> > }
> >
> > How about this instead (also untested):
> >
> > public void SetBit(byte index, int value) {
> > if (index > (byte)SIZE-1) {
> > throw new IndexOutOfRange Exception("Bit " +
index.ToString( ) + "
> does not exist.");
> > }
> > if (value == 0)
> > Value &= ((ushort)~(0x01 << index));
> > else
> > Value |= (ushort)(0x01 << index);
> > }
> >
> > This is the only type of optimizations I came up with, so I
thought it > wasn't worth posting. :)
> >
> >
> > --
> > Robert Jeppesen
> > robert.jeppesen %at%durius-dot-se
> >
> >
> > "Shawn B." <le****@html.co m> wrote in message
> news:%2******** *******@tk2msft ngp13.phx.gbl.. .
> > > Well, I've posted it twice and no one is jumpting to optimize it... > perhaps
> > > it's just so well working that there's no need? he he
> > >
> > >
> > >
> > >
> > > Thanks,
> > > Shawn
> > >
> > > "Robert Jeppesen" <robert.jeppese n(#)durius.se> wrote in message
> > > news:Oi******** ******@TK2MSFTN GP09.phx.gbl...
> > > > Do post it here!
> > > > I'd be interested to see, as I'm sure many others would.
> > > > You'll probably get a ton of optimization hints from it. :)
> > > >
> > > >
> > > > --
> > > > Robert Jeppesen
> > > > robert.jeppesen %at%durius-dot-se
> > > >
> > > >
> > > > "Shawn B." <le****@html.co m> wrote in message
> > > news:OW******** ******@tk2msftn gp13.phx.gbl...
> > > > > Don't miss a thing, d'ya? =))
> > > > >
> > > > > I'm writing a processor Simulator for the 8-bit 6502, 8-bit

65c02,
> and
> > > the
> > > > > 16-bit 65816. In particular, I'm doing this so I can debug (I have
> the
> > > > > ability to modify the assembly language while the debugger
is > running
> > > > > (similar to VB6 and VC++ Edit-and-Continue). I can only see raw > > > > > instructions. I'm not designing it to be a particular piece of > hardware
> > > > > (such as the Apple, Atari, Commadore, etc.). I can supply it > plugins so
> > > my
> > > > > plugins can treat an area of memory as a dedicated "something" such
> as
> > > text
> > > > > display or graphics display, etc. For now, I'm concerned
not even
> with
> > > the
> > > > > text display. My end result, is actually more akin to being

able to
> > > debug
> > > > > my NES games I've been into writing lately. Also I want to
be ready
> > > with my
> > > > > own debugger for Andre LaMothe's upcoming XGameStation
console > (don't
> > > know
> > > > > whether he'll have a debugger or not) but I want a debugger that > allows
> > > me
> > > > > to change the code while it's being debugged and my simulator allows
> for
> > > it
> > > > > (as long as the source code file is available -- else if it
was > loading
> > > as a
> > > > > .bin file then it won't be editable during a debug session).
> > > > >
> > > > > So it's really more than a simulator. It's an integrated
> > > (non-seperable)
> > > > > assembly, linker, dissassembler, debugger, simulator, etc. kind of a
> > > beast.
> > > > > I chose C# because it's not the kind of thing I'd want to do
in > VB.NET
> > > (I'm
> > > > > primarly a VB.NET programmer) but didn't feel like doing it in > Managed
> > > C++
> > > > > but also wanted it to target the .NET framework (as much as is > > > reasonable
> > > > > and I'll find out what that really means when its mature enough to
> start
> > > > > using reliably).
> > > > >
> > > > > I can do a decent job emulating 1-5MHz in C# on my PIII
1000MHz CPU
> with
> > > > > GeForce II 64MB and 512MB Ram. I don't know how well it'll
do > emulating
> > > the
> > > > > 16-bit processor as I haven't deciphered the specs for the CPU yet
> (the
> > > > > 8-bit CPU is very easy compared to the 16-bit version of the
> processor).
> > > I
> > > > > ultimately will make this Interfacable so I can write a Z80

core, as
> > > well.
> > > > >
> > > > > These bit manipulations are the utmost inner-loop so I have
to make
> them
> > > > > tight. Looking at the JIT'd code for these methods seems to
be > decent
> > > but I
> > > > > have to make too many function calls (read, jumps) for my tastes but
> > > doesn't
> > > > > seem to be hurting me at the moment). Since I can't inline
in .NET,
> > > I'll
> > > > > have to live with it. Also, being an 8-bit and 16-bit CPU,
it can't
> > > > > generate the best code for the rotates and shifts because I
have to
> > > emulate
> > > > > 8-bit and 16-bit shifts and rotates. I'm also trying to
work out a
> > > better
> > > > > way for simulating memory manipulation. Now I'm creating a

string
> of
> > > (64kb
> > > > > in length) but manipulating each byte by substrings has got
to be
> > > expensive.
> > > > > I'm looking into whether a byte array would be better.
> > > > >
> > > > >
> > > > > Thanks for the help,
> > > > > if interested, I'll post my binary class here for all to
see. > > > > >
> > > > > I've completed the Rotates, Shift, converting numerics into

binary
> > > (string
> > > > > of 1's and 0's). I know now have to read the binary back to a > numeric,
> > > and
> > > > > allow a way to get/set/toggle individual bits.
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Shawn
> > > > >
> > > > >
> > > > > "Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in

message
> > > > > news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > > > > > So, you're writing an emulator for which processor??
> > > > > >
> > > > > > --
> > > > > > Bob Powell [MVP]
> > > > > > C#, System.Drawing
> > > > > >
> > > > > > September's edition of Well Formed is now available.
> > > > > > http://www.bobpowell.net/currentissue.htm
> > > > > >
> > > > > > Answer those GDI+ questions with the GDI+ FAQ
> > > > > > http://www.bobpowell.net/gdiplus_faq.htm
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Shawn B." <le****@html.co m> wrote in message
> > > > > > news:O9******** *****@TK2MSFTNG P11.phx.gbl...
> > > > > > > Greetings,
> > > > > > >
> > > > > > > I am simulating an assembly language bit rotation in C# and it
> works
> > > > > > > wonderfully
> > > > > > >
> > > > > > > ---------
> > > > > > > ...
> > > > > > > public uint Value;
> > > > > > > ...
> > > > > > > public uint RotateRight(byt e count) {
> > > > > > > Value = ((Value >> count) | (Value << (32-count)));
> > > > > > > return Value;
> > > > > > > }
> > > > > > > ---------
> > > > > > >
> > > > > > > as long is the value is 32-bit or 64-bit (because of a
> limitation of
> > > the
> > > > > > > shift operator). I need it to work on an 8-bit or
16-bit value,
> as
> > > > > well.
> > > > > > I
> > > > > > > presume I'd have to have knowledge of the intended size
of the
> value
> > > and
> > > > > > do
> > > > > > > the shift and move the bit and the 0 or 7, or 0 or 15
bit > position
> > > and
> > > > > > clear
> > > > > > > the extra bits if there are any. That seems like a lot

of work.
> > > > > > >
> > > > > > > Is there a way to simulate an 8 or 16-bit rotate with a

32-bit
> or
> > > 64-bit
> > > > > > > value?
> > > > > > >
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Shawn
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #34

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7203
by: Ramtin Kazemi | last post by:
Hi How can i perform bitwise rotation in C#?
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10543
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9323
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4422
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.