Advertisement
mainframed767

CALC.EXE

Mar 20th, 2018
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.41 KB | None | 0 0
  1. CLR70 TITLE 'C L E A R - TSO' 00050000
  2. PRINT ON,DATA,GEN 00060000
  3. CLEAR CSECT 00070000
  4. * SETUP registers and save areas thanks @bigendiansmalls * 00080000
  5. MAIN STM 14,12,12(13) # Save caller reg 00090000
  6. LR 8,15 # Base register 00100000
  7. USING MAIN,8 # R8 for addressability 00110000
  8. GETMAIN RU,LV=72 # for our savearea 00120000
  9. ST 13,4(,1) # Store Caller's SA address 00130000
  10. ST 1,8(,13) # Put my SA addr in caller's SA 00140000
  11. LR 13,1 # R13 has addr of our SA 00150000
  12. DS 0H # halfword boundaries 00160000
  13. * Let the fun Begin! * 00170000
  14. * YREGS sets R0 through R15, it is in SYS1.MACLIB 00180000
  15. YREGS 00190000
  16. * GTSIZE checks your terminal and sets R0 to the screen width and R0 to 00200000
  17. * the height, also in SYS1.MACLIB 00210000
  18. GTSIZE 00220000
  19. CH R0,=H'1' # Compare R0 (total number of lines) 00230000
  20. * to 0x01 and set condition 00240000
  21. BL EXITP # If R0 is less than 0x01 exit 00250000
  22. * Now turn on Full Screen MODE. Initial means 00260000
  23. * this is the first time we're using this macro 00270000
  24. STFSMODE ON,INITIAL=YES 00280000
  25. * Set Terminal Display Manager Options 00290000
  26. * Basically we can turn on display manager and display interupt 00300000
  27. * keys. KEYS=NO is how we would do that 00310000
  28. STTMPMD ON 00320000
  29. * the rest comes from http://www.tommysprinkle.com/mvs/P3270/hello2.htm 00330000
  30. * TPUT Macro puts a data stream to TSO 00340000
  31. * to escape the buffer you must pass 0x27 00350000
  32. * FULLSCR here basically means we send 3270 stream 00360000
  33. TPUT STREAM,STREAMLN,FULLSCR 00370000
  34. * But it dissapears super fast unless we add a TGET 00380000
  35. * Which GETs input from the user 00390000
  36. TGET INBUF,INBUFLN,ASIS 00400000
  37. * And now undo the Full Screen and Display Manager 00410000
  38. STFSMODE OFF 00420000
  39. STTMPMD OFF 00430000
  40. *********************************************************************** 00440000
  41. * And we Exit 00450000
  42. *********************************************************************** 00460000
  43. EXITP LR 1,13 # Move my SA into R1 00470000
  44. L 13,4(,13) # RST Caller SA Addr 00480000
  45. FREEMAIN RU,A=(1),LV=72 00490000
  46. LM 14,12,12(13) # restore registers 00500000
  47. XR 15,15 # zero return code 00510000
  48. BCR 15,14 # Branch back to caller 00520000
  49. STREAM DS 0C 00530000
  50. DC X'27' ESCAPE TSO CHARACTER 00540000
  51. DC X'F5' ERASE/WRITE 00550000
  52. DC X'C3' WCC 00560000
  53. DC X'114040' SBA 00570000
  54. DC X'2902' SFE (Three Attribute Pairs To Follow) 00580000
  55. DC X'C0F8' ATTR #1 (BASIC = PROTECTED) 00590000
  56. DC X'42F1' ATTR #3 (COLOR = BLUE) 00600001
  57. * --------------------- 00610001
  58. * | _________________ | 00620001
  59. * | | 5318008. | | 00630004
  60. * | |_________________| | 00640001
  61. * | ___ ___ ___ ___ | 00650001
  62. * | | 7 | 8 | 9 | | + | | 00660001
  63. * | |___|___|___| |___| | 00670001
  64. * | | 4 | 5 | 6 | | - | | 00680001
  65. * | |___|___|___| |___| | 00690001
  66. * | | 1 | 2 | 3 | | x | | 00700001
  67. * | |___|___|___| |___| | 00710001
  68. * | | . | 0 | = | | / | | 00720001
  69. * | |___|___|___| |___| | 00730001
  70. * | | 00740001
  71. * --------------------- 00750001
  72. DC C' --------------------- ' 00751003
  73. DC 56X'40' 00751103
  74. DC C' | _________________ |' 00752003
  75. DC 56X'40' 00752103
  76. DC C' | | 5318008. | |' 00753004
  77. DC 56X'40' 00753103
  78. DC C' | |_________________| |' 00754003
  79. DC 56X'40' 00754103
  80. DC C' | ___ ___ ___ ___ |' 00755003
  81. DC 56X'40' 00755103
  82. DC C' | | 7 | 8 | 9 | | + | |' 00756003
  83. DC 56X'40' 00756103
  84. DC C' | |___|___|___| |___| |' 00757003
  85. DC 56X'40' 00757103
  86. DC C' | | 4 | 5 | 6 | | - | |' 00758003
  87. DC 56X'40' 00758103
  88. DC C' | |___|___|___| |___| |' 00759003
  89. DC 56X'40' 00759103
  90. DC C' | | 1 | 2 | 3 | | x | |' 00759203
  91. DC 56X'40' 00759303
  92. DC C' | |___|___|___| |___| |' 00759403
  93. DC 56X'40' 00759503
  94. DC C' | | . | 0 | = | | / | |' 00759603
  95. DC 56X'40' 00759703
  96. DC C' | |___|___|___| |___| |' 00759803
  97. DC 56X'40' 00759903
  98. DC C' | |' 00760003
  99. DC 56X'40' 00760103
  100. DC C' --------------------- ' 00760203
  101. STREAMLN EQU *-STREAM 01070000
  102. * 01080000
  103. INBUF DS XL128 01090000
  104. INBUFLN EQU *-INBUF 01100000
  105. END , 01110000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement