ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
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.
 
 
 
 
 
 

77 lines
1.7 KiB

  1. rem Purpose: convert 6 character (CMS/MVS) debug output to text
  2. rem Author: Howard Wulf, AF5NE
  3. rem Date: 2015-04-22
  4. rem Usage: implementation defined
  5. rem Example:
  6. rem ~/bwbasic six2text.bas
  7. rem
  8. line input " six input file name:", A$
  9. A = len( A$ )
  10. line input "text output file name:", B$
  11. B = len( B$)
  12. REM line input " six lookup file name:", C$
  13. C$ = "bwd_six.h"
  14. C = len( C$ )
  15. D$ = "#define "
  16. D = len( D$ )
  17. X$ = "X"
  18. X = len( X$ )
  19. Z$ = ""
  20. Z = 0
  21. rem Open files
  22. open A$ for input as #1
  23. open B$ for output as #2
  24. open C$ for input as #3
  25. rem For Each line in the six debug output
  26. do until eof( #1 )
  27. line input #1, A$
  28. rem A$ = "X123456"
  29. rem print A$
  30. Z = Z + 1
  31. print "line #"; Z
  32. A$ = trim$( A$ )
  33. A = len( A$ )
  34. rem default the output
  35. B$ = A$
  36. if A = 6 and left$( A$, X ) = X$ then
  37. rem A$ = "X123456"
  38. rem Search "bwd_six.h" for a line that looks like "#define ... X123456"
  39. seek #3, 1
  40. do until eof( #3 )
  41. line input #3, C$
  42. C$ = trim$( C$ )
  43. C = len( C$ )
  44. if left$( C$, D ) = D$ and right$( C$, A ) = A$ then
  45. rem C$ = "#define ... X123456"
  46. rem print C$
  47. B$ = mid$( C$, D, C - D - A )
  48. B$ = trim$( B$ )
  49. rem FOUND
  50. exit do
  51. end if
  52. loop
  53. end if
  54. print #2, B$
  55. loop
  56. rem
  57. close #1
  58. close #2
  59. close #3
  60. rem
  61. rem Variable Usage
  62. rem
  63. rem A$ Input File Name; Input Text Line
  64. rem A Length of A$
  65. rem B$ Output File Name; Output Text Line
  66. rem B Length of B$
  67. rem C$ Lookup file Name; Lookup Text Line
  68. rem C Length of C$
  69. rem D$ Constant "#define "
  70. rem D Length of D$
  71. rem X$ Constant "X"
  72. rem X Length of X$
  73. rem Z$ Not Used
  74. rem Z Line Count
  75. rem
  76. end