lda #EmptyString sta $01 ;the empty string has been assigned to zero page pair $00 and $01 ldy #0 ldx #0 getStringLength: lda ($00),y beq Terminated iny jmp getStringLength Terminated: cpy #0 beq StringIsEmpty ;if this branch is taken, the string is empty ;otherwise, the string is not empty