Click here to Skip to main content
14,383,633 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 11:48
membercharlieg24-Dec-17 11:48 
GeneralRe: A highly random number generator Pin
OriginalGriff22-Dec-17 12:06
protectorOriginalGriff22-Dec-17 12:06 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 12:23
memberCodeWraith22-Dec-17 12:23 
GeneralRe: A highly random number generator Pin
Marc Clifton22-Dec-17 13:23
protectorMarc Clifton22-Dec-17 13:23 
GeneralRe: A highly random number generator Pin
Nish Nishant22-Dec-17 13:50
sitebuilderNish Nishant22-Dec-17 13:50 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 15:42
memberCodeWraith22-Dec-17 15:42 
GeneralRe: A highly random number generator Pin
Marc Clifton22-Dec-17 16:20
protectorMarc Clifton22-Dec-17 16:20 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 17:59
memberCodeWraith22-Dec-17 17: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 3:47
protectorMarc Clifton24-Dec-17 3:47 
GeneralRe: A highly random number generator Pin
Maximilien23-Dec-17 12:49
memberMaximilien23-Dec-17 12:49 
GeneralRe: A highly random number generator Pin
CodeWraith24-Dec-17 7:34
memberCodeWraith24-Dec-17 7:34 
GeneralRe: A highly random number generator Pin
CodeWraith22-Dec-17 16:18
memberCodeWraith22-Dec-17 16:18 
PraiseRe: A highly random number generator Pin
kmoorevs22-Dec-17 17:34
memberkmoorevs22-Dec-17 17:34 
GeneralRe: A highly random number generator Pin
Bassam Abdul-Baki2-Jan-18 6:00
professionalBassam Abdul-Baki2-Jan-18 6:00 
GeneralRe: A highly random number generator Pin
Nish Nishant2-Jan-18 6:03
sitebuilderNish Nishant2-Jan-18 6:03 
GeneralRe: A highly random number generator Pin
Bassam Abdul-Baki2-Jan-18 6:18
professionalBassam Abdul-Baki2-Jan-18 6:18 
GeneralRe: A highly random number generator Pin
Nish Nishant2-Jan-18 6:19
sitebuilderNish Nishant2-Jan-18 6:19 
QuestionHas anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 8:28
sitebuilderNish Nishant22-Dec-17 8:28 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
harold aptroot22-Dec-17 8:46
memberharold aptroot22-Dec-17 8:46 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 8:49
sitebuilderNish Nishant22-Dec-17 8:49 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
harold aptroot22-Dec-17 9:01
memberharold aptroot22-Dec-17 9:01 
AnswerRe: Has anyone worked on a Core i9 CPU? Pin
Rick York22-Dec-17 10:47
mveRick York22-Dec-17 10:47 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 10:52
sitebuilderNish Nishant22-Dec-17 10:52 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Cornelius Henning22-Dec-17 11:09
professionalCornelius Henning22-Dec-17 11:09 
GeneralRe: Has anyone worked on a Core i9 CPU? Pin
Nish Nishant22-Dec-17 11:10
sitebuilderNish Nishant22-Dec-17 11: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.