Advertisement
dheadshot

MOREP.ASM

Sep 5th, 2022
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. CPU 8086
  2. BITS 16
  3. ORG 100h
  4.  
  5. ;More enterable in the prompt
  6. ;Can't use: 00h, 03h, 07h, 08h, 09h, 0Ah, 0Dh, 1Ah, 1Bh, 26h, 3Ch, 3Eh, 7Ch, DDh, FFh
  7. Start:
  8. MOV AL, 0Eh
  9. DEC AL
  10. MOV byte [B01F0], AL
  11. MOV byte [B0217], AL
  12. SUB AL, 04
  13. INC AL
  14. MOV byte [B01F0+1], AL
  15. MOV byte [B0217+1], AL
  16.  
  17. MOV AH, 30h
  18. INT 21h
  19. XCHG AH, AL
  20. DEC AX
  21. CMP AX, 01FEh
  22. JA short P0114
  23. MOV DX, B01FC
  24. MOV AH, 12h
  25. SHR AH, 01h
  26. INT 21h
  27. INT 20h
  28. P0114:
  29. MOV byte [B01E7], 19h ;MOV byte ptr [B01E7], 19h ;
  30. MOV AH, 0Fh
  31. INT 10h
  32. XCHG AH, AL
  33. MOV [B01E8], AL
  34. NOP ;MOV DX, B0217
  35. NOP ;MOV AH, 12h
  36. NOP ;SHR AH, 01h
  37. NOP ;INT 21h
  38. XOR BX, BX
  39. MOV AH, 45h
  40. INT 21h
  41. MOV BP, AX
  42. MOV AH, 3Dh
  43. INC AH
  44. INT 21h
  45. MOV BX, 8002h
  46. AND BX, 010Fh
  47. MOV AH, 45h
  48. INT 21h
  49. P013B:
  50. CLD
  51. MOV DX, B021A
  52. MOV CX, 1001h
  53. DEC CX
  54. MOV BX, BP
  55. MOV AH, 3Fh
  56. INT 21h
  57. AND AX, AX ;OR AX, AX
  58. JNZ short P014E
  59. P014C:
  60. INT 20h
  61. P014E:
  62. MOV CX, AX
  63. MOV SI, DX
  64. P0152:
  65. LODSB
  66. XOR AH, AH
  67. INC AH
  68. TEST AL, 80h
  69. JZ short NotAE80
  70. ADD AL, 80h
  71. JMP EndOfCmpALs
  72. NotAE80:
  73. OR AL, 80h
  74. CMP AX, 019Ah
  75. JZ short P014C
  76. CMP AX, 018Dh
  77. JNZ short P0162
  78. NOP
  79. NOP
  80. NOP
  81. MOV BYTE [B01EA], 01h ;MOV BYTE PTR [B01EA], 01h ;
  82. JMP P01AE
  83. NOP
  84. P0162:
  85. CMP AX, 018Ah
  86. JNZ short P016C
  87. INC BYTE [B01E9] ;INC BYTE PTR [B01E9] ;
  88. JMP P01AE
  89. P016C:
  90. CMP AX, 0188h
  91. JNZ short P017D
  92. NOP
  93. MOV DL, byte [B01EA]
  94. XOR DH, DH
  95. INC DH
  96. CMP DX, 0101h ;CMP BYTE [B01EA], 01h ;CMP BYTE PTR [B01EA], 01h ;
  97. JZ short P01AE
  98. DEC BYTE [B01EA] ;DEC BYTE PTR [B01EA] ;
  99. JMP short P01AE
  100. P017D:
  101. CMP AX, 0189h
  102. JNZ short P0193
  103. ;PUSH DX
  104. MOV DH, [B01EA]
  105. ADD DH, 06h
  106. INC DH
  107. AND DH, 0F8h
  108. INC DH
  109. MOV [B01EA], DH
  110. ;POP DX
  111. JMP short P01AE
  112. P0193:
  113. CMP AX, 0187h
  114. JZ short P01AE
  115. EndOfCmpALs:
  116. INC BYTE [B01EA] ;INC BYTE PTR [B01EA] ;
  117. ;PUSH DX
  118. ;MOV DL, AL
  119. MOV DH, [B01EA]
  120. ;MOV AX, DX
  121. ;POP DX
  122. CMP DH, [B01E8]
  123. JBE short P01AE
  124. NOP
  125. NOP
  126. INC BYTE [B01E9] ;INC BYTE PTR [B01E9] ;
  127. MOV BYTE [B01EA], 01h ;MOV BYTE PTR [B01EA], 01h ;
  128. P01AE:
  129. SUB AL, 80h
  130. MOV DL, AL
  131. MOV AH, 02h
  132. INT 21h
  133. MOV DH, [B01E9]
  134. CMP DH, [B01E7]
  135. JB P01DE
  136. MOV DX, B01F0
  137. MOV AH, 12h
  138. SHR AH, 01h
  139. INT 21h
  140. MOV AH, 0Ch
  141. MOV AL, 01h
  142. INT 21h
  143. MOV DX, B0217
  144. MOV AH, 12h
  145. SHR AH, 01h
  146. INT 21h
  147. MOV BYTE [B01EA], 01h ;MOV BYTE PTR [B01EA], 01h ;
  148. MOV BYTE [B01E9], 01h ;MOV BYTE PTR [B01E9], 01h ;
  149. DEC SI
  150. INC CX
  151. P01DE:
  152. DEC CX
  153. NOP
  154. NOP
  155. JZ short P01E4
  156. NOP
  157. JMP near P0152 ;E943FF - E941FF
  158. P01E4:
  159. JMP near P013B ;E928FF - E926FF
  160. ;NOP
  161. ;NOP
  162. ;NOP
  163. ;NOP
  164.  
  165.  
  166. ;Data
  167. B01E7 DB 18h
  168. B01E8 DB 50h
  169. B01E9 DB 01h
  170. B01EA DB 01h
  171. ;B01EB DB 00h, 00h ;There should be 5, but I don't see why
  172. B01F0 DB 8Dh, 8Ah, '-- More --$'
  173. B01FC DB 'MORE: Incorrect DOS Version'
  174. B0217 DB 8Dh, 8Ah, '$' ;{CRLF}$'
  175. ;B021A DB 00h, 00h ;There should be 55h of these, but I have no idea why
  176. ;Data?
  177. B021A RESB 1000h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement