Welcome to Emulationworld

Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: got it (king of answering my own questions) Reply to this message
Posted byfinaldave
Posted on01/25/05 11:56 AM



> This algorithm is used to decrease the counter by 1... I keep the rightmost
> values (the least significant bits), which, if I ignore the carry, results in
> the register decreasing by 1 at each iteration...
>
> Amazing what a small piece of paper and the Windows calculator (in scientific
> mode) can do for you. :-)
>
> Here's the breakdown:
>
> 1F = 0001 1111 = 1F
> FF = 1111 1111
> -----------------
> [download a life]
>

Not sure if this helps but since ARM is very bad as handling words and bytes, for Cyclone I went for the strategy of pushing up everything to the TOP 8 bits of the 32 bit registers and doing the sum.

e.g. to calculate 0x12 + 0x34 I would calculate 0x12000000+0x34000000

Works fine and sets all the right bits (NZVC), except when you get to SBC and ADC...


Newsdee's Love, Glory, and Discussion Boards


-
Entire Thread
Subject  Posted byPosted On
*emulating register overflow?  newsdee01/23/05 10:13 PM
.*thanks guys, very interesting insights  newsdee01/28/05 00:02 AM
..*Re: thanks guys, very interesting insights  Bart T.01/28/05 06:55 PM
.*Re: emulating register overflow?  Bart T.01/24/05 08:43 PM
.*got it (king of answering my own questions)  newsdee01/23/05 10:23 PM
...Re: got it (king of answering my own questions)  finaldave01/25/05 11:56 AM