;       Flat Real/Real Big mode
;       Example 1

code    segment public

        assume  cs:code
        
        extrn   FLAT_install:near, FLAT_destall:near
        
        org     100h

ex1     proc    ; Example code
        
        call    FLAT_install            ; Enable 4Gb address space

        mov     ax,3                    ; Colour text mode
        int     10h
.386
        xor     ax,ax                   ; Base ES <- 000[0000]0h
        mov     es,ax
        mov     ah,1fh                  ; Colour = White on blue
        mov     si,offset message
        mov     edi,000b8000h           ; EDI <- top left screen address
        mov     cx,80                   ; Write one line
 l1:      lodsb                         ; Get a char
          stos  word ptr es:[edi]       ; Store char + attrib
        loop    l1

        call    FLAT_destall            ; <- Very Important!!!

        ret

message db      '  Message written using direct screen writing' 
        db      ' & 32-bit offsets in REAL-mode!!   '

ex1     endp

code    ends
        end     ex1
