home *** CD-ROM | disk | FTP | other *** search
- ;val.asm
- ;-------------------------------------------------
- ; user installable command: val number number ...
- ;-------------------------------------------------
-
- poker = $0016
- pntr = $00ec
- int11 = $1711
- int0e = $170e
- prtchr = $c003
- prtlin = $8e32
- hexa = $b8c2
- chrout = $ffd2
- clrchn = $ffcc
-
- star = $0b00
- .wor star
- * = star
- & = star
-
- jmp val
- dw Date
-
- val lda #13
- jsr chrout
- ldx #1 ; start with %1 and work up
- stx wchval
- val2 ldx wchval ; which parameter
- jsr int11 ; evaluate constant
- bcs valx ; wasn't there
- stx value
- sta value+1
- lda #"$" ; do hex first
- jsr chrout
- lda value+1
- jsr hexa
- lda value
- jsr hexa
- lda #" "
- jsr chrout
- lda value+1
- ldx value
- jsr prtlin ; print as decimal
- lda #12
- sta pntr
- lda #"%"
- jsr chrout
- ldy #16
- lda value
- sta poker
- lda value+1
- sta poker+1
- val1 asl poker
- rol poker+1
- lda #"0"
- bcc val0
- lda #"1"
- val0 jsr chrout
- dey
- bne val1
- lda #" "
- jsr chrout
- lda value+1
- ldx $f1
- jsr prtchr
- inc pntr
- lda value
- ldx $f1
- jsr prtchr
- lda #13
- jsr chrout
- inc wchval
- jmp val2
-
- valx jmp int0e
-
- wchval .byt 0
- value .wor 0
-
- .end
-