Examine (EX) is one of the main verbs in any text adventure. It is the main source of information. The player will want to examine everything.
My EXamine subroutine (first) check if player wants to examine an object. In that case, subroutine cheeks if player carry that object and shows its description.
In other case, there is a chain of jumps to evaluate particular conditions. I will talk you about chains in the next section.
Here is a fragment of the code.
;---------
Search_CMD
; Player is in the garden'
cmp #LOC_GARDEN
bne @Next_Search_1
; LEaf is hidden
ldx #LEAF_IND
jsr Item_is_Hidden
bne @Next_Search_1
; Move LEaf to the garden
lda loc
sta obj_status,x
jsr PrintObjs
rts
@Next_Search_1
; Search symbols in the lounge
; Player is in the lounge
lda loc
cmp #LOC_LOUNGE
bne @Next_Search_2
; Player had the the dream
; Flag 1 is set
ldy #$1
jsr read_flag_y
beq @Next_Search_2 ; es cero
; You find the symbols under a carpet
; You need the buried key and the magic word
lda #str_find_symbols
jsr PRTSTR
rts