Prev: AF90 Up: Map Next: AFB7
AF9F: Parser: Validate Two Direct Objects
Used by the routines at Action_Throw and Action_Place.
Output
F The zero flag is set when the command has two valid direct objects
F The carry flag is set when the command is malformed
Parser_ValidateTwoDirectObjects AF9F CALL Parser_ValidateDirectObject Call Parser_ValidateDirectObject.
AFA2 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.
AFA3 CP $01 Jump to ValidateTwoDirectObjects if the number of valid direct objects in the user input is not 01.
AFA5 JR NZ,ValidateTwoDirectObjects
There is only one valid direct objects in the user input and the command needs two...
Print "Please be more specific.".
AFA7 CALL Response_PleaseBeMoreSpecific Call Response_PleaseBeMoreSpecific.
AFAA SCF Set the carry flag.
AFAB RET Return.
There are two or more valid direct objects in the user input.
ValidateTwoDirectObjects AFAC CP $03 Jump to ValidateTwoDirectObjects_TooMany if the number of valid direct objects in the user input is greater than or equal to 03.
AFAE JR NC,ValidateTwoDirectObjects_TooMany
AFB0 AND A Set zero flag.
AFB1 RET Return.
There are more than two valid direct objects in the user input.
Print "Please rephrase that.".
ValidateTwoDirectObjects_TooMany AFB2 CALL Response_PleaseRephraseThat Call Response_PleaseRephraseThat.
AFB5 SCF Set the carry flag.
AFB6 RET Return.
View the equivalent code in The Jewels Of Babylon.
Prev: AF90 Up: Map Next: AFB7