47 lines
591 B
NASM
47 lines
591 B
NASM
|
NAME DUMPMCB
|
|||
|
TITLE DUMPMCB -- Dump Memory Control Block (MCB) Chain
|
|||
|
|
|||
|
CODE SEGMENT
|
|||
|
ORG 0100h
|
|||
|
ASSUME CS:CODE, DS:CODE, ES:CODE, SS:CODE
|
|||
|
|
|||
|
START:
|
|||
|
INVARS:
|
|||
|
MOV AH, 52h
|
|||
|
INT 21h
|
|||
|
JC ERROR
|
|||
|
DB 26h ; ES:
|
|||
|
MOV ES, [BX-2]
|
|||
|
MCBNEXT:
|
|||
|
CALL SHOWMCB
|
|||
|
CMP [ES:0000], BYTE PTR 'Z'
|
|||
|
JZ EXIT
|
|||
|
MOV AX, ES
|
|||
|
ADD AX, [ES:0003]
|
|||
|
INC AX
|
|||
|
MOV ES, AX
|
|||
|
JMP SHORT MCBNEXT
|
|||
|
EXIT:
|
|||
|
XOR AL, AL
|
|||
|
ERROR:
|
|||
|
MOV AH, 4Ch
|
|||
|
INT 21h
|
|||
|
|
|||
|
SHOWMCB:
|
|||
|
PUSH ES
|
|||
|
POP DS
|
|||
|
CLD
|
|||
|
XOR SI, SI
|
|||
|
MOV CX, 16
|
|||
|
MOV AH, 02h
|
|||
|
SHOWLOOP:
|
|||
|
LODSB
|
|||
|
MOV DL, AL
|
|||
|
INT 21h
|
|||
|
LOOP SHOWLOOP
|
|||
|
RET
|
|||
|
|
|||
|
CODE ENDS
|
|||
|
END START
|
|||
|
|