![]() |
| | #31 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
|
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #32 |
| verbose cat Join Date: Jun 2003
Posts: 209
| Yep, brewbuck, I'm working on it too. I have a working version but I'm trying to improve on it before I submit it.
__________________ abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments " |
| jEssYcAt is offline | |
| | #33 |
| Malum in se Join Date: Apr 2007
Posts: 3,188
| I never got a definative answer on the inline assembly. I don't code for linux, so I probably don't have time to port a solution to it at this point. Any chance you can expand it to include win32?
__________________ Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off. |
| abachler is offline | |
| | #34 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| If you write your assembly stuff in actual .asm source files, you could use NASM to assemble it, which can target both platforms. But inline assembly seems out, unless you learn the AT&T syntax, which honestly, is not that big a deal. |
| brewbuck is offline | |
| | #35 |
| Malum in se Join Date: Apr 2007
Posts: 3,188
| My intention is to write it in Visual Studio, so I guess Im out.
__________________ Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off. |
| abachler is offline | |
| | #36 |
| Dr Dipshi++ Join Date: Oct 2006 Location: On me hyperplane
Posts: 1,219
| Ok well I had a go at knocking up a quick version. Me being me I ignored the rules and made something with a graphical representation; the thought of staring at a list of co-ordinates trying to figure out what was going on would stretch my attention span a little too far. I couldent be bothered with lists either so its all done on, and limited to, a 2d array. Its very slow; O to the something horrible. If anyone else finishes this youre guaranteed to beat me ![]() I attached the source; it requires SDL. I'm not completely sure If I got it right. My little automatons dont seem to behave very interestingly off a random generated grid. Oh well. |
| mike_g is offline | |
| | #37 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| I still fail to see how you can get an inline assembly version working reliably in both 32-bit and 64-bit environment (a requirement). In fact, Visual Studio does not allow inline assembly for 64-bit targets. Thanks, mike. I'll try to give you some feedback over the weekend.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #38 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| I haven't programmed in assembler on the AMD64 platform but I was under the impression that the 32-bit instruction set is all still available. Wrong? |
| brewbuck is offline | |
| | #39 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| Not wrong, but just because the instructions are available, doesn't mean you can use all code without changes. For example, to completely dereference a double pointer, in 32 bits you do this: Code: MOV eax, DWORD PTR[somevar] ; Load variable MOV eax, DWORD PTR[eax] ; Dereference once MOV eax, DWORD PTR[eax] ; Dereference twice Code: MOV gax, QWORD PTR[somevar] ; Load variable MOV gax, QWORD PTR[gax] ; Dereference once MOV eax, DWORD PTR[gax] ; Dereference twice (get at a 32-bit int)
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #40 |
| Malum in se Join Date: Apr 2007
Posts: 3,188
| You can use inline assembly under VS 2005 and 2008 and it will compile for an x86 target, btu if you try to compile it for an x64 target , then it throws errors. Yeah lots of developers are ........ed at MS for that one, it basically makes it 10 times harder to write drivers, since now all the hardware companies have to buy additional products and convert all their existing code. Sorry , didn't mean to derail your thread, lets get back on topic now.
__________________ Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off. |
| abachler is offline | |
| | #41 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| |
| brewbuck is offline | |
| | #42 | |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| Quote:
Code: Uint8 u = (y > 0)? cells[flip][x][y-1]: 0; Uint8 d = (y < Y_CELL-1)? cells[flip][x][y+1]: 0; Uint8 l = (x > 0)? cells[flip][x-1][y]: 0; Uint8 r = (x < X_CELL-1)? cells[flip][x+1][y]: 0; switch(u+d+r+l) | |
| brewbuck is offline | |
| | #43 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| Will you be analyzing memory usage of the submissions? It might be interesting data. |
| brewbuck is offline | |
| | #44 |
| verbose cat Join Date: Jun 2003
Posts: 209
| As long as there are no penalties for horrible abuse of memory... You did say you have 8GB of Ram, right?
__________________ abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments " |
| jEssYcAt is offline | |
| | #45 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| I have one Gig on both test machines ![]() I can analyze the usage, but I won't count it. My experience with our own program is that memory usage is its own speed penalty in CPU-bound applications. Basically, our performance went down drastically when the data got too large to fit into the L2 cache. And God help you if you start swapping.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open-source Game Project | Glorfindel | Projects and Job Recruitment | 0 | 03-24-2009 01:12 AM |
| 2D RPG Online Game Project. 30% Complete. To be released and marketed. | drallstars | Projects and Job Recruitment | 2 | 10-28-2006 12:48 AM |
| C Programming 2d Array Question | jeev2005 | C Programming | 3 | 04-26-2006 03:18 PM |
| Game Of Life | din1983 | C Programming | 20 | 10-11-2005 10:36 PM |
| Please help with some coding.. | stehigs321 | C Programming | 2 | 10-27-2003 06:44 PM |