![]() |
Routines |
Prev: B081 | Up: Map | Next: B09A |
|
||||||||
GenerateRandomNumber | B08A | PUSH BC | Stash BC on the stack. | |||||
B08B | LD C,A | Store the maximum number in C. | ||||||
B08C | CALL FetchFrames | Call FetchFrames. | ||||||
B08F | LD B,A | Use the frames number as a loop counter in B. | ||||||
B090 | LD A,C | Restore the maximum number value back to A. | ||||||
GenerateRandomNumber_Loop | B091 | DEC A | Decrease the maximum number value by one. | |||||
B092 | JR NZ,GenerateRandomNumber_Next | Jump to GenerateRandomNumber_Next if the maximum number value is not equal to zero. | ||||||
B094 | LD A,C | Restore the maximum number value back to A. | ||||||
GenerateRandomNumber_Next | B095 | DJNZ GenerateRandomNumber_Loop | Decrease the loop counter by one and loop back to GenerateRandomNumber_Loop until the loop counter is zero. | |||||
B097 | DEC A | Decrease the maximum number value by one. | ||||||
B098 | POP BC | Restore BC from the stack. | ||||||
B099 | RET | Return. |
Prev: B081 | Up: Map | Next: B09A |