home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 11
/
011.d81
/
varprint.src
< prev
next >
Wrap
Text File
|
2022-08-26
|
3KB
|
165 lines
*=49662
.word 49664
;
; variable display
;
; written by alan w. gardner
; 03/28/84
;
;aided and ebited by jimmy weiler
;
;
; ********************************
; * *
; * simple variable display *
; * *
; * sys 49664 - display the *
; * current value *
; * of all simple *
; * variables. *
; * *
; ********************************
;
;
chkout=$ffc9
chrout=$ffd2
tofac=$bba2
outfac=$bdd7
intprint=$bdcd
sv=252
sa=254
;
;
;
ldx #$04 : jsr chkout
;
lda $002d : sta 252 : sta lovar
lda $002e : sta 253 : sta hivar
lda $002f : sta 254 : sta loaray
lda $0030 : sta 255 : sta hiaray
;
begin
lda 252 : sta losave
lda 253 : sta hisave
;
;
if hisave > hiaray then jmp exit
if hisave < hiaray then jmp aroun
if losave >= loaray then jmp exit
;
aroun
ldy #$00
lda (sv),y : sta first : iny
lda (sv),y : sta second
;
if second < 128 then jmp regular
if first > 128 then jmp integer
if first < 128 then jmp string
;
regular
lda first : jsr chrout
lda second : jsr chrout
lda #61 : jsr chrout
let ty = 3
jmp start
;
integer
let first = first - 128
let second = second - 128
lda first : jsr chrout
lda second : jsr chrout
lda #37 : jsr chrout
lda #61 : jsr chrout
let ty = 1
jmp start
;
string
let second = second - 128
lda first : jsr chrout
lda second : jsr chrout
lda #36 : jsr chrout
lda #61 : jsr chrout
lda #34 : jsr chrout
let ty = 2
jmp start
;
;
start
if ty = 1 then jsr dointer
if ty = 2 then jsr dostring
if ty = 3 then jsr doreals
;
lda #13 : jsr chrout
let ty = 0
lda 252 : ldy 253 : clc
adc #$07 : bcc adddown
iny
adddown
sta 252 : sty 253
jmp begin
;
;
dointer
ldy #$02 : lda (sv),y : sta 251
iny : lda (sv),y : sta 250
lda 251 : sta check
;
; this code is for negative ints
;
if check < 128 then jmp gitdown
lda #45 : jsr chrout
lda #$ff : eor 250 : sta 250
lda #$ff : eor 251 : sta 251
lda 250 : clc : adc #01 : sta 250
bcc gitdown
inc 251
;
; end of negative integers
;
gitdown
lda 251 : ldx 250 : jsr intprint
;
rts
;
;
dostring
ldy #$02
lda (sv),y : sta len
iny
lda (sv),y : sta lobyte
iny
lda (sv),y : sta hibyte
;
lda lobyte : sta 250
lda hibyte : sta 251
ldy #$00
doagin
lda (250),y : sta char
lda #255 : sta 212
lda char
jsr chrout
iny
cpy len : bne doagin
lda #34 : jsr chrout
rts
;
;
doreals
lda sv : ldy sv+1 : clc
adc #$02 : bcc dosnagain
iny
dosnagain
jsr tofac
ldy #01
jsr outfac
rts
;
exit
lda lovar : sta $002d
lda hivar : sta $002e
rts
;
;
dim lovar , hivar , loaray , hiaray , first , second , ty
dim lobyte , hibyte , len , losave , hisave , char , check