Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. / Set inputs to "decimal", and output to "unicode"
  2. / Use a positive nonzero numbers for the two inputs, which determine the size of the two respective arrays.
  3. / The first array will be populated with lowercase letters
  4. / The second with uppercase letters
  5. / So as to distinguish the two arrays and their sizes.
  6. ///
  7. / Input size of Array
  8. Input
  9. Store Array1_size
  10. Store Array1_count
  11. Input
  12. Store Array2_size
  13. Store Array2_count
  14. / Make an array of the size specified by input with incrementing characters starting from 'a'
  15. Loop1, Load Char_a
  16. StoreI Array1_ptr
  17. Add One
  18. Store Char_a
  19. Load Array1_ptr
  20. Add One
  21. Store Array1_ptr
  22. Load Array1_count
  23. Subt One
  24. Store Array1_count
  25. Skipcond 400
  26. Jump Loop1
  27. / Post-loop maintenance
  28. Load Array1_ptr
  29. / Handing over the last location pointed to by Array1_ptr to Array2_ptr
  30. Store Array2_ptr
  31. / Subtract by Array1's size to reset Array1 pointer to the first element
  32. Subt Array1_size
  33. Store Array1_ptr
  34. / Re-initializing count so we can use it for later
  35. Load Array1_size
  36. Store Array1_count
  37. / Make an array of the size specified by input with incrementing characters starting from 'A'
  38. Loop2, Load Char_A
  39. StoreI Array2_ptr
  40. Add One
  41. Store Char_A
  42. Load Array2_ptr
  43. Add One
  44. Store Array2_ptr
  45. Load Array2_count
  46. Subt One
  47. Store Array2_count
  48. Skipcond 400
  49. Jump Loop2
  50. / Similar maintenance as the code before Loop2
  51. Load Array2_ptr
  52. Subt Array2_size
  53. Store Array2_ptr
  54. Load Array2_size
  55. Store Array2_count
  56. / Now do a loop for each array to output contents
  57. Loop3, LoadI Array1_ptr
  58. Output
  59. Load Array1_ptr
  60. Add One
  61. Store Array1_ptr
  62. Load Array1_count
  63. Subt One
  64. Store Array1_count
  65. Skipcond 400
  66. Jump Loop3
  67. Loop4, LoadI Array2_ptr
  68. Output
  69. Load Array2_ptr
  70. Add One
  71. Store Array2_ptr
  72. Load Array2_count
  73. Subt One
  74. Store Array2_count
  75. Skipcond 400
  76. Jump Loop4
  77. Halt
  78. One, DEC 1
  79. Char_a, HEX 0061
  80. Char_A, HEX 0041
  81. Array1_size, DEC 0
  82. Array2_size, DEC 0
  83. Array1_count, DEC 0
  84. Array2_count, DEC 0
  85. Array1_ptr, HEX 0047
  86. Array2_ptr, HEX 0000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement