You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

newss 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. .PAGE 'NEWSS'
  2. ;*********************************
  3. ;* NEWSS: GENERATE NEW SS & FIX *
  4. ;* OLD SS'S TO REFLECT IT.*
  5. ;* VARS: *
  6. ;* REGS: *
  7. ;* *
  8. ;*********************************
  9. ;
  10. NEWSS
  11. JSR NXTTS ;GET T&S BASED ON HDR
  12. JSR DBLBUF ;USE INACTIVE BUFFER
  13. JSR SCRUB
  14. JSR GETACT
  15. PHA
  16. JSR CLRBUF
  17. LDX LINDX
  18. LDA SS,X ;SET REGS FOR TRANSFER
  19. TAY
  20. PLA
  21. TAX
  22. LDA #SSIOFF ;# OF CHARS
  23. JSR B0TOB0 ;TRANSFER AT BUF(0)
  24. ;
  25. LDA #0
  26. JSR SSDIR
  27. LDY #2
  28. LDA (DIRBUF)Y ;GET SS #
  29. PHA
  30. LDA #0
  31. JSR SETPNT
  32. PLA
  33. CLC
  34. ADC #1
  35. STA (DIRBUF)Y ;PUT SS # IN NEW SS
  36. ASL A
  37. ADC #4
  38. STA R3 ;SAVE POSITION
  39. TAY
  40. SEC
  41. SBC #2
  42. STA R4
  43. LDA TRACK
  44. STA R1 ;SAVE FOR SS UPDATE
  45. STA (DIRBUF)Y ;PUT TRACK IN SS
  46. INY
  47. LDA SECTOR
  48. STA R2 ;SAVE FOR SS UPDATE
  49. STA (DIRBUF)Y ;PUT SECTOR IN SS
  50. LDY #0
  51. TYA
  52. STA (DIRBUF)Y ;NULL LINK
  53. INY
  54. LDA #SSIOFF+1 ;PTR TO LAST BYTE
  55. STA (DIRBUF)Y
  56. ;
  57. LDA #SSIOFF
  58. JSR SETPNT
  59. JSR WRTAB
  60. JSR WATJOB
  61. ;
  62. NS20
  63. LDX LINDX
  64. LDA SS,X ;GET SS BUFFER #
  65. PHA
  66. JSR GAFLGS
  67. LDX LINDX
  68. STA SS,X ;SWAP ACT-BUF & SS
  69. PLA
  70. LDX LBUSED
  71. STA BUF0,X
  72. ;
  73. LDA #0
  74. JSR SETPNT ;SET LINK TO NEW SS
  75. LDY #0
  76. LDA TRACK
  77. STA (DIRBUF)Y
  78. INY
  79. LDA SECTOR
  80. STA (DIRBUF)Y
  81. JMP NS50
  82. NS40
  83. JSR GETACT
  84. LDX LINDX
  85. JSR IBRD ;READ NEXT SS
  86. LDA #0
  87. JSR SETPNT ;PTR=0
  88. NS50
  89. DEC R4
  90. DEC R4
  91. LDY R3 ;GET NEW SS LINK PTR
  92. LDA R1
  93. STA (DIRBUF)Y ;PUT TRACK IN
  94. INY
  95. LDA R2
  96. STA (DIRBUF)Y ;PUT SECTOR IN
  97. ;
  98. JSR WRTOUT ;WRITE IT BACK...
  99. JSR WATJOB ;...& WAIT
  100. LDY R4
  101. CPY #3
  102. BCS NS40 ;MORE SS TO UPDATE!
  103. ;
  104. JMP DBLBUF ;RESET ACTIVE BUFFER
  105. .END