-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
th05_memchk.asm
115 lines (102 loc) · 2.72 KB
/
th05_memchk.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
;
; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2009 by Hex-Rays, <[email protected]> |
; +-------------------------------------------------------------------------+
;
; Input MD5 : 5E401A5CD3D8D42DC67130359C42A7CF
; File Name : th05/ZUN.COM:MEMCHK (-M)
; Format : MS-DOS COM-file
; Base Address: 0h Range: 100h-237h Loaded length: 137h
; OS type : MS DOS
; Application type: Executable 16bit
.186
.model tiny
.code
org 100h
; =============== S U B R O U T I N E =======================================
public start
start proc near
mov bx, 567
shr bx, 4
add bx, 17
mov ah, 4Ah
int 21h ; DOS - 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK)
; ES = segment address of block to change
; BX = new size in paragraphs
shl bx, 4
mov sp, bx
mov dx, offset aVavVVGbgcgugbg ; "あなたのメインメモリ空き容量は $"
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
mov bx, 0FFFFh
mov ah, 48h
int 21h ; DOS - 2+ - ALLOCATE MEMORY
; BX = number of 16-byte paragraphs desired
mov di, offset aVVVVKctgvVIVVv ; "それでは頑張って下さいね☆\r\n$"
cmp bx, 32500
jnb short loc_131
mov di, offset aVVxvVBagbgvgkv ; "ちょっと、メモリが足りないかも\r\nこのゲ"...
mov byte_236, 255
loc_131:
xor dx, dx
mov ax, 16
mul bx
mov cx, 10000
div cx
mov cx, 10
call sub_15F
mov ax, dx
mov cx, 1000
call sub_15F
mov dx, offset aGogcggvVV ; " バイトですの\r\n$"
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
mov dx, di
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
mov ah, 4Ch
mov al, byte_236
int 21h ; DOS - 2+ - QUIT WITH EXIT CODE (EXIT)
start endp ; AL = exit code
; =============== S U B R O U T I N E =======================================
sub_15F proc near
pushf
pusha
mov bx, ax
mov si, 10000
loc_166:
xor dx, dx
mov ax, bx
div si
mov bx, dx
cmp cx, si
jb short loc_17B
mov dl, al
add dl, '0'
mov ah, 2
int 21h ; DOS - DISPLAY OUTPUT
; DL = character to send to standard output
loc_17B:
xor dx, dx
mov ax, si
mov si, 10
div si
mov si, ax
cmp si, 0
jnz short loc_166
popa
popf
retn
sub_15F endp
; ---------------------------------------------------------------------------
aVavVVGbgcgugbg db 'あなたのメインメモリ空き容量は $'
aGogcggvVV db ' バイトですの',0Dh,0Ah,'$'
aVVxvVBagbgvgkv db 'ちょっと、メモリが足りないかも',0Dh,0Ah
db 'このゲームは空きメインメモリは 520000 バイトは必要ですわ',0Dh,0Ah,'$'
aVVVVKctgvVIVVv db 'それでは頑張って下さいね☆',0Dh,0Ah,'$'
byte_236 db 0
end start