;=========================================================
; File:    BlastOff.asm
; Purpose: Display a "count down" from 5 to "Blast Off!"
;          Show how LOOP works.
;=========================================================

include 'emu8086.inc'

       org  100h ; set location counter to 100h

       jmp  CodeStart

DataStart:

blastOff db  "Blast off!"
newline  db  13, 10, 0

CodeStart:
       mov  cx, 5                ; start at five               

Lup:
       mov  ax, cx               ; display current count
       call print_num
       mov  si, offset newline   ; issue newline
       call print_string

       loop Lup                  ; count down by one

       mov  si, offset blastOff  ; display "Blast Off!"
       call print_string

       ret                       ; return to caller

DEFINE_PRINT_STRING
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
