home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 11 / 011.d81 / varprint.src < prev    next >
Text File  |  2022-08-26  |  3KB  |  165 lines

  1. *=49662
  2. .word 49664
  3. ;
  4. ;      variable display
  5. ;
  6. ;  written by alan w. gardner
  7. ;          03/28/84
  8. ;
  9. ;aided and ebited by jimmy weiler
  10. ;
  11. ;
  12. ; ********************************
  13. ; *                              *
  14. ; *  simple variable display     *
  15. ; *                              *
  16. ; * sys 49664 - display the      *
  17. ; *             current value    *
  18. ; *             of all simple    *
  19. ; *             variables.       *
  20. ; *                              *
  21. ; ********************************
  22. ;
  23. ;
  24. chkout=$ffc9
  25. chrout=$ffd2
  26. tofac=$bba2
  27. outfac=$bdd7
  28. intprint=$bdcd
  29. sv=252
  30. sa=254
  31. ;
  32. ;
  33. ;
  34.  ldx #$04 : jsr chkout
  35. ;
  36.  lda $002d : sta 252 : sta lovar
  37.  lda $002e : sta 253 : sta hivar
  38.  lda $002f : sta 254 : sta loaray
  39.  lda $0030 : sta 255 : sta hiaray
  40. ;
  41. begin
  42.  lda 252 : sta losave
  43.  lda 253 : sta hisave
  44. ;
  45. ;
  46.  if hisave > hiaray then jmp exit
  47.  if hisave < hiaray then jmp aroun
  48.  if losave >= loaray then jmp exit
  49. ;
  50. aroun
  51.  ldy #$00
  52.  lda (sv),y : sta first : iny
  53.  lda (sv),y : sta second
  54. ;
  55.  if second < 128 then jmp regular
  56.  if first > 128 then jmp integer
  57.  if first < 128 then jmp string
  58. ;
  59. regular
  60.  lda first : jsr chrout
  61.  lda second : jsr chrout
  62.  lda #61 : jsr chrout
  63.  let ty = 3
  64.  jmp start
  65. ;
  66. integer
  67.  let first = first - 128
  68.  let second = second - 128
  69.  lda first : jsr chrout
  70.  lda second : jsr chrout
  71.  lda #37 : jsr chrout
  72.  lda #61 : jsr chrout
  73.  let ty = 1
  74.  jmp start
  75. ;
  76. string
  77.  let second = second - 128
  78.  lda first : jsr chrout
  79.  lda second : jsr chrout
  80.  lda #36 : jsr chrout
  81.  lda #61 : jsr chrout
  82.  lda #34 : jsr chrout
  83.  let ty = 2
  84.  jmp start
  85. ;
  86. ;
  87. start
  88.  if ty = 1 then jsr dointer
  89.  if ty = 2 then jsr dostring
  90.  if ty = 3 then jsr doreals
  91. ;
  92.  lda #13 : jsr chrout
  93.  let ty = 0
  94.  lda 252 : ldy 253 : clc
  95.  adc #$07 : bcc adddown
  96.  iny
  97. adddown
  98.  sta 252 : sty 253
  99.  jmp begin
  100. ;
  101. ;
  102. dointer
  103.  ldy #$02 : lda (sv),y : sta 251
  104.  iny : lda (sv),y : sta 250
  105.  lda 251 : sta check
  106. ;
  107. ;   this code is for negative ints
  108. ;
  109.  if check < 128 then jmp gitdown
  110.  lda #45 : jsr chrout
  111.  lda #$ff : eor 250 : sta 250
  112.  lda #$ff : eor 251 : sta 251
  113.  lda 250 : clc : adc #01 : sta 250
  114.  bcc gitdown
  115.  inc 251
  116. ;
  117. ;    end of negative integers
  118. ;
  119. gitdown
  120.  lda 251 : ldx 250 : jsr intprint
  121. ;
  122.  rts
  123. ;
  124. ;
  125. dostring
  126.  ldy #$02
  127.  lda (sv),y : sta len
  128.  iny
  129.  lda (sv),y : sta lobyte
  130.  iny
  131.  lda (sv),y : sta hibyte
  132. ;
  133.  lda lobyte : sta 250
  134.  lda hibyte : sta 251
  135.  ldy #$00
  136. doagin
  137.  lda (250),y : sta char
  138.  lda #255 : sta 212
  139.  lda char
  140.  jsr chrout
  141.  iny
  142.  cpy len : bne doagin
  143.  lda #34 : jsr chrout
  144.  rts
  145. ;
  146. ;
  147. doreals
  148.  lda sv : ldy sv+1 : clc
  149.  adc #$02 : bcc dosnagain
  150.  iny
  151. dosnagain
  152.  jsr tofac
  153.  ldy #01
  154.  jsr outfac
  155.  rts
  156. ;
  157. exit
  158.  lda lovar : sta $002d
  159.  lda hivar : sta $002e
  160.  rts
  161. ;
  162. ;
  163.  dim lovar , hivar , loaray , hiaray , first , second , ty
  164.  dim lobyte , hibyte , len , losave , hisave , char , check
  165.  
  166.  
  167.  
  168.