From 0ab78b427a8bc7883d7ed48ea7401bd6edc46c4a Mon Sep 17 00:00:00 2001 From: KusaReMKN <48670724+KusaReMKN@users.noreply.github.com> Date: Sat, 24 Feb 2024 03:45:55 +0900 Subject: [PATCH] Latest version --- dumpmcb.asm | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dumpmcb.asm diff --git a/dumpmcb.asm b/dumpmcb.asm new file mode 100644 index 0000000..d7db383 --- /dev/null +++ b/dumpmcb.asm @@ -0,0 +1,46 @@ + 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 +