Pursuing Tom Ram

Game available in Itch.io.

Soruce code in Github.

Programming adventures in VIC-20.


Checking verb and name

If previous subroutines do not found a valid verb or a valid name, it is time to print a message and ask for a new input. Here you have de code.

  
;---------------
CheckVerb
        lda verb_index
        ; If verb_index is 0 then no valid
        ; verb was found
        bne @Exit
        lda #invalid_verb
        jsr PRINT
        ; Back to ask another input
        jmp MainLoop
@Exit 
        rts


;---------------
CheckName
        ; If thee is no name, 
        ; there is nothing to check
        lda name
        beq CN_Exit 
        lda name_index
        bne CN_Exit

; Commands that needs a name comes here if
; there is no name
Wrong_Name
        lda #invalid_name
        jsr PRINT
        jmp MainLoop
CN_Exit 
        rts