Metropoli BBS
VIEWER: asm1.asm MODE: TEXT (ASCII)
    DOSSEG
    .MODEL SMALL
    .STACK 200h
    .DATA

Message     db  "This was printed using function 9 " 
            db  "of the DOS interrupt 21h.$"
                  
    .CODE
    
START:
    mov     ax,seg Message  ;moves the SEGMENT that `Message' is in into AX
    mov     ds,ax           ;moves ax into ds (ds=ax)
                            ;you cannot do this -> mov ds,seg Message

    mov     dx,offset Message   ;move the OFFSET of `Message' into DX
    mov     ah,9        ;Function 9 of DOS interupt 21h prints a string that
    int     21h         ;terminates with a "$".  It requires a FAR pointer to
                        ;what is to be printed in DS:DX

    mov     ax,4c00h    ;Returns control to DOS
    int     21h         ;MUST be here! Program will crash without it!

END START
[ RETURN TO DIRECTORY ]