- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 7
- Posts with Upvotes
- 7
- Upvoting Members
- 5
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
I've been a computer enthusiast since 1978 and enjoy assembly programming as a hobby.
- PC Specs
- AMD 950, CDROM, 17 gig HD, 784 Ram,
150 Posted Topics
Re: I'd like to point out that these solutions are no better or worse than anyone elses, but rather a demonstration of different ways to solve the problem and still get the same result. [code][size=2]char get_letter_grade (int grade_num) { char Result; switch (grade_num / 10) { case 10: case 9: Result … | |
Re: One that I've done and called it Phrase Guess was pretty simple. Allow player to enter a phrase or sentence, pretty well anything, including a clue. Then it's redisplayed with just underscores but in a way you can tell how many words there are and number of letters in each … | |
Re: So what part do you actually need help with? Which platform? If Windows, DOS or GUI? Most importantly show something of the source as you understand it should be done | |
Re: [code]void delspace (char *Str) { int Pntr = 0; int Dest = 0; while (Str [Pntr]) { if (Str [Pntr] != ' ') Str [Dest++] = Str [Pntr]; Pntr++; } Str [Pntr] = 0; }[/code]Think in terms of how you would have to do something manually and then coding it … | |
Re: [QUOTE=guneky;598110]Hello, I tried to convert below code, but I couldn't..[/QUOTE] Actually that's not correct, you did convert it and a reasonably good job too, the only problem is it's not working as expected. 1. You only initialize AL to -1 (255 or 0FFH) once and then inside your loop it's … | |
Re: What your doing is passing the address of the proceedure to MesssageBox instead of xd [code] invoke MessageBox, NULL, addr xd, addr xd, MB_OK.[/code] It will look kid of odd those, your caption being exactly the same as text | |
Re: It is different, and yes probably has something to do with alignment, but without seeing code in its entirety and more importantly the switches your passing to GCC it's hard to say why this is happening. | |
Re: Here is [URL="http://www.penguin.cz/~literakl/intel/intel.html"]http://www.penguin.cz/~literakl/intel/intel.html[/URL] instruction set with clocks Keep in mind, in a multithreaded operating system, cycles are only realative as other concurrent processes are using CPU at same time, which will affect the throughput of application of interest. | |
Re: Depending upon the compiler, it will tell you how large these areas can be, but it's not good practice as it actually allocates that much space in your application much better to [code] arr dd 0[/code] and then use the appropriate API to allocate whatever space you need and then … | |
Re: What platform are you using, as there is a distinct way of calling interrupts through BIOS, DOS or LINUX. These calling conventions allow you to access hardware directly (BIOS) or near directly (DOS). Windows just won't allow you to do it at all. This page deliniates how to use [URL="http://www.bookcase.com/library/dos/ints/int10.html"]INT … | |
Re: Example 1: You've declared single byte, whereas word declares 2[code]array1 dw 4 dup(?)[/code] Example 2: is correct. In both cases you are declaring space in uninialized space and has no effect of executable size. If however you used [B]dup (0)[/B] you'd wind up with an executable of 20k bytes. | |
| |
Re: [code] .data V1 dd 24 V2 dd 37 V3 dd 123 V4 dd 18 V5 dd -1 [COLOR="Red"] -(( 24 + 37 ) - 123) + ( 37 - 18 ) ( 61 - 123) + 19 -(-62) + 19 62 + 19 = 81[/COLOR] .code Start: mov eax, V2 … | |
Re: Q1: Assuming your using MASM [code] PUBLIC Str1 .const Str1 db 'Backward', 0[/code] Then in all other modules you would use[code] extern Str1:DWORD[/code]so the linker will resolve the global context Q2: Eventhough some assembers have "switch" macros, there isn't a switch statement in assembly. It is accomplished by testing and … | |
Re: What part needs to be in assembly? Is the array necessary? Calculation to consider interations other than 4? Where does test1 through 4 come from? Post the details of the assignment as they were given to you by the instructor | |
Re: Look for any handlers you have in your app relative to non-client area such as WM_NCLBUTTONDOWN or UP. | |
Re: Show an example of what you've done so far | |
Re: You don't need line 18 or line 25 as getenv only takes one argument, that being a string pointer. I generally like using kernel32 library functions and in this case may work for you [B]GetEnvironmentVariable[/B] The GetEnvironmentVariable function retrieves the value of the specified variable from the environment block of … | |
This procedure dispatches application defined event handlers and alternately executes default process for both standard or sub/super classed windows. Map is defined as follows. In most cases I define this table in .data, but in can be in .const also. I choose writeable memory as application can redefine characteristics. [code] … | |
I use GetTickCount in a lot of my applications, so I built this snippet to convert to hours minutes and seconds. Leading extraneous data is excluded from output. | |
User can enter an ascii string of up to 48 characters consisting of 1's or 0's, with randomly interspersed whitespace. IE: [B]1011111001011110 [/B]will be evaulated equally to [B][1011][111....cc001cccx01 111hhhh0 [/B]Algorithm parses from right to left so will be truncated at 16 position Purpose is to give all those still programming … | |
There are numerous calls to Win32 API that return detailed information as to failure via GetLastError (). I've devised a method by which to get the textual information corresponding to error and the address of the call that caused the violation. If GetLastError () returns null, then it can serve … | |
Additional features will be added to this section of code such as fixing window size proportial to monitors resolution and subclassing the single edit control of this program. You'll notice I don't call ShowWindow here as WS_VISIBLE in windows style is defined. | |
I've often wondered why M$ didn't make creating a window a simple as registering a class in that only one 32 bit value need be passed to calling routine. Although this is not ground breaking code design it does facilitate calling code only set EBX to point to all values … | |
I prefer to use this method as it doesn't clutter a windows procedure with dozens of conditionals and it address my primary objective of coding as tight as possible [28 bytes]. If you think my method can be improved upon in size and/or speed please post your solution. Note: I … | |
The next few posts will be what's required to get a window to display on the monitor. The code between Main & Pump will probably change as time goes on, but for now this is all that is required. I choose this method or placement because only 28 bytes of … | |
These are a pair of routine I use quite often. I know MemSet is virtualy the same as ZeroMemory in kernel32.dll, but there may be a time I want to use these in an embedded system where this dll won't be avaliable. | |
As part of a larger hobby project that I'm undertaking being a doubly linked list for 95/98/XP, this is the first in a series that I will be posting. Upon completion, I will have a complete application written in assembly for the Windows platform. Compiled with NASM | |
Re: I am curious as to which compiler you used to create the executable. In know with VC++, not typecasting WindowProcedure will cause and error. Secondly, why MS$ has done this I'll never know, but not adding 1 to the desired background color will yeild the wrong color. I must use … | |
Re: I'm not sure how similar ADODC is to DAO, but this is what I've used in the command buttons click event [code] Dim Sql as String Sql = "SELECT * FROM Table WHERE Str = '" & txtInputBox & "'" Set Rs = Db.OpenRecordset (Sql) [/code] Table, txtInputBox are my … | |
Re: There is a file called LIMITS.H that has all the values you are looking for. | |
Re: [COLOR="Green"]Here is my version of FizzBuss and it took me 2 1/2 hrs. I've read these little blurbs about how this is used to test potential programmers and in fact the overall method only took me 20 seconds to determine, but utilizing instructions that are availiable in later CPU's took … | |
Re: [QUOTE=Daveza;694879]please help me quickly as you can i need it before sunday Thanks you Before[/QUOTE] Oh, Oh, panic homework assignment. I don't understand what relevance word and sentence limits have in so much as the reversal algorithm and can there be more than one sentence in the string. AND... are … | |
Re: You are not that far off the mark functionally with what you have, although I wouldn't really consider this a stopwatch program but rather a difference calculator with mulitple outputs. For example to get start and stop times I would use [code] cout << "Press Enter to Start:" time (&StartTime); … | |
Re: You can also let 'c','p' & 't' fall through to 'g' [QUOTE=superjacent;483639] [code="C++"] switch (ch) { case 'c': case 'p': case 't': case 'g': cout << "Option '" << ch << "' selected\n"; break; default : cout << msg; cin.clear(); while (cin.get() != '\n') continue; invalid = true; } [/code][/QUOTE] | |
Re: Visualization is probably one of the best methods to comprehension. Invoke DEBUG and then step through the program one instruction at a time and just observe what's going on. OLLYBUG is even better as it lets you visualize registers memory and opcodes in a cleaner fashion | |
Re: [code=asm] Outer: inc eax call Writeint push ecx mov ecx, 3 Inner: inc eax call Writeint loop Inner pop ecx loop Outer[/code] Your not very specific with iterators, so I assume you want to loop 3 times inner for every outer. If not, you just have to change the value … | |
Re: Your question if far to arbitrary to give a concise answer and google will give you lots of links to examples. | |
Re: masm32.com has all the resources you need to get started | |
Re: Maybe consider writing a small boot loader and use BIOS calls instead. Most of the functionality you need is provided by any of the PC BIOS's. That way you are completely independent of any operating system including DOS. As your project develops, then inevitably you can get rid of any … | |
Re: [QUOTE=roxanne14;486704] I've gotten it to output in address format[/QUOTE] Your computer must run quite a bit different than mine then. Once you've entered your string[code]char word [80]; cin >> word;[/code]or whatever size you think you need, then just cycle through all the characters changing [b]#[/b] to carriage returns and anything … | |
How would I declare a pointer to MINMAXINFO that is passed to WPARAM In WM_GETMINMAXINFO wParam is a pointer to a place on the stack that holds MINMAXINFO. I've tried[code]MINMAXINFO *Info; Info = MINMAXINFO *wParam;[/code]and several other variations to no avail. Thanks | |
Re: Based on your example and because you have variable length records SCASB is your best option [code=asm]mov edi, Emp1 mov al, '$' xor ecx, ecx dec ecx repnz scasb[/code] Now you are pointing to the numeric values and you just have to add 8 to edi to point to the … | |
Re: Actually what you want is someone to do your homework not help with a specific problem. I can think of three places where you could find this exact answer, but I think you should at least make a feeble attempt at googling anyway. | |
Re: Looks like formatting asm code isn't liked very well. Anyway this is my two bits worth and I've enclosed the executable as a ZIP. Just rename HW.ZIP as HW.EXE and it will work fine. Is anyone interested in modifying this app so "Hello World", shows as 3D text inside a … | |
Re: try[code=asm]invoke RegOpenKeyEx HKEY_LOCAL_MACHINE, ADDR szRegSubKey, NULL, KEY_ALL_ACCESS, ADDR hKey)[/code] | |
Re: Assuming EAX is already null [code=asm]or ah, 7 or al, 8a[/code]would give you that result ROL SAL SHL and instructions to do bitwise shifts either left in this case or right using ROR RAR SHR. Knowing the instruction set goes a long way to becoming an effective assembly programmer | |
Re: _printf is not resolved until linked, therefore you have to make the complier aware of this. [code=asm] extern _printf[/code] I haven't had any success using standard "C" libraires so I use wsprintf which is part of kernel32.lib | |
Re: It appears there are two ways you can do this. (1) I assume CodeWarrior is on a different computer, so after compiling/assembling your code create a flat binary file and this can be read through the serial port using TwinPeeks or (2) Emit machine language listing and enter it directly … |
The End.