head	1.1;
access;
symbols;
locks
	yap:1.1; strict;
comment	@;; @;


1.1
date	96.11.18.20.46.48;	author yap;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@; program to print hello world in middle of screen
;       the message is red on blue background
; illustrates functions 9h (print multiple char with attributes)
;	and 0Eh (print char and advance cursor) of INT 10h.
;;
title hello world screen
.model small
.stack 100h
.data
greetings db 'Hello World!$'
.code
; macros
  include mac\mac.asm
main proc
  init_ds               ; macro call (the usual move ax,@@data, etc)
; select display mode (the screen is not cleared??)
  mov ah,0
  mov ah,3
  int 10h
; move cursor to center of screen
;        (actually, slightly off center)
  mov ah,2
  xor bh,bh     ; page 0
  mov dx,0C22h  ; row=12 (=0Ch), col=34 (=22h)
  int 10h
; set attributes for the next 13 positions
  mov ah,9      ; display char
  mov cx,13     ; do it 13 times
		; (we actually do this to set the attributes)
  mov bl,14h    ; red char on blue background
  mov al,0      ; empty space character
  int 10h
; display hello greeting (using function 0Eh)
  lea si,greetings      ; text to be displayed
  mov bx,12
  mov ah,0Eh    
again:
  mov al,[si]   ; char to print
  int 10h
  inc si
  dec bx
  cmp bx,0
  jnz again     ; repeat 
; dos return
  dos_rtn 0
main endp
  end main
	
@
