SHARE
TWEET

Untitled

a guest Sep 5th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DIM MEMORY[1024 * 64]
  2. DIM MEMORY_ADDRESS
  3. REM---------------
  4. DEF F_func3(LVAR_var0, DUMMY_PAR )
  5. DIM STACK[128]
  6. DIM TOP
  7. DIM AX
  8. DIM BX
  9. DIM DUMMY
  10. DIM PC
  11. DIM LVAR_var1
  12. DIM LVAR_var2
  13. STACK[TOP + 1] = LVAR_var0
  14. INC TOP
  15. TOP = TOP - 1
  16. DUMMY = F_strlen(STACK[ TOP + 1],  0 )
  17. INC TOP
  18. STACK[TOP] = DUMMY
  19. LVAR_var1 = STACK[TOP]
  20. DEC TOP
  21. STACK[TOP + 1] = 16
  22. INC TOP
  23. TOP = TOP - 1
  24. DUMMY = F_puts(STACK[ TOP + 1],  0 )
  25. INC TOP
  26. STACK[TOP] = DUMMY
  27. DEC TOP
  28. @BLOCK_L_label0:
  29. STACK[TOP + 1] = LVAR_var1
  30. INC TOP
  31. STACK[TOP + 1] = 1
  32. INC TOP
  33. AX = STACK[TOP]
  34. BX = STACK[TOP - 1]
  35. STACK[TOP - 1] = (AX > BX)
  36. DEC TOP
  37. DEC TOP
  38. IF (STACK[TOP + 1] != 0) THEN GOTO @END_L_label0
  39. STACK[TOP + 1] = LVAR_var1
  40. INC TOP
  41. LVAR_var2 = STACK[TOP]
  42. DEC TOP
  43. @BLOCK_L_label1:
  44. STACK[TOP + 1] = LVAR_var0
  45. INC TOP
  46. MEMORY_ADDRESS = STACK[TOP]
  47. STACK[TOP] = (MEMORY[MEMORY_ADDRESS])
  48. TOP = TOP - 1
  49. DUMMY = F_putchar(STACK[ TOP + 1],  0 )
  50. INC TOP
  51. STACK[TOP] = DUMMY
  52. DEC TOP
  53. STACK[TOP + 1] = 46
  54. INC TOP
  55. TOP = TOP - 1
  56. DUMMY = F_putchar(STACK[ TOP + 1],  0 )
  57. INC TOP
  58. STACK[TOP] = DUMMY
  59. DEC TOP
  60. STACK[TOP + 1] = LVAR_var0
  61. INC TOP
  62. STACK[TOP + 1] = 1
  63. INC TOP
  64. AX = STACK[TOP]
  65. BX = STACK[TOP - 1]
  66. STACK[TOP - 1] = AX + BX
  67. DEC TOP
  68. LVAR_var0 = STACK[TOP]
  69. DEC TOP
  70. STACK[TOP + 1] = LVAR_var2
  71. INC TOP
  72. STACK[TOP + 1] = -1
  73. INC TOP
  74. AX = STACK[TOP]
  75. BX = STACK[TOP - 1]
  76. STACK[TOP - 1] = AX + BX
  77. DEC TOP
  78. LVAR_var2 = STACK[TOP]
  79. DEC TOP
  80. IF (STACK[TOP + 1] != 0) THEN GOTO @BLOCK_L_label1
  81. @END_L_label1:
  82. @END_L_label0:
  83. STACK[TOP + 1] = LVAR_var1
  84. INC TOP
  85. RETURN STACK[TOP]
  86. END
  87. REM---------------
  88. DEF F_func4(LVAR_var0, LVAR_var1, DUMMY_PAR )
  89. DIM STACK[128]
  90. DIM TOP
  91. DIM AX
  92. DIM BX
  93. DIM DUMMY
  94. DIM PC
  95. STACK[TOP + 1] = 48
  96. INC TOP
  97. TOP = TOP - 1
  98. DUMMY = F_func3(STACK[ TOP + 1],  0 )
  99. INC TOP
  100. STACK[TOP] = DUMMY
  101. RETURN STACK[TOP]
  102. END
  103. MEMORY[16] = 73
  104. MEMORY[17] = 32
  105. MEMORY[18] = 97
  106. MEMORY[19] = 109
  107. MEMORY[20] = 32
  108. MEMORY[21] = 116
  109. MEMORY[22] = 104
  110. MEMORY[23] = 101
  111. MEMORY[24] = 32
  112. MEMORY[25] = 98
  113. MEMORY[26] = 105
  114. MEMORY[27] = 103
  115. MEMORY[28] = 32
  116. MEMORY[29] = 112
  117. MEMORY[30] = 105
  118. MEMORY[31] = 108
  119. MEMORY[32] = 108
  120. MEMORY[33] = 0
  121. MEMORY[48] = 102
  122. MEMORY[49] = 97
  123. MEMORY[50] = 114
  124. MEMORY[51] = 111
  125. MEMORY[52] = 102
  126. MEMORY[53] = 105
  127. MEMORY[54] = 110
  128. MEMORY[55] = 104
  129. MEMORY[56] = 97
  130. MEMORY[57] = 0
  131. REM---------------
  132. DEF F_puts(PTR, DUMMY_PAR )
  133. DIM STACK[128]
  134. DIM TOP
  135. DIM AX
  136. DIM BX
  137. DIM DUMMY
  138. DIM PC
  139. DIM OFFSET = 0
  140. WHILE (MEMORY[PTR + OFFSET] != 0)
  141. PRINT CHR$(MEMORY[PTR + OFFSET]);
  142. INC OFFSET
  143. WEND
  144. PRINT ''
  145. RETURN 0
  146. END
  147. REM---------------
  148. DEF F_strlen(PTR, DUMMY_PAR )
  149. DIM STACK[128]
  150. DIM TOP
  151. DIM AX
  152. DIM BX
  153. DIM DUMMY
  154. DIM PC
  155. DIM OFFSET = 0
  156. WHILE (MEMORY[PTR + OFFSET] != 0)
  157. INC OFFSET
  158. WEND
  159. RETURN OFFSET
  160. RETURN 0
  161. END
  162. REM---------------
  163. DEF F_putchar(CHAR, DUMMY_PAR )
  164. DIM STACK[128]
  165. DIM TOP
  166. DIM AX
  167. DIM BX
  168. DIM DUMMY
  169. DIM PC
  170. PRINT CHR$(CHAR);
  171. RETURN 0
  172. END
  173. MEMORY[0] = 1
  174. MEMORY[1] = 5
  175. PRINT F_func4( 1, 0, 0 )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top