Click here to Skip to main content
15,903,203 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Sample output Pin
charlieg24-Dec-17 10:48
charlieg24-Dec-17 10:48 
GeneralRe: A highly random number generator Pin
OriginalGriff22-Dec-17 11:06
mveOriginalGriff22-Dec-17 11:06 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 11:23
CodeWraith22-Dec-17 11:23 
GeneralRe: A highly random number generator Pin
Marc Clifton22-Dec-17 12:23
mvaMarc Clifton22-Dec-17 12:23 
GeneralRe: A highly random number generator Pin
Nish Nishant22-Dec-17 12:50
sitebuilderNish Nishant22-Dec-17 12:50 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 14:42
CodeWraith22-Dec-17 14:42 
GeneralRe: A highly random number generator Pin
Marc Clifton22-Dec-17 15:20
mvaMarc Clifton22-Dec-17 15:20 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 16:59
CodeWraith22-Dec-17 16:59 
Now you have hit my nose on a potential bug!

The X register designates the stack pointer. The SEX instruction sets the value of X and this way makes one of the registers the current stack pointer. Typically this is register 2 and does not change as long as the program runs.

At the end of the little routine I restore some registers from values which I saved on the stack at the beginning. The INC R2 and LDN R2 instructions near the end assume that R2 is the stack pointer. If it's not, the registers will not be restored properly and the stack pointe will be corrupted.

INC R2 must be replaced by IRX (increment the register designated by the value of X) and LDN R2 must be replaced by LDX (load via the register designated by X). This way the code will work properly, no matter which register is currently the stack pointer.

What a dumb mistake, and I bet it will show up in even more places! That's code that has worked for many years, but obviously only because I did not do much juggling with different stack pointers.
I have lived with several Zen masters - all of them were cats.

GeneralRe: A highly random number generator Pin
Marc Clifton24-Dec-17 2:47
mvaMarc Clifton24-Dec-17 2:47 
GeneralRe: A highly random number generator Pin
Maximilien23-Dec-17 11:49
Maximilien23-Dec-17 11:49 
GeneralRe: A highly random number generator Pin
CodeWraith24-Dec-17 6:34
CodeWraith24-Dec-17 6:34 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 15:18
CodeWraith22-Dec-17 15:18 
PraiseRe: A highly random number generator Pin
kmoorevs22-Dec-17 16:34
kmoorevs22-Dec-17 16:34 
GeneralRe: A highly random number generator Pin
Bassam Abdul-Baki2-Jan-18 5:00
professionalBassam Abdul-Baki2-Jan-18 5:00 
GeneralRe: A highly random number generator Pin
Nish Nishant2-Jan-18 5:03
sitebuilderNish Nishant2-Jan-18 5:03 
GeneralRe: A highly random number generator Pin
Bassam Abdul-Baki2-Jan-18 5:18
professionalBassam Abdul-Baki2-Jan-18 5:18 
GeneralRe: A highly random number generator Pin
Nish Nishant2-Jan-18 5:19
sitebuilderNish Nishant2-Jan-18 5:19 
QuestionHas anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 7:28
sitebuilderNish Nishant22-Dec-17 7:28 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
harold aptroot22-Dec-17 7:46
harold aptroot22-Dec-17 7:46 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 7:49
sitebuilderNish Nishant22-Dec-17 7:49 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
harold aptroot22-Dec-17 8:01
harold aptroot22-Dec-17 8:01 
AnswerRe: Has anyone worked on a Core i9 CPU? Pin
Rick York22-Dec-17 9:47
mveRick York22-Dec-17 9:47 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 9:52
sitebuilderNish Nishant22-Dec-17 9:52 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Cornelius Henning22-Dec-17 10:09
professionalCornelius Henning22-Dec-17 10:09 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 10:10
sitebuilderNish Nishant22-Dec-17 10:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.