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.

lccfmt3.src 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. .page 'lcc.fmt3'
  2. ;
  3. ;
  4. ;
  5. ;* format done, now verify it
  6. ;
  7. ;
  8. ;
  9. lda #200 ; look at 200 syncs
  10. sta trys
  11. ;
  12. comp lda #0 ; pointer into headers
  13. sta bufpnt
  14. ;
  15. lda #>buff0 ;
  16. sta bufpnt+1
  17. ;
  18. lda sectr ; sector counter
  19. sta sect
  20. ;
  21. cmpr10 jsr sync ; find sync
  22. ;
  23. ldx #10
  24. ldy #0
  25. ;
  26. cmpr15 bvc * ; get header byte
  27. clv
  28. ;
  29. lda data2
  30. cmp (bufpnt),y ; compare gcr
  31. ;
  32. bne cmpr20 ; error
  33. ;
  34. iny
  35. dex
  36. bne cmpr15 ; test all bytes
  37. ;
  38. clc ; update headr pointer
  39. lda bufpnt
  40. adc #10
  41. sta bufpnt
  42. ;
  43. jmp tstdat ; now test data
  44. ;
  45. cmpr20 dec trys ; test if too many errors
  46. bne comp
  47. ;
  48. lda #notfnd ; too many error
  49. jmp fmterr
  50. ;
  51. tstdat jsr sync ; find data sync
  52. ;
  53. ldy #256-topwrt ;
  54. ;
  55. tst05 bvc *
  56. clv
  57. ;
  58. lda data2 ; compare gcr
  59. cmp ovrbuf,y
  60. ;
  61. bne cmpr20 ; error
  62. ;
  63. iny
  64. bne tst05 ; do all ovrbuf
  65. ;
  66. ldx #255-3 ; now do buffer, dont test off bytes
  67. ;
  68. tst10 bvc *
  69. clv
  70. ;
  71. lda data2
  72. cmp buff2,y
  73. bne cmpr20
  74. ;
  75. iny
  76. dex
  77. bne tst10
  78. ;
  79. ;
  80. dec sect ; more sectors to test?
  81. bne cmpr10 ; yes
  82. ;
  83. ;
  84. ; all sectors done ok
  85. ;
  86. inc ftnum ; goto next track
  87. lda ftnum
  88. cmp #36 ; #tracks max
  89. bcs fmtend
  90. ;
  91. jmp end ; more to do
  92. ;
  93. ;
  94. fmtend lda #$ff ; clear ftnum
  95. sta ftnum
  96. ;
  97. lda #$0 ; clear gcr buffer flag
  98. sta gcrflg
  99. ;
  100. lda #1 ; return ok code
  101. jmp errr
  102. ;
  103. ;
  104. ;
  105. ;.end