Prev: 44061 Up: Map Next: 44109
44079: Parser: Validate Two Direct Objects
Output
F The carry flag is set when the command is malformed
Parser_ValidateTwoDirectObjects 44079 CALL Parser_ValidateDirectObject Call Parser_ValidateDirectObject.
44082 RET C Return if there is no direct object in the user input (so the command is malformed).
A now contains the count of the number of valid direct objects.
44083 CP 1 Jump to ValidateTwoDirectObjects if the number of valid direct objects in the user input is not 1.
44085 JR NZ,ValidateTwoDirectObjects
There is only one valid direct object in the user input and the command needs two...
44087 LD HL,23 Call PrintCompressedStringAndNewline to print "Please be more specific." and start a new line.
44090 CALL PrintCompressedStringAndNewline
44093 SCF Set the carry flag; the command needs another object.
44094 RET Return.
There are two or more valid direct objects in the user input.
ValidateTwoDirectObjects 44095 CP 3 Jump to ValidateTwoDirectObjects_TooMany if the number of valid direct objects in the user input is greater than or equal to 3.
44097 JR NC,ValidateTwoDirectObjects_TooMany
44099 AND A Clear the carry flag (AND A) to signal that both objects were accepted.
44100 RET Return.
There are more than two valid direct objects in the user input.
ValidateTwoDirectObjects_TooMany 44101 LD HL,24 Call PrintCompressedStringAndNewline to print "Please rephrase that." and start a new line.
44104 CALL PrintCompressedStringAndNewline
44107 SCF Set the carry flag; there are too many objects.
44108 RET Return.
Prev: 44061 Up: Map Next: 44109