Prev: 38029 Up: Map Next: 38159
38102: Turn: Run The Action Handler
Used by the routine at Inglish_RunTheFirstNounTest.
Runs the action handler for the current object and the current action, and stores the result in the message-suppressed flag.
Turn_RunTheActionHandler 38102 PUSH IX Save IX and HL and call Turn_AcceptTheNamedObject to accept the named object.
38104 PUSH HL
38105 CALL Turn_AcceptTheNamedObject
38108 LD A,0 Take zero and jump to Turn_RunTheActionHandler_Examine_RecordTheResult if Turn_AcceptTheNamedObject returned with the zero flag set.
38110 JR Z,Turn_RunTheActionHandler_Examine_RecordTheResult
38112 LD A,(46823) Read *CurrentAction.
38115 LD IX,50992 Point IX at the action: "".
Find this id in the table at IX.
38119 CALL IndexIdTable Call IndexIdTable to look this id up in the table.
38122 CP 255 Take 1, and jump to Turn_RunTheActionHandler_Examine_RecordTheResult if IndexIdTable found the action in the table.
38124 LD A,1
38126 JR NZ,Turn_RunTheActionHandler_Examine_RecordTheResult
38128 CALL Action_MatchAVerbInTheTable Call Action_MatchAVerbInTheTable to match the action against the five verb bytes.
38131 LD A,1 Take 1, and jump to Turn_RunTheActionHandler_Examine_RecordTheResult if Action_MatchAVerbInTheTable found the action in the verb list.
38133 JR Z,Turn_RunTheActionHandler_Examine_RecordTheResult
38135 LD A,(46824) Read *CurrentObject.
Find the object's record.
38138 CALL LocateObject Call LocateObject to locate object.
38141 LD A,(46823) Read *CurrentAction.
38144 CALL TableFindAnActionRecord Call TableFindAnActionRecord to find an action record.
38147 LD A,1 Take 1, and jump to Turn_RunTheActionHandler_Examine_RecordTheResult if TableFindAnActionRecord found the action record.
38149 JR C,Turn_RunTheActionHandler_Examine_RecordTheResult
38151 SUB A Take zero.
Turn_RunTheActionHandler_Examine_RecordTheResult 38152 LD (46843),A Record in the message-suppressed flag whether this action ran.
38155 POP HL Restore HL and IX from the stack.
38156 POP IX
38158 RET Return.
Prev: 38029 Up: Map Next: 38159