389 Posted Topics
Re: I should have seen this problem immediately! You inserted data right in the middle of code thus data now appears to be code to the instruction pointer! Move it after a RET or JMP, since you set code and data to share the same segment! [code] int 10h ; VIDEO … | |
Re: Sort them individually, then with one loop interleave them while comparing them for matches. | |
Re: If this is a duplicate forgive me. I posted but it didn't show up! This is a mistake! It's in two places in your code! [code] // for(i = first_location; i <= last_location; i+1) for(i = first_location; i <= last_location; i++) [/code] i+1 is not an expression! Use either i++ … | |
Re: You can draw a rectangle with a certain colored background, but you don't indicate what tools you're using, what platform or anything. Nor are you posting code that you attempted! | |
Re: I think you're all missing the point. Sockets doesn't send immediately. Send Packet 5 Send Packet 8 Send Packet 7 It won't necessarily arrive as three packets 5 then 8 then 7 bytes in length. It may arrive as 2 packets 5+8=13 and 7 or 5 and 15 or a … | |
Re: No need for a case statement. Since you have an enum table and if they use the default sequencing equate 0, 1, 2, etc. then use an ASCII table lookup that matches 0 based enum to table index. You may want to put an assertion on runtime to make sure … | |
Re: You're burying your code in macros making it unreadable. The basic core of your task is the following eax is one 32-bit number ebx is another 32-bit number [code] add eax,ebx ; eax=eax+ebx ; Add with no carry two 32-bit values [/code] At this point in your learning you can … | |
Re: That looks like a homework assignment I've seen one of my kids do! | |
Re: Not that I'm aware of. Shouldn't be too hard to figure it out. It's easier to convert ASM to C then from C to Assembly! How big is the code? | |
Re: count = 0 Loop for each character if character not a <CR> count += (int)str[ index ] | |
Re: Yes. bool was added to the C++ specification in a later release. However bool is a loose specification within Visual Studio. It allows you to assign other values then bool true false. If I'm converting a program over to the current compiler I'll use something like: [code] typedef enum { … | |
Re: There are whitepapers on the subject. Check out I.E.E.E and other organization(s) publications. Comes down to vectorizing facial features found on the face and storing those vectors and searching for ratio matches among other things. Lock on the center of the eye balls. How far apart are the eyes. Eyebrows, … | |
Re: [code] CDQ Convert 32-bit Double to 64-bit Quad EDX:EAX <-- Sign extends EAX Something like this... int i = -5; long long v v = (long long) i; [/code] [code] IDIV ESI 32-bit Signed Integer Divide EAX = ESI / EAX Quotient EDX = ESI % EAX remainder [/code] | |
Re: Easy, End of File condition. Bytes may be in the buffer but an EOF occured. Make sure the last line doesn't have the EOF! Or special handling. | |
Re: here's a leg up.... [code] if (low > high) { long t = low; low = high; high = t; } range = high - low + 1; [/code] | |
Re: Huh, cool game, made me look, grrrrrrrr! There's nothing here! RATS. Fool me once, shame on you, fool me twice shame on me! | |
Re: Compare file extension? If you don't trust the file extension then you'll need to read the headers in the file, and detect if it is a valid header for that image type! | |
Re: Pawns only go forward. if they aren't in their home row, they've moved! if that's a problem, put a move counter on them. If count=0, they haven't moved. Even a bit will do the job! | |
Re: [code] FILE *sp; //STR* sp; sp = fopen("SAMPLE.DAT", "rb"); [/code] don't forget when you return from fun() [code] if (NULL != sp) { fun( sp, x ); fclose(sp); } [/code] Also you did an ferror() when there was no error! Do a NULL check before calling fun(). [code] while(x-- && … | |
Re: You appear to need unique numbers but you are generating non-unique numbers. You have a 2x4, unique numbers in the upper 2x2 and another unique set in the lower unique 2x2. So generate the top set, then the bottom set. You can shuffle four numbers 1...4 and then insert them, … | |
Re: Looks like you're trying to do a deviation of the Bresenham DDA algorithm. Is this a class assignment or a personal or work project? This is a big function. One method is to dump the assembly code generated by the compiler to get some ideas. It also looks like you're … | |
Re: Insert a standardized message header with from to fields. The server receives the message see's the Id for what client to relay the message to and resends it to that contact leaving all fields intact. The recipient sees the message sees what client it was from and replies the same … | |
Re: Something like this? [code=C] typedef float (*psraBProc)( int x ); float psraBFunc( int x ) { } int r; psraBProc psraB; float f; psraB = psraBFunc; f = psraB( r ); [/code] | |
Re: Is this your first assignment??? Letters A to Z, a to z You'll need an array to tally 26 letters. Preclear it! A loop will work. You need a string length of your buffer. You need to look at each character to get tally index. index = (int)( toupper( userwd[ … | |
Re: You didn't follow your own instructions [code] //Write the defintion of function one so that it returns the sum of x and y if x greater than y, it sholud return x mines 2 times y. int one (int x, int y) { // if (x > y) if (x … | |
Re: Are you running Visual Studio 2008 64-bit version? If so, does it actually build 32-bit versions, or only 64-bit! (As 64-bit code will not run on Win32!) | |
Re: You could create an access function and allocate an array[ size * size * SIZEOF(int) ]; And use a row,column access function. OR Use calloc( sizeof(int) * SIZE, sizeof(int) * SIZE ) | |
Re: Not really. Sounds like your problem is you need to be utilizing a nice fast SIMD based math library. Rule 1) Make sure your code is absolutely 16 byte aligned. Rule 2) If you have a 3 element vector change it to 4 and make the 4the a dummy ignore … | |
Re: else if (a==Y||y) What exactly are you trying to do? else if (a == 1 ) ??? You really need more description of what you're trying to do! R,G,Y, r,g,y aren't even initialized! | |
Re: Here's a snippet of your code reworked! Please use it as a foundation for redoing your code! And use Indentation next time! [code] //@@@ NOTE: You are using FLAT rates so integer would have been fine! No need for floating-point! //float calcuLateFee(int hoursIn,int minsIn,int hoursOut,int minsOut,float *pFees,float *pTotalTime) float calcuLateFee(int … | |
Re: You need to post code. As to binary [code=C] unsigned char b; for ( b = 0x80; b; b>>= 1) { } [/code] And of course this is an assembly language forum but where did you say that in your post? What processor? (Though you hint at it with PO … | |
Re: Wearing sandals, swim trunks, and a t-shirt with Einstein on it are big attention getters for these meetings! First impressions are everything. Even if the client dresses down like that, you don't. Business suit, professional looking folder or brief case. If you don't have a coat don't sweat it. But … | |
Re: Okay, write is kind of okay. But your read isn't. Either pass in an ASCII buffer into the function or make the buffer static. Passing in the buffer is the better solution! You may want to use better names then getData() vs writeBinaryFile(). It's actually write a binary record! get … | |
Re: [code] char* modify(char *s) { int i,j=0; static char temp[200]; for(i = 0; s[i]; i++) { if(s[i] != ' ') { temp[j] = s[i]; j++; } } temp[j] = '\0'; return temp; } [/code] | |
Re: Wow, they still teach pascal? Anyway, looks like you are trying to build an expression evaluator. In that case you should think about using recursion! Also you need an operator precedence handler. [code] 3*4+2 3[_] 3[*] _ 3[*]4 (3[*]4)+_ (3[*]4)+2 [/code] Essentially you build an expression tree. Each node has … | |
Re: One to see how arguments are passed into an application. myapp 8 4 They want you to write your missing functions. So prototype them and pass a 0 response just to rough them in and get a clean compile. Then start on the first function! Post your attempts and then … | |
Re: How about using bit history! [code] unsigned int nBits, b; int r; srand( time(NULL) ); nBits = 0; while (nBits != (1 << 16)-1 ) { r = rand() % 15; // 0...15 b = 1 << r; if ( b ^ nBits) // bit not set { nBits |= … | |
Re: Use indentation and line up your parenthesis. I think you'll see your problem(s) then! What maze? You have a meandering robot only meandering in one general direction! You start your robot on 0,0 but you don't prevent it from going negative! If it's at x = 0, you let it … | |
Re: I'm not fluent in Java but threads are typically pre-emptive. Higher priority threads pre-empt lower priority threads. Threads of same priority are at the mercy of the tasking system. One thought is that those three threads are same priority and as they are created, they are pushed at the front … | |
Re: I'm not exactly sure what you're trying to do but you can create your own data type. typedef unsigned char byte; byte b; | |
Re: I really don't know. MASM is a 32-bit application that should run on 64-bit windows. MASM has a powerful macro language and early versions of MASM used macro include files to build new instruction sets. So building an OBJ that can be linked to a 64-bit C application seems feasable. … | |
Re: Write a string reverse function to reverse a string from one pointer of N bytes. First reverse the entire string. Then parse the string looking for 1st last character of each word, then reverse those letters. Step to next word, reverse. Repeat. Now string is in reverse word order! | |
Re: table lookup? unsigned char Xlat[ 256 ]; unsigned char in, out; out = xlat[ in ]; make sure input is unsigned as it is 8-bit, and a negative number will reference outside the array! | |
Re: If on an 8086, you can use BCD. A single byte will contain two digits, one in the lower nibble and one in the upper nibble. Post your code for review! | |
Re: Show your code. | |
| |
Re: Simple word problem. Just like math change your word problem into a mathematical expression. Each animal has its own X,Y on a graph, so you'll need to enter each coordinate by keyboard. You know... dog > mongoose > snakes > mouse ...So you know what chases what! Nobody is chasing … | |
Re: I'm not familiar with your assembler, however... What's the default for the assembler? try inserting [code] .386p model flat _TEXT segment dword public use32 'CODE' _TEXT ends _DATA segment dword public use32 'DATA' _DATA ends _BSS segment dword public use32 'BSS' _BSS ends [/code] At the top of your code! | |
Re: Write your conceptual design specification first. Then get a NDA. Raid your finanacial reserves. Then get (paid for) engineering feedback. Then write (or pay someone to write) the technical specifications, and start R&D. If you have a lot of financial reserves skip the next step, but if you want to … | |
![]() | Re: Simplest collision detection. Circle to circle for 2D. Sphere to Sphere for 3D Radius of sphere???? (r) Radius of Sphere A = rA Radius of Sphere B = rB Center position of Sphere A = vA Center position of Sphere B = vB You mentioned a circle, but for 2D … |
The End.