;[]-------------------------------------------------------------------------[]
;|	Program name: 2_3_1.ASM                                              |
;|	Image   file: 2_3_1.COM                                              |
;|	Note        : This is not a TSR program.                             |
;|                    It is used to show the segment address of MCB2.        |
;[]-------------------------------------------------------------------------[]


cseg	segment
	assume	cs:cseg,ds:cseg
	org	100H
start:
	jmp	initialize

;------- Data area ---------------------

hextab	db	'0123456789ABCDEF'

;------- Subroutine --------------------

dchar	proc	near			; display character
	mov	bh,1
	mov	ah,0EH
	int	10H
	ret
dchar	endp

dbyte	proc	near			; display byte
	push	ax
	shr	al,1
	shr	al,1
	shr	al,1
	shr	al,1
	and	ax,000FH
	mov	si,ax
	mov	al,cs:hextab[si]
	call	dchar
	pop	si
	and	si,000FH
	mov	al,cs:hextab[si]
	call	dchar
	ret
dbyte	endp

dsword	proc	near			; display short word
	push	ax
	mov	al,ah
	call	dbyte
	pop	ax
	call	dbyte
	ret
dsword	endp

dreturn	proc	near			; display return
	mov	al,0AH
	call	dchar
	mov	al,0DH
	call	dchar
	ret
dreturn	endp

;------ Main program -------------------

initialize:

	mov	ax,es			; get PSP  segment address
	sub	ax,1			; get MCB2 segmemt address
	mov	es,ax			; let es point to the segment of MCB2

	mov	bx,3
	mov	ax,es:[bx]		; get the controlled size of MCB

	call	dsword			; display the size value
	call	dreturn

	int	20H

cseg	ends
	end	start

