;
; File generated by cc65 v 2.15 - Git f7cdfbf
;
	.fopt		compiler,"cc65 v 2.15 - Git f7cdfbf"
	.setcpu		"6502"
	.smart		on
	.autoimport	on
	.case		on
	.debuginfo	off
	.importzp	sp, sreg, regsave, regbank
	.importzp	tmp1, tmp2, tmp3, tmp4, ptr1, ptr2, ptr3, ptr4
	.macpack	longbranch
	.import		_strchr
	.import		_strcmp
	.import		_strcpy
	.import		_strlen
	.import		_strncmp
	.import		_strncpy
	.import		_strncasecmp
	.import		_sprintf
	.import		_sscanf
	.import		_malloc
	.import		_free
	.import		__heapmemavail
	.import		_srand
	.import		_isalnum
	.import		_isalpha
	.import		_isdigit
	.import		_led_set
	.export		_basic_init
	.export		_interpret
	.export		_syntax_error
	.export		_syntax_error_msg_with_arg
	.export		_print_buffer
	.import		_acia_putc
	.import		_acia_puts
	.import		_acia_put_newline
	.import		_acia_gets
	.import		_readline
	.import		_readline_buffer
	.import		_readline_reedit
	.importzp	_interrupted
	.import		_init_builtin_variables
	.import		_find_variable
	.import		_create_variable
	.import		_delete_variable
	.import		_clear_variables
	.import		_print_all_variables
	.import		_get_string_variable_value
	.import		_get_integer_variable_value
	.importzp	_millis
	.export		_execute
	.export		_print_ready
	.export		_print_interrupted
	.export		_parse_number_expression
	.export		_parse_number_term
	.export		_parse_integer
	.export		_parse_string_expression
	.export		_parse_string
	.export		_parse_variable
	.export		_next_token
	.export		_consume_token
	.export		_skip_whitespace
	.export		_find_args
	.export		_find_keyword
	.export		_syntax_error_invalid_token
	.export		_delete_line
	.export		_create_line
	.export		_cmd_goto
	.export		_cmd_run
	.export		_cmd_led
	.export		_cmd_print
	.export		_cmd_put
	.export		_cmd_list
	.export		_cmd_new
	.export		_cmd_free
	.export		_cmd_load
	.export		_cmd_sleep
	.export		_cmd_let
	.export		_cmd_input
	.export		_cmd_seed
	.export		_cmd_if
	.export		_cmd_end
	.export		_cmd_edit
	.export		_cmd_rem
	.export		_cmd_write
	.export		_command_functions
	.export		_keywords
	.export		_parsebuf
	.export		_tmpbuf
	.export		_program
	.export		_current_line
	.export		_current_line_changed
	.export		_running
	.export		_error
	.export		_token_strings
	.export		_cmd_clear

.segment	"DATA"

_keywords:
	.addr	L001A
	.addr	L001C
	.addr	L001E
	.addr	L0020
	.addr	L0022
	.addr	L0024
	.addr	L0026
	.addr	L0028
	.addr	L002A
	.addr	L002C
	.addr	L002E
	.addr	L0030
	.addr	L0032
	.addr	L0034
	.addr	L0036
	.addr	L0038
	.addr	L003A
	.addr	L003C
	.addr	L003E
	.word	$0000
_program:
	.word	$0000
_running:
	.byte	$00
_error:
	.byte	$00
_token_strings:
	.addr	L0047
	.addr	L0049
	.addr	L004B
	.addr	L004D
	.addr	L004F
	.addr	L0051
	.addr	L0053
	.addr	L0055
	.addr	L0057
	.addr	L0059
	.addr	L005B
	.addr	L005D
	.addr	L005F
	.addr	L0061
	.addr	L0063
	.addr	L0065
	.addr	L0067
	.addr	L0069
	.addr	L006B
	.addr	L006D
	.addr	L006F

.segment	"RODATA"

_command_functions:
	.addr	_cmd_goto
	.addr	_cmd_run
	.addr	_cmd_led
	.addr	_cmd_print
	.addr	_cmd_put
	.addr	_cmd_list
	.addr	_cmd_new
	.addr	_cmd_free
	.addr	_cmd_load
	.addr	_cmd_sleep
	.addr	_cmd_let
	.addr	_cmd_input
	.addr	_cmd_seed
	.addr	_cmd_if
	.addr	_cmd_end
	.addr	_cmd_edit
	.addr	_cmd_rem
	.addr	_cmd_write
L04F4:
	.byte	$49,$6E,$76,$61,$6C,$69,$64,$20,$6E,$75,$6D,$62,$65,$72,$20,$65
	.byte	$78,$70,$72,$65,$73,$73,$69,$6F,$6E,$00
L01AB:
	.byte	$49,$6E,$76,$61,$6C,$69,$64,$20,$73,$74,$72,$69,$6E,$67,$20,$65
	.byte	$78,$70,$72,$65,$73,$73,$69,$6F,$6E,$00
L017A	:=	L04F4+0
L01C3:
	.byte	$56,$61,$72,$69,$61,$62,$6C,$65,$20,$6E,$6F,$74,$20,$66,$6F,$75
	.byte	$6E,$64,$00
L0192	:=	L01C3+0
L0369:
	.byte	$55,$6E,$6B,$6E,$6F,$77,$6E,$20,$63,$6F,$6D,$6D,$61,$6E,$64,$21
	.byte	$0A,$00
L00AD	:=	L0369+0
L0554:
	.byte	$49,$6E,$76,$61,$6C,$69,$64,$20,$61,$72,$67,$75,$6D,$65,$6E,$74
	.byte	$00
L04FC	:=	L0554+0
L0472	:=	L0554+0
L0501	:=	L0554+0
L0051:
	.byte	$73,$74,$72,$69,$6E,$67,$20,$76,$61,$72,$69,$61,$62,$6C,$65,$00
L004F:
	.byte	$6E,$75,$6D,$62,$65,$72,$20,$76,$61,$72,$69,$61,$62,$6C,$65,$00
L0432:
	.byte	$25,$75,$20,$62,$79,$74,$65,$73,$20,$66,$72,$65,$65,$2E,$0A,$00
L031D:
	.byte	$49,$6E,$76,$61,$6C,$69,$64,$20,$74,$6F,$6B,$65,$6E,$3A,$20,$00
L0540:
	.byte	$4C,$69,$6E,$65,$20,$6E,$6F,$74,$20,$66,$6F,$75,$6E,$64,$00
L041B	:=	L0540+0
L0464:
	.byte	$46,$69,$6C,$65,$20,$6E,$6F,$74,$20,$66,$6F,$75,$6E,$64,$00
L0047:
	.byte	$55,$6E,$6B,$6E,$6F,$77,$6E,$20,$74,$6F,$6B,$65,$6E,$00
L04F8:
	.byte	$45,$6E,$74,$65,$72,$20,$61,$67,$61,$69,$6E,$3A,$20,$00
L00B7:
	.byte	$49,$6E,$74,$65,$72,$72,$75,$70,$74,$65,$64,$2E,$0A,$00
L0316:
	.byte	$53,$79,$6E,$74,$61,$78,$20,$65,$72,$72,$6F,$72,$00
L043F:
	.byte	$4C,$6F,$61,$64,$69,$6E,$67,$2E,$2E,$2E,$00
L03D6:
	.byte	$25,$75,$20,$25,$73,$20,$25,$73,$0A,$00
L045D:
	.byte	$21,$4E,$4F,$54,$46,$4F,$55,$4E,$44,$00
L0536:
	.byte	$25,$75,$20,$25,$73,$20,$25,$73,$00
L028D:
	.byte	$6F,$6E,$65,$72,$72,$6F,$72,$00
L00B3:
	.byte	$52,$65,$61,$64,$79,$2E,$0A,$00
L006F	:=	L028D+0
L0442:
	.byte	$2A,$4C,$4F,$41,$44,$20,$22,$00
L026E	:=	L028D+0
L004D:
	.byte	$73,$74,$72,$69,$6E,$67,$00
L004B:
	.byte	$64,$69,$67,$69,$74,$73,$00
L044E:
	.byte	$2A,$4E,$45,$58,$54,$0A,$00
L003E:
	.byte	$77,$72,$69,$74,$65,$00
L0032:
	.byte	$69,$6E,$70,$75,$74,$00
