Try this: 1. Set count to 0 2, Shift value right 3. if carry flag set increment count 4. if value is non-zero, go back to step 2 Tom Almy Tualatin, Oregon USA ...
That's what I said. BTW, don't let on that this is for a course or people will get really rude, tell you to read the book, and complain that they aren't...
No, there is a fundamental difference -- your algorithm (and Angel Castillo's) iterate 16 times, while mine only iterates while the value is non-zero. I'm also...
Ah, clever, I like the != 0 trick. You must be from Oregon. Did you notice the bug in the Spanish code? A ... Andrei Chichak Systems Developer CBF Systems Inc....
I am trying to understand how assembly is translated into machine code. I understand how to get the machine coding formats but I'm not sure how to calculate...
rr=F3 in dbne has most significant bit set, which means rr displacement is negative, F3 = -0D. 13 bytes from Again label to location after dbne (swi ...
The inc instruction is 3 bytes. Yes, rr = F3 for the dbne instruction is correct. A formula which might help: PCnew = PCbranch + len(branch) + rr Or learn to...
Hi, I can usually muddle through on debugging issues but I can't figure this one out and would appreciate it if anyone has seen something similar and can offer...
No, rr is relative to the address of instruction (or address of the first byte of instruction) that follows immediately after dbne. If we add label ... Next ...
Hello all, I am hoping someone has some incite as to what I am doing wrong here, I figure it is a small problem but I am out of ideas. This is just a test to...
zach.r.long@...
Oct 26, 2009 8:26 pm
16507
Probably malloc didn't succeed char* outData =(char*) malloc (sizeof (char*)* 5); // make room for 5 char BTW comment is wrong, should be make room for 5...
... Both points are good. Furthermore, for this series of processors or smaller and generally in embedded systems, avoid malloc and free. These smaller...
I agree that malloc failed and it is passing back 0 to indicate that it failed, and you are using that as an address of your string. Please have some empathy...
Thanks everyone, your comments on not using malloc make sense for this system, however I am still left with the issue of incorrect output, and the thought of...
zach.r.long@...
Oct 28, 2009 1:39 am
16511
Zach, The code for the serial port looks OK, although for production code it would benefit from a code review. SCI_OutStatus(1); // Is it clear to send (buffer...
Okay, let's take a look at the output and the evidence and make some wild ass guesses. You can assume that SCI_OutString is okay since 1) the "Hello World" ...
As stated by others it is folly to use malloc/free in simple embedded systems. The best solution is to implement asynchronous static ring buffers for rx/tx...
... There is no harm to use pointers and arrays and no damage results from doing so. They are equivalent - the only time a problem will occur is when a...
... You say "probably cause all kinds of damage". Before anyone here thinks that's a really bad thing and it means they are doing something wrong, perhaps you...
... This struck me as particularly strange since I've been mixing pointers and arrays since 1980 (when I first used C) and have never caused any kind of...
Hmm, for some reason I'm not getting about half of the posts here in my inbox, including this one I discovered by going to the yahoo site. ... His program: ldx...
... Technically "Hello World" mixes an array used with printf which takes a pointer. ... Agree. ... Yes. I might not be wrong to say it's always more...
I'm using and HCS12 with icc12 compiler. I'm using SCI1 to communicate to a touch screen LCD. This program loads the LCD GUI. When I try loading the program...
Hi, Below, the vector interrupt table I use for DP256... Note the address I put it is 0xff80, not 0xef80... I use ICC12 too, and it run OK for interrupt. When...