home *** CD-ROM | disk | FTP | other *** search
- ;echo.asm
- ;========================
- ; Command: echo on/off
- ; echo string
- ;========================
-
- int04 = $1704
- int05 = $1705
- int0e = $170e
- echo = $1beb ;echo status (BMI=on)
- primm = $ff7d
- chrout = $ffd2
-
- star = $0b00
- .wor star
- * = star
-
- jmp Echo
- dw Date
-
- Echo ldx #1 ;get parameter 1
- jsr int04 ;is it there?
- bcc e0 ;ok. do it
- jsr primm ;otherwise print echo status
- .asc "echo is ",0
- bit echo
- bpl eoff ;its off
- jsr primm
- .asc "on",13,0
- lda #1 ;return echo status as the errorlevel
- jmp int0e
-
- eoff jsr primm
- .asc "off",13,0
- ex0 lda #0
- jmp int0e
-
- e0 cmp #"o" ;on or off?
- beq eo ;ok. toggle echo
- e1 cmp #34 ;otherwise just echo whats there...but ignore quotes
- beq e2
- jsr chrout
- e2 jsr int05
- cmp #0
- bne e1
- lda #13
- jsr chrout
- e11 jmp ex0
-
- e00 pha
- lda #"o"
- jsr chrout
- pla
- jmp e1
-
- eo jsr int05 ;check for on or off
- cmp #0
- bne eoeo
- lda #"o"
- jsr chrout
- jmp e11
- eoeo cmp #"n"
- beq mbon ;possibly echo on
- cmp #"f"
- bne e00 ;neither
- jsr int05
- cmp #"f"
- beq mboff
- pha
- jsr primm
- .asc "of", 0
- eoo pla
- jmp e1
-
- mboff jsr int05
- cmp #0
- beq setoff
- pha
- jsr primm
- .asc "off", 0
- jmp eoo
-
- mbon jsr int05
- cmp #0
- beq seton
- pha
- jsr primm
- .asc "on", 0
- jmp eoo
-
- seton lda #$ff
- .byt $2c
- setoff lda #0
- sta echo
- jmp ex0
-
- .end
-