L002C:
	.byte	$73,$6C,$65,$65,$70,$00
L0020:
	.byte	$70,$72,$69,$6E,$74,$00
L0455:
	.byte	$2A,$45,$4F,$46,$00
L003A:
	.byte	$65,$64,$69,$74,$00
L0034:
	.byte	$73,$65,$65,$64,$00
L0306:
	.byte	$25,$75,$3A,$20,$00
L0263:
	.byte	$74,$68,$65,$6E,$00
L002E:
	.byte	$68,$6F,$6D,$65,$00
L002A:
	.byte	$6C,$6F,$61,$64,$00
L0028:
	.byte	$66,$72,$65,$65,$00
L006D	:=	L0263+0
L0284	:=	L0263+0
L001A:
	.byte	$67,$6F,$74,$6F,$00
L0024:
	.byte	$6C,$69,$73,$74,$00
L0026:
	.byte	$6E,$65,$77,$00
L001E:
	.byte	$6C,$65,$64,$00
L0022	:=	L0032+2
L0030:
	.byte	$6C,$65,$74,$00
L0038:
	.byte	$65,$6E,$64,$00
L003C:
	.byte	$72,$65,$6D,$00
L047E:
	.byte	$25,$75,$6C,$00
L0377:
	.byte	$6F,$66,$66,$00
L001C:
	.byte	$72,$75,$6E,$00
L036E	:=	L04F4+23
L0409:
	.byte	$25,$75,$00
L039C:
	.byte	$25,$64,$00
L03BC	:=	L0409+0
L01EA	:=	L039C+0
L0063:
	.byte	$21,$3D,$00
L0061:
	.byte	$3D,$3D,$00
L0312	:=	L0369+15
L0447:
	.byte	$22,$0A,$00
L0036:
	.byte	$69,$66,$00
L0529	:=	L0409+0
L0085	:=	L0409+0
L006B:
	.byte	$3E,$3D,$00
L0067:
	.byte	$3C,$3D,$00
L0069:
	.byte	$3E,$00
L0053	:=	L0063+1
L0049:
	.byte	$3B,$00
L0057:
	.byte	$2D,$00
L0059:
	.byte	$2A,$00
L005B:
	.byte	$2F,$00
L005D:
	.byte	$25,$00
L005F:
	.byte	$2C,$00
L0065:
	.byte	$3C,$00
L0055:
	.byte	$2B,$00

.segment	"BSS"

_print_buffer:
	.res	41,$00
_parsebuf:
	.res	256,$00
_tmpbuf:
	.res	256,$00
_current_line:
	.res	2,$00
_current_line_changed:
	.res	1,$00

; ---------------------------------------------------------------
; void __near__ basic_init (void)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_basic_init: near

.segment	"CODE"

	jmp     _init_builtin_variables

.endproc

