CSEG       SEGMENT 'CODE'
           ASSUME CS:CSEG,DS:DSEG

MAIN       PROC
           MOV  AX,DSEG
           MOV  DS,AX
           MOV  AH,48h
           MOV  BX,1
           INT  21h
           MOV  STRUKTUR+2,AX
           MOV  STRUKTUR,0
           PUSH STRUKTUR+2
           PUSH STRUKTUR
           MOV  AX,10
           PUSH AX
           MOV  AX,20
           PUSH AX
           CALL CBVCONTENT
           MOV  ES,STRUKTUR+2
           MOV  BX,STRUKTUR
           MOV  AX,ES:[BX]
           CALL DEZOUT
           MOV  AX,ES:[BX+2]
           CALL DEZOUT
           MOV  AX,SEG STRUKTUR
           PUSH AX
           MOV  AX,OFFSET STRUKTUR
           PUSH AX
           MOV  AX,30
           PUSH AX
           MOV  AX,40
           PUSH AX
           CALL CBRCONTENT
           MOV  ES,STRUKTUR+2
           MOV  BX,STRUKTUR
           MOV  AX,ES:[BX]
           CALL DEZOUT
           MOV  AX,ES:[BX+2]
           CALL DEZOUT           
           MOV  AH,49h
           MOV  ES,STRUKTUR+2
           INT  21h
           MOV  AX,4C00h
           INT  21h
MAIN       ENDP

CBVCONTENT PROC
           PUSH BP
           MOV  BP,SP
           PUSH DS
           MOV  DS,[BP+10]
           MOV  SI,[BP+8]
           MOV  AX,[BP+6]
           MOV  [SI],AX
           MOV  AX,[BP+4]
           MOV  [SI+2],AX
           POP  DS
           POP  BP
           RET  8
CBVCONTENT ENDP

CBRCONTENT PROC
           PUSH BP
           MOV  BP,SP
           PUSH DS
           MOV  ES,[BP+10]
           MOV  BX,[BP+8]
           MOV  DS,ES:[BX+2]
           MOV  SI,ES:[BX]
           MOV  AX,[BP+6]
           MOV  [SI],AX
           MOV  AX,[BP+4]
           MOV  [SI+2],AX
           POP  DS
           POP  BP
           RET  8
CBRCONTENT ENDP

DEZOUT     PROC
           PUSH AX
           PUSH BX
           PUSH CX
           PUSH DX
           MOV  BX,10
           MOV  CX,0
DIVLOOP:
           MOV  DX,0
           DIV  BX
           PUSH DX
           INC  CX
           CMP  AX,0
           JNE  DIVLOOP
WRITELOOP:
           MOV  AH,2
           POP  DX
           ADD  DX,'0'
           INT  21h
           LOOP WRITELOOP   
           MOV  AH,2
           MOV  DL,13
           INT  21h
           MOV  DL,10
           INT  21h
           POP  DX
           POP  CX
           POP  BX
           POP  AX
           RET
DEZOUT     ENDP

CSEG       ENDS

DSEG       SEGMENT
STRUKTUR   DW ? ; Offset
           DW ? ; Segment
DSEG       ENDS

SSEG       SEGMENT STACK
           DW 1024 DUP (?)
SSEG       ENDS

           END MAIN