![]() |
Routines |
| Prev: 56153 | Up: Map | Next: 56311 |
|
Used by the routine at ParseATime.
Starts a number with the first number cleared, then reads the separator that follows.
|
||||
| StartParsedNumber | 56196 | XOR A | Clear the first number. | |
| 56197 | LD (56164),A | |||
|
This entry point is used by the routine at TestComma.
|
||||
| StartParsedNumber_ClearSecondThird | 56200 | XOR A | Clear the second number and the third number. | |
| 56201 | LD (56165),A | |||
| 56204 | LD (56166),A | |||
| 56207 | LD A,(HL) | Jump ahead to StartParsedNumber_TestLetterD if the character is not 'S'. | ||
| 56208 | CP 83 | |||
| 56210 | JR NZ,StartParsedNumber_TestLetterD | |||
| 56212 | LD A,B | Store the count as the second number. | ||
| 56213 | LD (56165),A | |||
| StartParsedNumber_Combine | 56216 | JR StartParsedNumber_StepPastCharacter | Jump ahead to StartParsedNumber_StepPastCharacter to combine the number. | |
|
The character 'D' stores the count as the third number.
|
||||
| StartParsedNumber_TestLetterD | 56218 | CP 68 | Jump ahead to StartParsedNumber_TestSlash if the character is not 'D'. | |
| 56220 | JR NZ,StartParsedNumber_TestSlash | |||
| 56222 | LD A,B | Store the count as the third number and jump to StartParsedNumber_Combine. | ||
| 56223 | LD (56166),A | |||
| 56226 | JR StartParsedNumber_Combine | |||
|
A slash stores the count as the second number.
|
||||
| StartParsedNumber_TestSlash | 56228 | CP 47 | Jump to ParseATime_SignalNothingMatched if the character is not '/'. | |
| 56230 | JR NZ,ParseATime_SignalNothingMatched | |||
| 56232 | LD A,B | Store the count as the second number. | ||
| 56233 | LD (56165),A | |||
| 56236 | INC HL | Jump ahead to StartParsedNumber_StepPastCharacter if the next character is '-'. | ||
| 56237 | LD A,(HL) | |||
| 56238 | CP 45 | |||
| 56240 | JR Z,StartParsedNumber_StepPastCharacter | |||
| 56242 | CALL TestDigit | Jump to ParseATime_SignalNothingMatched if this character is not a digit. | ||
| 56245 | JR C,ParseATime_SignalNothingMatched | |||
| 56247 | CALL ParseInputNumber | Read the next number, store it as the third number and continue at StartParsedNumber_CombineNumbers. | ||
| 56250 | LD (56166),A | |||
| 56253 | JR StartParsedNumber_CombineNumbers | |||
|
Steps past this character before the three numbers are combined.
|
||||
| StartParsedNumber_StepPastCharacter | 56255 | INC HL | Step to the next character. | |
|
This entry point is used by the routine at TestComma.
|
||||
| StartParsedNumber_CombineNumbers | 56256 | PUSH HL | Save the input pointer, load the first number into HL and double it. | |
| 56257 | LD A,(56164) | |||
| 56260 | LD L,A | |||
| 56261 | LD H,0 | |||
| 56263 | ADD HL,HL | |||
| 56264 | ADD HL,HL | Multiply HL by ten. | ||
| 56265 | LD E,L | |||
| 56266 | LD D,H | |||
| 56267 | ADD HL,HL | |||
| 56268 | ADD HL,HL | |||
| 56269 | ADD HL,DE | |||
| 56270 | LD A,(56165) | Add the second number and double the total. | ||
| 56273 | LD E,A | |||
| 56274 | LD D,0 | |||
| 56276 | ADD HL,DE | |||
| 56277 | ADD HL,HL | |||
| 56278 | ADD HL,HL | Multiply HL by six. | ||
| 56279 | LD E,L | |||
| 56280 | LD D,H | |||
| 56281 | ADD HL,HL | |||
| 56282 | ADD HL,DE | |||
| 56283 | LD A,(56166) | Add the third number and swap it with the saved input pointer. | ||
| 56286 | LD E,A | |||
| 56287 | LD D,0 | |||
| 56289 | ADD HL,DE | |||
| 56290 | EX (SP),HL | |||
| 56291 | POP BC | Fail through ParseATime_SignalNothingMatched if the value is 16384 or more. | ||
| 56292 | LD A,B | |||
| 56293 | CP 64 | |||
| 56295 | JP NC,ParseATime_SignalNothingMatched | |||
| 56298 | SLA C | Move bit 7 of C into B and set bit 7 of C. | ||
| 56300 | RL B | |||
| 56302 | SRL C | |||
| 56304 | SET 7,C | |||
| 56306 | SET 7,B | Set bit 7 of B and continue at ParseATime_0. | ||
| 56308 | JP ParseATime_0 | |||
| Prev: 56153 | Up: Map | Next: 56311 |