; ---------------------------------------------------------------
; void __near__ interpret (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_interpret: near

.segment	"CODE"

	jsr     pushax
	jsr     pushw0sp
	jsr     decsp2
	lda     #$00
	sta     _error
	sta     _current_line
	sta     _current_line+1
	sta     _running
	ldy     #$05
	jsr     ldaxysp
	jsr     _strlen
	cpx     #$00
	bne     L0557
	cmp     #$00
	beq     L0097
L0557:	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	beq     L007F
	ldy     #$07
	jsr     pushwysp
	lda     #<(L0085)
	ldx     #>(L0085)
	jsr     pushax
	lda     #$04
	jsr     leaa0sp
	jsr     pushax
	ldy     #$06
	jsr     _sscanf
	ldy     #$07
	jsr     pushwysp
	ldx     #$00
	lda     #$20
	jsr     _strchr
	ldy     #$02
	jsr     staxysp
	jsr     _skip_whitespace
	ldy     #$02
	jsr     staxysp
	ldy     #$03
	lda     (sp),y
	dey
	ora     (sp),y
	beq     L008F
	jsr     pushw0sp
	ldy     #$05
	jsr     ldaxysp
	jsr     _create_line
	jmp     incsp6
L008F:	jsr     ldax0sp
	jsr     _delete_line
	jmp     incsp6
L007F:	ldy     #$03
	jsr     ldaxysp
	jsr     _execute
L0097:	jmp     incsp6

.endproc

; ---------------------------------------------------------------
; void __near__ syntax_error (void)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_syntax_error: near

.segment	"CODE"

	lda     #<(L0316)
	ldx     #>(L0316)
	jsr     pushax
	ldx     #$00
	txa
	jmp     _syntax_error_msg_with_arg

.endproc

; ---------------------------------------------------------------
; void __near__ syntax_error_msg_with_arg (__near__ const unsigned char *, __near__ const unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_syntax_error_msg_with_arg: near

.segment	"CODE"

	jsr     pushax
	lda     #$01
	sta     _error
	lda     _current_line
	ora     _current_line+1
	beq     L0302
	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     pushax
	lda     #<(L0306)
	ldx     #>(L0306)
	jsr     pushax
	lda     _current_line
	ldx     _current_line+1
	jsr     pushw
	ldy     #$06
	jsr     _sprintf
	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     _acia_puts
L0302:	ldy     #$03
	jsr     ldaxysp
	jsr     _acia_puts
	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	beq     L030D
	jsr     ldax0sp
	jsr     _acia_puts
L030D:	lda     #<(L0312)
	ldx     #>(L0312)
	jsr     _acia_puts
	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; void __near__ execute (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_execute: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp3
	lda     #$00
	sta     _interrupted
	sta     _interrupted+1
	sta     _interrupted+2
	sta     _interrupted+3
	ldy     #$04
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$03
	jsr     staxysp
	jsr     _find_args
	jsr     stax0sp
	ldy     #$04
	jsr     ldaxysp
	jsr     _find_keyword
	ldy     #$02
	sta     (sp),y
	cmp     #$FF
	beq     L00A6
	ldx     #$00
	lda     (sp),y
	asl     a
	bcc     L0559
	inx
	clc
L0559:	adc     #<(_command_functions)
	tay
	txa
	adc     #>(_command_functions)
	tax
	tya
	jsr     pushw
	ldy     #$03
	jsr     ldaxysp
	pha
	ldy     #$00
	lda     (sp),y
	sta     jmpvec+1
	iny
	lda     (sp),y
	sta     jmpvec+2
	pla
	jsr     jmpvec
	jsr     incsp2
	jmp     incsp5
L00A6:	lda     #<(L00AD)
	ldx     #>(L00AD)
	jsr     _acia_puts
	jmp     incsp5

.endproc

; ---------------------------------------------------------------
; void __near__ print_ready (void)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_print_ready: near

.segment	"CODE"

	lda     _running
	bne     L00B0
	lda     #<(L00B3)
	ldx     #>(L00B3)
	jmp     _acia_puts
L00B0:	rts

.endproc

; ---------------------------------------------------------------
; void __near__ print_interrupted (void)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_print_interrupted: near

.segment	"CODE"

	lda     #<(L00B7)
	ldx     #>(L00B7)
	jmp     _acia_puts

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ parse_number_expression (__near__ unsigned char *, __near__ int *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_parse_number_expression: near

.segment	"CODE"

	jsr     pushax
	ldy     #$03
	jsr     ldaxysp
	jsr     _next_token
	jsr     pusha
	ldy     #$00
	lda     (sp),y
	cmp     #$02
	beq     L055F
	cmp     #$07
	beq     L055F
	cmp     #$08
	beq     L055F
	cmp     #$04
	jne     L0561
L055F:	jsr     decsp2
	ldy     #$08
	jsr     pushwysp
	ldy     #$06
	jsr     ldaxysp
	jsr     _parse_number_term
	ldy     #$05
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	jeq     L0164
L00C7:	ldy     #$06
	jsr     ldaxysp
	jsr     _next_token
	ldy     #$02
	sta     (sp),y
	cmp     #$07
	beq     L00CF
	cmp     #$08
	beq     L00CF
	cmp     #$09
	beq     L00CF
	cmp     #$0A
	beq     L00CF
	cmp     #$0B
	beq     L00CF
	cmp     #$0D
	beq     L00CF
	cmp     #$0F
	beq     L00CF
	cmp     #$10
	beq     L00CF
	cmp     #$11
	beq     L00CF
	cmp     #$12
	jne     L011A
L00CF:	ldy     #$08
	jsr     pushwysp
	ldy     #$04
	lda     (sp),y
	jsr     _consume_token
	ldy     #$05
	jsr     staxysp
	jsr     pushax
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_number_term
	ldy     #$05
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	beq     L00C7
	ldy     #$02
	lda     (sp),y
	cmp     #$07
	beq     L00EF
	cmp     #$08
	beq     L00F3
	cmp     #$09
	jeq     L00F7
	cmp     #$0A
	jeq     L00FB
	cmp     #$0B
	jeq     L00FF
	cmp     #$0D
	jeq     L0103
	cmp     #$0E
	jeq     L0107
	cmp     #$0F
	jeq     L010B
	cmp     #$10
	jeq     L010F
	cmp     #$11
	jeq     L0113
	cmp     #$12
	jeq     L0117
	jmp     L00C7
L00EF:	ldy     #$04
	jsr     ldaxysp
	jsr     pushax
	jsr     ldaxi
	sta     ptr1
	stx     ptr1+1
	ldy     #$03
	jsr     ldaxysp
	clc
	adc     ptr1
	pha
	txa
	adc     ptr1+1
	tax
	pla
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L00F3:	ldy     #$04
	jsr     ldaxysp
	jsr     pushax
	jsr     ldaxi
	sec
	ldy     #$02
	sbc     (sp),y
	pha
	txa
	iny
	sbc     (sp),y
	tax
	pla
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L00F7:	ldy     #$04
	jsr     ldaxysp
	jsr     pushax
	jsr     pushw
	ldy     #$05
	jsr     ldaxysp
	jsr     tosmulax
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L00FB:	ldy     #$04
	jsr     ldaxysp
	jsr     pushax
	jsr     pushw
	ldy     #$05
	jsr     ldaxysp
	jsr     tosdivax
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L00FF:	ldy     #$04
	jsr     ldaxysp
	jsr     pushax
	jsr     pushw
	ldy     #$05
	jsr     ldaxysp
	jsr     tosmodax
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L0103:	ldy     #$06
	jsr     pushwysp
	ldy     #$06
	jsr     ldaxysp
	jsr     ldaxi
	ldy     #$02
	cmp     (sp),y
	bne     L055A
	txa
	iny
	cmp     (sp),y
L055A:	jsr     booleq
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L0107:	ldy     #$06
	jsr     pushwysp
	ldy     #$06
	jsr     ldaxysp
	jsr     ldaxi
	ldy     #$02
	cmp     (sp),y
	bne     L055B
	txa
	iny
	cmp     (sp),y
L055B:	jsr     boolne
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L010B:	ldy     #$04
	jsr     ldaxysp
	sta     sreg
	stx     sreg+1
	ldy     #$04
	jsr     ldaxysp
	jsr     ldaxi
	ldy     #$00
	cmp     (sp),y
	txa
	iny
	sbc     (sp),y
	bvc     L055C
	eor     #$80
L055C:	asl     a
	lda     #$00
	rol     a
	dey
	sta     (sreg),y
	iny
	lda     #$00
	sta     (sreg),y
	jmp     L00C7
L010F:	ldy     #$06
	jsr     pushwysp
	ldy     #$06
	jsr     ldaxysp
	jsr     pushw
	ldy     #$05
	jsr     ldaxysp
	jsr     tosleax
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L0113:	ldy     #$06
	jsr     pushwysp
	ldy     #$06
	jsr     ldaxysp
	jsr     pushw
	ldy     #$05
	jsr     ldaxysp
	jsr     tosgtax
	ldy     #$00
	jsr     staxspidx
	jmp     L00C7
L0117:	ldy     #$04
	jsr     ldaxysp
	sta     sreg
	stx     sreg+1
	ldy     #$04
	jsr     ldaxysp
	jsr     ldaxi
	ldy     #$00
	cmp     (sp),y
	txa
	iny
	sbc     (sp),y
	bvs     L055D
	eor     #$80
L055D:	asl     a
	lda     #$00
	rol     a
	dey
	sta     (sreg),y
	iny
	lda     #$00
	sta     (sreg),y
	jmp     L00C7
L011A:	ldy     #$06
	jsr     ldaxysp
	jsr     incsp2
	jmp     incsp5
L0561:	lda     (sp),y
	cmp     #$03
	beq     L0562
	cmp     #$05
	beq     L0562
	ldx     #$00
	txa
	jmp     incsp5
L0562:	jsr     decsp2
	ldy     #$08
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_string_expression
	ldy     #$05
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	jeq     L0164
	ldy     #$06
	jsr     ldaxysp
	jsr     _next_token
	ldy     #$02
	sta     (sp),y
	cmp     #$0D
	beq     L0563
	lda     (sp),y
	cmp     #$0E
	beq     L0563
	cmp     #$0F
	beq     L0563
	cmp     #$10
	beq     L0563
	cmp     #$11
	beq     L0563
	cmp     #$12
	jne     L0564
L0563:	ldy     #$08
	jsr     pushwysp
	ldy     #$04
	lda     (sp),y
	jsr     _consume_token
	ldy     #$05
	jsr     staxysp
	lda     #<(_tmpbuf)
	ldx     #>(_tmpbuf)
	jsr     pushax
	ldy     #$03
	jsr     ldaxysp
	jsr     _strcpy
	ldy     #$08
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_string_expression
	ldy     #$05
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	jeq     L0164
	ldy     #$02
	lda     (sp),y
	cmp     #$0D
	beq     L013C
	cmp     #$0E
	beq     L0143
	cmp     #$0F
	beq     L014A
	cmp     #$10
	beq     L0150
	cmp     #$11
	jeq     L0157
	cmp     #$12
	jeq     L015E
	jmp     L013A
L013C:	ldy     #$06
	jsr     pushwysp
	lda     #<(_tmpbuf)
	ldx     #>(_tmpbuf)
	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     _strcmp
	cpx     #$00
	bne     L0141
	cmp     #$00
L0141:	jsr     booleq
	jmp     L0566
L0143:	ldy     #$06
	jsr     pushwysp
	lda     #<(_tmpbuf)
	ldx     #>(_tmpbuf)
	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     _strcmp
	cpx     #$00
	bne     L0148
	cmp     #$00
L0148:	jsr     boolne
	jmp     L0566
L014A:	ldy     #$06
	jsr     pushwysp
	lda     #<(_tmpbuf)
	ldx     #>(_tmpbuf)
	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     _strcmp
	cpx     #$80
	lda     #$00
	tax
	rol     a
	jmp     L0566
L0150:	ldy     #$06
	jsr     pushwysp
	lda     #<(_tmpbuf)
	ldx     #>(_tmpbuf)
	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     _strcmp
	cmp     #$01
	txa
	sbc     #$00
	bvc     L0155
	eor     #$80
L0155:	asl     a
	lda     #$00
	tax
	rol     a
	jmp     L0566
L0157:	ldy     #$06
	jsr     pushwysp
	lda     #<(_tmpbuf)
	ldx     #>(_tmpbuf)
	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     _strcmp
	cmp     #$01
	txa
	sbc     #$00
	bvs     L015C
	eor     #$80
L015C:	asl     a
	lda     #$00
	tax
	rol     a
	jmp     L0566
L015E:	ldy     #$06
	jsr     pushwysp
	lda     #<(_tmpbuf)
	ldx     #>(_tmpbuf)
	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     _strcmp
	txa
	jsr     boolge
L0566:	ldy     #$00
	jsr     staxspidx
L013A:	ldy     #$06
	jsr     ldaxysp
	jsr     incsp2
	jmp     incsp5
L0564:	lda     (sp),y
	jsr     _syntax_error_invalid_token
L0164:	jsr     incsp2
	ldx     #$00
	txa
	jmp     incsp5

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ parse_number_term (__near__ unsigned char *, __near__ int *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_parse_number_term: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp1
	ldy     #$04
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$03
	jsr     staxysp
	jsr     _next_token
	ldy     #$00
	sta     (sp),y
	cmp     #$02
	beq     L0567
	lda     (sp),y
	cmp     #$07
	beq     L0567
	cmp     #$08
	bne     L0569
L0567:	ldy     #$06
	jsr     pushwysp
	ldy     #$04
	jsr     ldaxysp
	jsr     _parse_integer
	ldy     #$03
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	beq     L0172
	ldy     #$04
	jsr     ldaxysp
	jmp     incsp5
L0172:	lda     #<(L017A)
	ldx     #>(L017A)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     L0195
L0569:	lda     (sp),y
	cmp     #$04
	bne     L017E
	jsr     decsp5
	ldy     #$0B
	jsr     pushwysp
	lda     #$05
	jsr     leaa0sp
	jsr     pushax
	lda     #$06
	jsr     leaa0sp
	jsr     _parse_variable
	ldy     #$08
	jsr     staxysp
	ldy     #$06
	jsr     pushwysp
	lda     #$00
	jsr     pusha
	tax
	jsr     _find_variable
	jsr     stax0sp
	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	beq     L018A
	ldy     #$09
	jsr     pushwysp
	ldy     #$03
	jsr     ldaxysp
	jsr     _get_integer_variable_value
	ldy     #$00
	jsr     staxspidx
	ldy     #$09
	jsr     ldaxysp
	jsr     incsp5
	jmp     incsp5
L018A:	lda     #<(L0192)
	ldx     #>(L0192)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jsr     incsp5
	jmp     L0195
L017E:	jsr     _syntax_error
L0195:	ldx     #$00
	txa
	jmp     incsp5

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ parse_integer (__near__ unsigned char *, __near__ int *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_parse_integer: near

.segment	"CODE"

	jsr     pushax
	ldy     #$03
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$02
	jsr     staxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2B
	beq     L056B
	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2D
	beq     L056B
	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	bne     L056B
	tax
	jmp     incsp4
L056B:	ldy     #$05
	jsr     pushwysp
	lda     #<(L01EA)
	ldx     #>(L01EA)
	jsr     pushax
	ldy     #$07
	jsr     pushwysp
	ldy     #$06
	jsr     _sscanf
L01EE:	ldy     #$02
	ldx     #$00
	lda     #$01
	jsr     addeqysp
	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	bne     L01EE
	ldy     #$03
	jsr     ldaxysp
	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ parse_string_expression (__near__ unsigned char *, __near__ __near__ unsigned char * *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_parse_string_expression: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp6
	ldy     #$09
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$08
	jsr     staxysp
	jsr     _next_token
	ldy     #$00
	sta     (sp),y
	cmp     #$03
	bne     L0570
	ldy     #$0B
	jsr     pushwysp
	lda     #<(_parsebuf)
	ldx     #>(_parsebuf)
	jsr     _parse_string
	ldy     #$08
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	beq     L01A1
	ldy     #$07
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	lda     #<(_parsebuf)
	ldy     #$00
	sta     (ptr1),y
	iny
	lda     #>(_parsebuf)
	sta     (ptr1),y
	ldy     #$09
	jsr     ldaxysp
	jmp     L0198
L01A1:	lda     #<(L01AB)
	ldx     #>(L01AB)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     L01C6
L0570:	lda     (sp),y
	cmp     #$05
	bne     L01AF
	ldy     #$0B
	jsr     pushwysp
	lda     #$06
	jsr     leaa0sp
	jsr     pushax
	lda     #$05
	jsr     leaa0sp
	jsr     _parse_variable
	ldy     #$08
	jsr     staxysp
	ldy     #$07
	jsr     pushwysp
	lda     #$01
	jsr     pusha
	ldx     #$00
	txa
	jsr     _find_variable
	ldy     #$02
	jsr     staxysp
	ldy     #$03
	lda     (sp),y
	dey
	ora     (sp),y
	beq     L01BB
	ldy     #$09
	jsr     pushwysp
	ldy     #$05
	jsr     ldaxysp
	jsr     _get_string_variable_value
	ldy     #$00
	jsr     staxspidx
	ldy     #$09
	jsr     ldaxysp
	jmp     L0198
L01BB:	lda     #<(L01C3)
	ldx     #>(L01C3)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     L01C6
L01AF:	jsr     _syntax_error
L01C6:	ldx     #$00
	txa
L0198:	ldy     #$0A
	jmp     addysp

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ parse_string (__near__ unsigned char *, __near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_parse_string: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp2
	ldy     #$05
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$04
	jsr     staxysp
	sta     ptr1
	stx     ptr1+1
	ldx     #$00
	lda     (ptr1,x)
	cmp     #$22
	bne     L0571
	ldy     #$04
	lda     #$01
	jsr     addeqysp
	ldy     #$07
	jsr     pushwysp
	ldx     #$00
	lda     #$22
	jsr     _strchr
	jsr     stax0sp
	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	beq     L01D4
	jsr     ldax0sp
	sec
	ldy     #$04
	sbc     (sp),y
	pha
	txa
	iny
	sbc     (sp),y
	tax
	pla
	jsr     pushax
	ldy     #$07
	jsr     pushwysp
	ldy     #$0B
	jsr     pushwysp
	ldy     #$05
	jsr     ldaxysp
	jsr     _strncpy
	jsr     ldax0sp
	clc
	ldy     #$04
	adc     (sp),y
	sta     ptr1
	txa
	iny
	adc     (sp),y
	sta     ptr1+1
	lda     #$00
	tay
	sta     (ptr1),y
	ldy     #$03
	jsr     ldaxysp
	jsr     incax1
	jsr     incsp2
	jmp     incsp6
L01D4:	tax
L0571:	txa
	jmp     incsp6

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ parse_variable (__near__ unsigned char *, __near__ unsigned int *, __near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_parse_variable: near

.segment	"CODE"

	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$04
	jsr     staxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isalpha
	stx     tmp1
	ora     tmp1
	jeq     L01FA
	ldy     #$05
	jsr     pushwysp
	ldy     #$07
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     staxspidx
	ldy     #$04
	lda     #$01
	jsr     addeqysp
	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isalnum
	stx     tmp1
	ora     tmp1
	beq     L0209
	ldy     #$03
	jsr     ldaxysp
	jsr     pushax
	jsr     ldaxi
	tax
	lda     #$00
	tay
	jsr     staxspidx
	ldy     #$03
	jsr     ldaxysp
	jsr     pushax
	jsr     pushw
	ldy     #$09
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldx     #$00
	lda     (ptr1,x)
	jsr     tosora0
	ldy     #$00
	jsr     staxspidx
	jmp     L0209
L0207:	ldy     #$04
	ldx     #$00
	lda     #$01
	jsr     addeqysp
L0209:	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isalnum
	stx     tmp1
	ora     tmp1
	bne     L0207
	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$24
	bne     L020D
	ldy     #$04
	ldx     #$00
	lda     #$01
	jsr     addeqysp
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	lda     #$01
	jmp     L0573
L020D:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	lda     #$00
L0573:	ldy     #$00
	sta     (ptr1),y
	ldy     #$05
	jsr     ldaxysp
	jmp     incsp6
L01FA:	tax
	jmp     incsp6

.endproc

; ---------------------------------------------------------------
; unsigned char __near__ next_token (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_next_token: near

.segment	"CODE"

	jsr     pushax
	jsr     ldax0sp
	jsr     _skip_whitespace
	jsr     stax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	beq     L027C
	ldx     #$00
	lda     #$02
	jmp     incsp2
L027C:	jsr     pushw0sp
	lda     #<(L0284)
	ldx     #>(L0284)
	jsr     pushax
	ldx     #$00
	lda     #$04
	jsr     _strncasecmp
	cpx     #$00
	bne     L0281
	cmp     #$00
	bne     L0281
	lda     #$13
	jmp     incsp2
L0281:	jsr     pushw0sp
	lda     #<(L028D)
	ldx     #>(L028D)
	jsr     pushax
	ldx     #$00
	lda     #$07
	jsr     _strncasecmp
	cpx     #$00
	bne     L028A
	cmp     #$00
	bne     L028A
	lda     #$14
	jmp     incsp2
L028A:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isalpha
	stx     tmp1
	ora     tmp1
	beq     L0293
	jmp     L0298
L0296:	ldx     #$00
	lda     #$01
	jsr     addeq0sp
L0298:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isalnum
	stx     tmp1
	ora     tmp1
	bne     L0296
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldx     #$00
	lda     (ptr1,x)
	cmp     #$24
	bne     L0574
	lda     #$05
	jmp     incsp2
L0574:	lda     #$04
	jmp     incsp2
L0293:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$22
	bne     L02A2
	ldx     #$00
	lda     #$03
	jmp     incsp2
L02A2:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	bne     L02A6
	ldx     #$00
	lda     #$01
	jsr     addeq0sp
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldx     #$00
	lda     (ptr1,x)
	cmp     #$3D
	bne     L0575
	lda     #$0D
	jmp     incsp2
L0575:	lda     #$06
	jmp     incsp2
L02A6:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3C
	bne     L02AE
	ldx     #$00
	lda     #$01
	jsr     addeq0sp
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldx     #$00
	lda     (ptr1,x)
	cmp     #$3D
	bne     L0576
	lda     #$10
	jmp     incsp2
L0576:	lda     #$0F
	jmp     incsp2
L02AE:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3E
	bne     L02B6
	ldx     #$00
	lda     #$01
	jsr     addeq0sp
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldx     #$00
	lda     (ptr1,x)
	cmp     #$3D
	bne     L0577
	lda     #$12
	jmp     incsp2
L0577:	lda     #$11
	jmp     incsp2
L02B6:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2B
	bne     L02BE
	ldx     #$00
	lda     #$07
	jmp     incsp2
L02BE:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2D
	bne     L02C2
	ldx     #$00
	lda     #$08
	jmp     incsp2
L02C2:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2A
	bne     L02C6
	ldx     #$00
	lda     #$09
	jmp     incsp2
L02C6:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2F
	bne     L02CA
	ldx     #$00
	lda     #$0A
	jmp     incsp2
L02CA:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$25
	bne     L02CE
	ldx     #$00
	lda     #$0B
	jmp     incsp2
L02CE:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2C
	bne     L02D2
	ldx     #$00
	lda     #$0C
	jmp     incsp2
L02D2:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	beq     L0578
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3B
	beq     L0578
	ldx     #$00
	txa
	jmp     incsp2
L0578:	ldx     #$00
	lda     #$01
	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ consume_token (__near__ unsigned char *, unsigned char)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_consume_token: near

.segment	"CODE"

	jsr     pusha
	ldy     #$02
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$01
	jsr     staxysp
	ldy     #$00
	lda     (sp),y
	cmp     #$06
	bne     L0584
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	jeq     L059E
L0584:	lda     (sp),y
	cmp     #$07
	bne     L0588
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2B
	beq     L059E
L0588:	lda     (sp),y
	cmp     #$08
	bne     L058C
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2D
	beq     L059E
L058C:	lda     (sp),y
	cmp     #$09
	bne     L0590
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2A
	beq     L059E
L0590:	lda     (sp),y
	cmp     #$0A
	bne     L0594
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2F
	beq     L059E
L0594:	lda     (sp),y
	cmp     #$0B
	bne     L0598
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$25
	beq     L059E
L0598:	lda     (sp),y
	cmp     #$0C
	bne     L05A0
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$2C
	bne     L05A0
L059E:	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	jmp     incsp3
L05A0:	lda     (sp),y
	cmp     #$06
	bne     L05A4
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	bne     L05A4
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	beq     L05A4
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	jmp     incsp3
L05A4:	lda     (sp),y
	cmp     #$0D
	bne     L05A8
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	bne     L05A8
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	bne     L05A8
	ldy     #$02
	jsr     ldaxysp
	jsr     incax2
	jmp     incsp3
L05A8:	lda     (sp),y
	cmp     #$0F
	bne     L05AC
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3C
	bne     L05AC
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	beq     L05AC
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	jmp     incsp3
L05AC:	lda     (sp),y
	cmp     #$10
	bne     L05B0
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3C
	bne     L05B0
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	bne     L05B0
	ldy     #$02
	jsr     ldaxysp
	jsr     incax2
	jmp     incsp3
L05B0:	lda     (sp),y
	cmp     #$11
	bne     L05B4
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3E
	bne     L05B4
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	beq     L05B4
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	jmp     incsp3
L05B4:	lda     (sp),y
	cmp     #$12
	bne     L05B8
	ldy     #$02
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3E
	bne     L05B8
	ldy     #$02
	jsr     ldaxysp
	jsr     incax1
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	cmp     #$3D
	bne     L05B8
	ldy     #$02
	jsr     ldaxysp
	jsr     incax2
	jmp     incsp3
L05B8:	lda     (sp),y
	cmp     #$13
	bne     L05BD
	ldy     #$04
	jsr     pushwysp
	lda     #<(L0263)
	ldx     #>(L0263)
	jsr     pushax
	ldx     #$00
	lda     #$04
	jsr     _strncmp
	cpx     #$00
	bne     L025F
	cmp     #$00
	bne     L025F
	ldy     #$02
	jsr     ldaxysp
	jsr     incax4
	jmp     incsp3
L025F:	ldy     #$00
L05BD:	lda     (sp),y
	cmp     #$14
	bne     L026A
	ldy     #$04
	jsr     pushwysp
	lda     #<(L026E)
	ldx     #>(L026E)
	jsr     pushax
	ldx     #$00
	lda     #$07
	jsr     _strncmp
	cpx     #$00
	bne     L026A
	cmp     #$00
	bne     L026A
	ldy     #$02
	jsr     ldaxysp
	jsr     incax7
	jmp     incsp3
L026A:	ldy     #$02
	jsr     ldaxysp
	jsr     _next_token
	jsr     _syntax_error_invalid_token
	ldx     #$00
	txa
	jmp     incsp3

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ skip_whitespace (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_skip_whitespace: near

.segment	"CODE"

	jsr     pushax
	jmp     L02DE
L05BF:	lda     #$01
	jsr     addeqysp
L02DE:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	ldx     #$00
	lda     (ptr1),y
	cmp     #$20
	beq     L05BF
	jsr     ldax0sp
	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; __near__ unsigned char * __near__ find_args (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_find_args: near

.segment	"CODE"

	jsr     pushax
	jsr     pushw0sp
	jmp     L02E6
L05C3:	jsr     addeqysp
L02E6:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	beq     L05C0
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	ldx     #$00
	lda     (ptr1),y
	cmp     #$20
	beq     L05C0
	lda     #$01
	jmp     L05C3
L05C0:	jsr     ldax0sp
	jsr     _skip_whitespace
	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; unsigned char __near__ find_keyword (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_find_keyword: near

.segment	"CODE"

	jsr     pushax
	lda     #$00
	jsr     pusha
	lda     #<(_keywords)
	ldx     #>(_keywords)
	jsr     pushax
	jmp     L02F2
L05C7:	jsr     ldaxysp
	jsr     pushw
	ldy     #$08
	jsr     pushwysp
	ldy     #$05
	jsr     ldaxysp
	jsr     ldaxi
	jsr     _strlen
	jsr     _strncasecmp
	cpx     #$00
	bne     L02F4
	cmp     #$00
	bne     L02F4
	ldy     #$02
	lda     (sp),y
	jmp     incsp5
L02F4:	ldy     #$02
	clc
	lda     #$01
	adc     (sp),y
	sta     (sp),y
	ldx     #$00
	tya
	jsr     addeq0sp
L02F2:	jsr     ldax0sp
	ldy     #$00
	sta     ptr1
	stx     ptr1+1
	lda     (ptr1),y
	iny
	ora     (ptr1),y
	bne     L05C7
	tax
	lda     #$FF
	jmp     incsp5

.endproc

; ---------------------------------------------------------------
; void __near__ syntax_error_invalid_token (unsigned char)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_syntax_error_invalid_token: near

.segment	"CODE"

	jsr     pusha
	ldx     #$00
	lda     (sp,x)
	asl     a
	bcc     L05C9
	inx
	clc
L05C9:	adc     #<(_token_strings)
	tay
	txa
	adc     #>(_token_strings)
	tax
	tya
	jsr     pushw
	lda     #<(L031D)
	ldx     #>(L031D)
	jsr     pushax
	ldy     #$03
	jsr     ldaxysp
	jsr     _syntax_error_msg_with_arg
	jmp     incsp3

.endproc

; ---------------------------------------------------------------
; void __near__ delete_line (unsigned int)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_delete_line: near

.segment	"CODE"

	jsr     pushax
	jsr     push0
	lda     _program
	ldx     _program+1
	jsr     pushax
	jmp     L0325
L0323:	jsr     ldax0sp
	jsr     ldaxi
	ldy     #$04
	cmp     (sp),y
	bne     L0327
	txa
	iny
	cmp     (sp),y
	bne     L0327
	ldy     #$03
	lda     (sp),y
	dey
	ora     (sp),y
	beq     L0329
	iny
	jsr     ldaxysp
	sta     sreg
	stx     sreg+1
	jsr     ldax0sp
	ldy     #$06
	jsr     ldaxidx
	ldy     #$05
	sta     (sreg),y
	iny
	txa
	sta     (sreg),y
	jmp     L032D
L0329:	jsr     ldax0sp
	ldy     #$06
	jsr     ldaxidx
	sta     _program
	stx     _program+1
L032D:	jsr     ldax0sp
	ldy     #$04
	jsr     ldaxidx
	jsr     _free
	jsr     ldax0sp
	jsr     _free
	jmp     incsp6
L0327:	jsr     ldax0sp
	ldy     #$02
	jsr     staxysp
	jsr     ldax0sp
	ldy     #$06
	jsr     ldaxidx
	jsr     stax0sp
L0325:	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	bne     L0323
	jmp     incsp6

.endproc

; ---------------------------------------------------------------
; void __near__ create_line (unsigned int, __near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_create_line: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp5
	ldy     #$06
	jsr     ldaxysp
	jsr     _find_args
	ldy     #$02
	jsr     staxysp
	ldy     #$06
	jsr     ldaxysp
	jsr     _find_keyword
	ldy     #$04
	sta     (sp),y
	cmp     #$FF
	jeq     L033F
	ldy     #$08
	jsr     ldaxysp
	jsr     _delete_line
	ldx     #$00
	lda     #$07
	jsr     _malloc
	jsr     stax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$08
	jsr     ldaxysp
	ldy     #$00
	sta     (ptr1),y
	iny
	txa
	sta     (ptr1),y
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$04
	lda     (sp),y
	ldy     #$02
	sta     (ptr1),y
	jsr     pushw0sp
	ldy     #$05
	jsr     ldaxysp
	jsr     _strlen
	jsr     incax1
	jsr     _malloc
	ldy     #$03
	jsr     staxspidx
	jsr     ldax0sp
	ldy     #$04
	jsr     pushwidx
	ldy     #$05
	jsr     ldaxysp
	jsr     _strcpy
	lda     _program
	ora     _program+1
	jeq     L0351
	ldy     #$0A
	jsr     pushwysp
	lda     _program
	ldx     _program+1
	jsr     ldaxi
	jsr     tosicmp
	beq     L0351
	bcc     L0351
	lda     _program
	ldx     _program+1
	jsr     pushax
	jmp     L0358
L0356:	jsr     ldax0sp
	ldy     #$06
	jsr     ldaxidx
	jsr     stax0sp
L0358:	jsr     ldax0sp
	ldy     #$05
	sta     ptr1
	stx     ptr1+1
	lda     (ptr1),y
	iny
	ora     (ptr1),y
	beq     L05CB
	ldy     #$0C
	jsr     pushwysp
	ldy     #$03
	jsr     ldaxysp
	ldy     #$06
	jsr     ldaxidx
	jsr     ldaxi
	jsr     tosicmp
	beq     L05CB
	bcs     L0356
L05CB:	ldy     #$03
	jsr     ldaxysp
	sta     sreg
	stx     sreg+1
	jsr     ldax0sp
	ldy     #$06
	jsr     ldaxidx
	ldy     #$05
	sta     (sreg),y
	iny
	txa
	sta     (sreg),y
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$03
	jsr     ldaxysp
	ldy     #$05
	sta     (ptr1),y
	iny
	txa
	sta     (ptr1),y
	jsr     incsp2
	jmp     L0367
L0351:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	lda     _program
	ldy     #$05
	sta     (ptr1),y
	iny
	lda     _program+1
	sta     (ptr1),y
	jsr     ldax0sp
	sta     _program
	stx     _program+1
	jmp     L0367
L033F:	lda     #<(L0369)
	ldx     #>(L0369)
	jsr     _acia_puts
L0367:	ldy     #$09
	jmp     addysp

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_goto (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_goto: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp4
	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	beq     L0403
	ldy     #$07
	jsr     pushwysp
	lda     #<(L0409)
	ldx     #>(L0409)
	jsr     pushax
	lda     #$06
	jsr     leaa0sp
	jsr     pushax
	ldy     #$06
	jsr     _sscanf
	lda     _program
	ldx     _program+1
	jmp     L05CE
L040E:	jsr     ldax0sp
	jsr     ldaxi
	ldy     #$02
	cmp     (sp),y
	bne     L0412
	txa
	iny
	cmp     (sp),y
	bne     L0412
	jsr     ldax0sp
	sta     _current_line
	stx     _current_line+1
	lda     #$01
	sta     _current_line_changed
	jmp     incsp6
L0412:	jsr     ldax0sp
	ldy     #$06
	jsr     ldaxidx
L05CE:	jsr     stax0sp
	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	bne     L040E
	lda     #<(L041B)
	ldx     #>(L041B)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     incsp6
L0403:	jsr     _syntax_error
	jmp     incsp6

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_run (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_run: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp1
	lda     #$00
	sta     _error
	lda     #$01
	sta     _running
	lda     _program
	sta     _current_line
	lda     _program+1
	sta     _current_line+1
	lda     #$00
	sta     _current_line_changed
	jmp     L03EC
L03EA:	lda     _interrupted+3
	ora     _interrupted+2
	ora     _interrupted+1
	ora     _interrupted+0
	beq     L03EE
	jsr     _print_interrupted
	jmp     L03EB
L03EE:	lda     _current_line
	sta     ptr1
	lda     _current_line+1
	sta     ptr1+1
	ldy     #$02
	lda     (ptr1),y
	ldy     #$00
	sta     (sp),y
	ldx     #$00
	lda     (sp),y
	asl     a
	bcc     L05D0
	inx
	clc
L05D0:	adc     #<(_command_functions)
	tay
	txa
	adc     #>(_command_functions)
	tax
	tya
	jsr     pushw
	lda     _current_line
	ldx     _current_line+1
	ldy     #$04
	jsr     ldaxidx
	pha
	ldy     #$00
	lda     (sp),y
	sta     jmpvec+1
	iny
	lda     (sp),y
	sta     jmpvec+2
	pla
	jsr     jmpvec
	jsr     incsp2
	lda     _error
	bne     L03EB
	lda     _current_line_changed
	beq     L03F8
	lda     #$00
	sta     _current_line_changed
	lda     _current_line
	ora     _current_line+1
	bne     L03EC
	jmp     L03EB
L03F8:	lda     _current_line
	ldx     _current_line+1
	ldy     #$06
	jsr     ldaxidx
	sta     _current_line
	stx     _current_line+1
L03EC:	lda     _current_line
	ora     _current_line+1
	jne     L03EA
L03EB:	jsr     _print_ready
	jmp     incsp3

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_led (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_led: near

.segment	"CODE"

	jsr     pushax
	lda     #<(L036E)
	ldx     #>(L036E)
	jsr     pushax
	ldy     #$03
	jsr     ldaxysp
	jsr     _strcmp
	cpx     #$00
	bne     L036C
	cmp     #$00
	bne     L036C
	lda     #$01
	jsr     _led_set
	jmp     incsp2
L036C:	lda     #<(L0377)
	ldx     #>(L0377)
	jsr     pushax
	ldy     #$03
	jsr     ldaxysp
	jsr     _strcmp
	cpx     #$00
	bne     L0375
	cmp     #$00
	bne     L0375
	jsr     _led_set
	jmp     incsp2
L0375:	jsr     _syntax_error
	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_print (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_print: near

.segment	"CODE"

	jsr     pushax
	jsr     ldax0sp
	jsr     _cmd_put
	lda     _error
	bne     L03B0
	jsr     _acia_put_newline
L03B0:	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_put (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_put: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp5
	jmp     L0382
L0380:	ldy     #$06
	jsr     ldaxysp
	jsr     _next_token
	ldy     #$00
	sta     (sp),y
	cmp     #$03
	beq     L05D1
	lda     (sp),y
	cmp     #$05
	bne     L05D3
L05D1:	ldy     #$08
	jsr     pushwysp
	lda     #$03
	jsr     leaa0sp
	jsr     _parse_string_expression
	ldy     #$05
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	beq     L0382
	ldy     #$02
	jsr     ldaxysp
	jsr     _acia_puts
	jmp     L0382
L05D3:	lda     (sp),y
	cmp     #$02
	beq     L05D4
	cmp     #$07
	beq     L05D4
	cmp     #$08
	beq     L05D4
	cmp     #$04
	bne     L05D6
L05D4:	ldy     #$08
	jsr     pushwysp
	lda     #$05
	jsr     leaa0sp
	jsr     _parse_number_expression
	ldy     #$05
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	beq     L0382
	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     pushax
	lda     #<(L039C)
	ldx     #>(L039C)
	jsr     pushax
	ldy     #$0A
	jsr     pushwysp
	ldy     #$06
	jsr     _sprintf
	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     _acia_puts
	jmp     L0382
L05D6:	lda     (sp),y
	cmp     #$0C
	bne     L05D8
	ldy     #$08
	jsr     pushwysp
	ldy     #$02
	lda     (sp),y
	jsr     _consume_token
	ldy     #$05
	jsr     staxysp
	jmp     L0382
L05D8:	lda     (sp),y
	cmp     #$01
	beq     L0381
	jsr     _syntax_error
	jmp     incsp7
L0382:	lda     _error
	jeq     L0380
L0381:	jmp     incsp7

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_list (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_list: near

.segment	"CODE"

	jsr     pushax
	lda     #$00
	jsr     pusha
	jsr     decsp6
	lda     #$01
	jsr     pusha
	ldy     #$09
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	beq     L03B6
	ldy     #$0B
	jsr     pushwysp
	lda     #<(L03BC)
	ldx     #>(L03BC)
	jsr     pushax
	lda     #$09
	jsr     leaa0sp
	jsr     pushax
	ldy     #$06
	jsr     _sscanf
	ldy     #$06
	jsr     ldaxysp
	ldy     #$03
	jsr     staxysp
	lda     #$01
	ldy     #$07
	sta     (sp),y
L03B6:	lda     _program
	ldx     _program+1
	jmp     L05E3
L03C5:	ldy     #$07
	lda     (sp),y
	beq     L05E2
	ldy     #$02
	jsr     ldaxysp
	jsr     ldaxi
	ldy     #$05
	cmp     (sp),y
	txa
	iny
	sbc     (sp),y
	bcc     L03C9
	ldy     #$02
	jsr     ldaxysp
	jsr     ldaxi
	sec
	ldy     #$03
	sbc     (sp),y
	sta     tmp1
	txa
	iny
	sbc     (sp),y
	ora     tmp1
	bcc     L05E2
	bne     L03C9
L05E2:	ldy     #$00
	lda     (sp),y
	beq     L03CF
	tya
	sta     (sp),y
L03CF:	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     pushax
	lda     #<(L03D6)
	ldx     #>(L03D6)
	jsr     pushax
	ldy     #$06
	jsr     ldaxysp
	jsr     pushw
	ldy     #$08
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$02
	ldx     #$00
	lda     (ptr1),y
	asl     a
	bcc     L05DC
	inx
	clc
L05DC:	adc     #<(_keywords)
	tay
	txa
	adc     #>(_keywords)
	tax
	tya
	jsr     pushw
	ldy     #$0A
	jsr     ldaxysp
	ldy     #$04
	jsr     pushwidx
	ldy     #$0A
	jsr     _sprintf
	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     _acia_puts
L03C9:	ldy     #$02
	jsr     ldaxysp
	ldy     #$06
	jsr     ldaxidx
L05E3:	ldy     #$01
	jsr     staxysp
	ldy     #$02
	lda     (sp),y
	dey
	ora     (sp),y
	jne     L03C5
	jsr     _print_ready
	ldy     #$0A
	jmp     addysp

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_new (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_new: near

.segment	"CODE"

	jsr     pushax
	lda     _program
	ldx     _program+1
	jsr     pushax
	jmp     L0424
L0422:	jsr     ldax0sp
	ldy     #$06
	jsr     pushwidx
	ldy     #$03
	jsr     ldaxysp
	ldy     #$04
	jsr     ldaxidx
	jsr     _free
	ldy     #$03
	jsr     ldaxysp
	jsr     _free
	jsr     ldax0sp
	ldy     #$02
	jsr     staxysp
	jsr     incsp2
L0424:	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	bne     L0422
	sta     _program
	sta     _program+1
	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_free (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_free: near

.segment	"CODE"

	jsr     pushax
	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     pushax
	lda     #<(L0432)
	ldx     #>(L0432)
	jsr     pushax
	jsr     __heapmemavail
	jsr     pushax
	ldy     #$06
	jsr     _sprintf
	lda     #<(_print_buffer)
	ldx     #>(_print_buffer)
	jsr     _acia_puts
	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_load (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_load: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp2
	ldy     #$05
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_string_expression
	stx     tmp1
	ora     tmp1
	jeq     L0438
	ldx     #$00
	txa
	jsr     _cmd_new
	lda     #<(L043F)
	ldx     #>(L043F)
	jsr     _acia_puts
	lda     #<(L0442)
	ldx     #>(L0442)
	jsr     _acia_puts
	jsr     ldax0sp
	jsr     _acia_puts
	lda     #<(L0447)
	ldx     #>(L0447)
	jsr     _acia_puts
L044C:	lda     #<(L044E)
	ldx     #>(L044E)
	jsr     _acia_puts
	lda     #<(_readline_buffer)
	ldx     #>(_readline_buffer)
	jsr     pushax
	lda     #$FF
	jsr     _acia_gets
	lda     #<(L0455)
	ldx     #>(L0455)
	jsr     pushax
	lda     #<(_readline_buffer)
	ldx     #>(_readline_buffer)
	jsr     pushax
	ldx     #$00
	lda     #$04
	jsr     _strncmp
	cpx     #$00
	bne     L05E4
	cmp     #$00
	beq     L044A
L05E4:	lda     #<(L045D)
	ldx     #>(L045D)
	jsr     pushax
	lda     #<(_readline_buffer)
	ldx     #>(_readline_buffer)
	jsr     pushax
	ldx     #$00
	lda     #$09
	jsr     _strncmp
	cpx     #$00
	bne     L045B
	cmp     #$00
	bne     L045B
	jsr     _acia_put_newline
	lda     #<(L0464)
	ldx     #>(L0464)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     L044A
L045B:	lda     #$2E
	jsr     _acia_putc
	lda     #<(_readline_buffer)
	ldx     #>(_readline_buffer)
	jsr     _interpret
	jmp     L044C
L044A:	lda     _error
	bne     L0470
	jsr     _acia_put_newline
	jsr     _print_ready
	jmp     incsp4
L0438:	lda     #<(L0472)
	ldx     #>(L0472)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
L0470:	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_sleep (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_sleep: near

.segment	"BSS"

L0476:
	.res	4,$00
L0477:
	.res	4,$00

.segment	"CODE"

	jsr     pushax
	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	jeq     L0478
	jsr     pushw0sp
	lda     #<(L047E)
	ldx     #>(L047E)
	jsr     pushax
	lda     #<(L0476)
	ldx     #>(L0476)
	jsr     pushax
	ldy     #$06
	jsr     _sscanf
	lda     _millis+3
	sta     sreg+1
	lda     _millis+2
	sta     sreg
	ldx     _millis+1
	lda     _millis
	jsr     pusheax
	lda     L0476+3
	sta     sreg+1
	lda     L0476+2
	sta     sreg
	ldx     L0476+1
	lda     L0476
	jsr     tosaddeax
	sta     L0477
	stx     L0477+1
	ldy     sreg
	sty     L0477+2
	ldy     sreg+1
	sty     L0477+3
	jmp     L0485
L0483:	lda     _interrupted+3
	ora     _interrupted+2
	ora     _interrupted+1
	ora     _interrupted+0
	bne     L0489
L0485:	lda     _millis+3
	sta     sreg+1
	lda     _millis+2
	sta     sreg
	ldx     _millis+1
	lda     _millis
	jsr     pusheax
	lda     L0477+3
	sta     sreg+1
	lda     L0477+2
	sta     sreg
	ldx     L0477+1
	lda     L0477
	jsr     tosulteax
	bne     L0483
	jmp     incsp2
L0478:	jsr     _syntax_error
L0489:	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_let (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_let: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp4
	ldy     #$05
	jsr     ldaxysp
	jsr     _skip_whitespace
	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	bne     L048E
	jsr     _print_all_variables
	jsr     _print_ready
	jmp     incsp6
L048E:	ldy     #$07
	jsr     pushwysp
	lda     #$03
	jsr     leaa0sp
	jsr     pushax
	lda     #$04
	jsr     leaa0sp
	jsr     _parse_variable
	ldy     #$04
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	jeq     L0492
	ldy     #$05
	jsr     ldaxysp
	jsr     _next_token
	cmp     #$06
	jne     L0498
	ldy     #$05
	jsr     ldaxysp
	jsr     _next_token
	ldy     #$03
	sta     (sp),y
	ldy     #$07
	jsr     pushwysp
	ldy     #$05
	lda     (sp),y
	jsr     _consume_token
	ldy     #$04
	jsr     staxysp
	ldy     #$00
	lda     (sp),y
	beq     L04A6
	cmp     #$01
	beq     L04B0
	jmp     incsp6
L04A6:	jsr     decsp2
	ldy     #$09
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_number_expression
	stx     tmp1
	ora     tmp1
	beq     L04A7
	ldy     #$06
	jsr     pushwysp
	ldy     #$04
	lda     (sp),y
	jsr     pusha
	lda     #$03
	jsr     leaa0sp
	jsr     _create_variable
L04A7:	jsr     incsp2
	jmp     incsp6
L04B0:	jsr     decsp2
	ldy     #$09
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_string_expression
	stx     tmp1
	ora     tmp1
	beq     L04B1
	ldy     #$06
	jsr     pushwysp
	ldy     #$04
	lda     (sp),y
	jsr     pusha
	ldy     #$04
	jsr     ldaxysp
	jsr     _create_variable
L04B1:	jsr     incsp2
	jmp     incsp6
L0498:	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	bne     L04BF
	ldy     #$04
	jsr     pushwysp
	ldy     #$02
	lda     (sp),y
	jsr     _delete_variable
	jmp     incsp6
L0492:	jsr     _syntax_error
L04BF:	jmp     incsp6

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_input (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_input: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp3
	ldy     #$06
	jsr     pushwysp
	lda     #$03
	jsr     leaa0sp
	jsr     pushax
	lda     #$04
	jsr     leaa0sp
	jsr     _parse_variable
	ldy     #$03
	jsr     staxysp
	ldy     #$04
	lda     (sp),y
	dey
	ora     (sp),y
	jeq     L04CA
	ldx     #$00
	lda     (sp,x)
	cmp     #$01
	bne     L05E6
	jsr     _readline
	jsr     pushax
	ldy     #$06
	jsr     pushwysp
	ldy     #$04
	lda     (sp),y
	jsr     pusha
	ldy     #$04
	jsr     ldaxysp
	jsr     _create_variable
	jsr     incsp2
	jmp     incsp5
L05E6:	lda     (sp,x)
	jne     L04D5
	jmp     L05E8
L05E8:	jsr     push0
	lda     #$01
	jsr     _readline
	jsr     pushax
	lda     _interrupted+3
	ora     _interrupted+2
	ora     _interrupted+1
	ora     _interrupted+0
	beq     L04DE
	jsr     incsp4
	jmp     incsp5
L04DE:	jsr     pushw0sp
	lda     #$04
	jsr     leaa0sp
	jsr     _parse_integer
	stx     tmp1
	ora     tmp1
	beq     L04E0
	ldy     #$08
	jsr     pushwysp
	ldy     #$06
	lda     (sp),y
	jsr     pusha
	lda     #$05
	jsr     leaa0sp
	jsr     _create_variable
	jsr     incsp4
	jmp     incsp5
L04E0:	ldy     #$08
	jsr     ldaxysp
	jsr     _next_token
	cmp     #$14
	bne     L04E9
	ldy     #$0A
	jsr     pushwysp
	lda     #$14
	jsr     _consume_token
	ldy     #$07
	jsr     staxysp
	jsr     _execute
	jsr     incsp4
	jmp     incsp5
L04E9:	lda     #<(L04F4)
	ldx     #>(L04F4)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	lda     #<(L04F8)
	ldx     #>(L04F8)
	jsr     _acia_puts
	jsr     incsp4
	jmp     L05E8
L04D5:	lda     #<(L04FC)
	ldx     #>(L04FC)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     incsp5
L04CA:	lda     #<(L0501)
	ldx     #>(L0501)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     incsp5

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_seed (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_seed: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp2
	ldy     #$05
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_number_expression
	stx     tmp1
	ora     tmp1
	beq     L0505
	jsr     ldax0sp
	jsr     _srand
L0505:	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_if (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_if: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp2
	ldy     #$05
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_number_expression
	ldy     #$02
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	beq     L0513
	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	beq     L0513
	ldy     #$05
	jsr     pushwysp
	lda     #$13
	jsr     _consume_token
	ldy     #$02
	jsr     staxysp
	stx     tmp1
	ora     tmp1
	beq     L0513
	ldy     #$03
	jsr     ldaxysp
	jsr     _execute
L0513:	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_end (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_end: near

.segment	"CODE"

	jsr     pushax
	lda     _current_line
	ora     _current_line+1
	bne     L051B
	jsr     _print_ready
L051B:	lda     #$00
	sta     _current_line
	sta     _current_line+1
	lda     #$01
	sta     _current_line_changed
	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_edit (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_edit: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp4
	ldy     #$05
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _isdigit
	stx     tmp1
	ora     tmp1
	jeq     L0523
	ldy     #$07
	jsr     pushwysp
	lda     #<(L0529)
	ldx     #>(L0529)
	jsr     pushax
	lda     #$06
	jsr     leaa0sp
	jsr     pushax
	ldy     #$06
	jsr     _sscanf
	lda     _program
	ldx     _program+1
	jmp     L05ED
L052E:	jsr     ldax0sp
	jsr     ldaxi
	ldy     #$02
	cmp     (sp),y
	bne     L0532
	txa
	iny
	cmp     (sp),y
	bne     L0532
	lda     #<(_readline_buffer)
	ldx     #>(_readline_buffer)
	jsr     pushax
	lda     #<(L0536)
	ldx     #>(L0536)
	jsr     pushax
	ldy     #$05
	jsr     ldaxysp
	jsr     pushw
	ldy     #$07
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$02
	ldx     #$00
	lda     (ptr1),y
	asl     a
	bcc     L05EC
	inx
	clc
L05EC:	adc     #<(_keywords)
	tay
	txa
	adc     #>(_keywords)
	tax
	tya
	jsr     pushw
	ldy     #$09
	jsr     ldaxysp
	ldy     #$04
	jsr     pushwidx
	ldy     #$0A
	jsr     _sprintf
	jsr     _readline_reedit
	jmp     incsp6
L0532:	jsr     ldax0sp
	ldy     #$06
	jsr     ldaxidx
L05ED:	jsr     stax0sp
	ldy     #$01
	lda     (sp),y
	dey
	ora     (sp),y
	bne     L052E
	lda     #<(L0540)
	ldx     #>(L0540)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
	jmp     incsp6
L0523:	jsr     _syntax_error
	jmp     incsp6

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_rem (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_rem: near

.segment	"CODE"

	jsr     pushax
	jmp     incsp2

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_write (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_write: near

.segment	"CODE"

	jsr     pushax
	jsr     decsp2
	ldy     #$05
	jsr     pushwysp
	lda     #$02
	jsr     leaa0sp
	jsr     _parse_string_expression
	stx     tmp1
	ora     tmp1
	beq     L0552
	jsr     ldax0sp
	jsr     _strlen
	cpx     #$00
	bne     L05EE
	cmp     #$00
	beq     L054B
L05EE:	jsr     ldax0sp
	sta     ptr1
	stx     ptr1+1
	ldy     #$00
	lda     (ptr1),y
	ldx     #$00
	jsr     _acia_puts
	jmp     incsp4
L054B:	lda     #<(L0554)
	ldx     #>(L0554)
	jsr     pushax
	ldx     #$00
	txa
	jsr     _syntax_error_msg_with_arg
L0552:	jmp     incsp4

.endproc

; ---------------------------------------------------------------
; void __near__ cmd_clear (__near__ unsigned char *)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_cmd_clear: near

.segment	"CODE"

	jsr     pushax
	jsr     _clear_variables
	jsr     _print_ready
	jmp     incsp2

.endproc

