title: Printing characters onto screen using Assembly
body: <p>hi i'm using NASM in ubuntu 11.10 and wrote a program using it, following code will printout the exactly one character at a time.</p>
  
  <pre><code>    [BITS 16]       ;Tells the assembler that its a 16 bit code
      [ORG 0x7C00]    ;Origin, tell the assembler that where the code will
  
      ;segment .data
          PROMPT1 db  "HELLO WORLD",0x0
          STAR    db  '*'
      ;segment .text
         ;global asm_main
      ;asm_main:
          mov     si, PROMPT1
          mov     al, [si]
          ;mov ecx, 11
      loop_start:
         call    PRNTCHR
         inc     si
         mov al, 0xA
         call PRNTCHR
         mov     al, [si]
         cmp     al, 0
         je      $+4
         loop    loop_start
         jmp         $
  
     PRNTCHR:
         MOV AH, 0x0E        ;Tell BIOS that we need to print one charater on screen.
         MOV BH, 0x00        ;Page no.
         MOV BL,0x0F        ;Text attribute 0x07 is lightgrey font on black background
  
         INT 0x10    ;Call video interrupt
         RET         ;Return to calling procedure
  
     TIMES 510 - ($ - $$) db 0   ;Fill the rest of sector with 0
     DW 0xAA55                   ;Add boot signature at the end of bootloader
  </code></pre>
  
  <p>i do have two questions regard this code segments.</p>
  
  <ol>
  <li>although star db '*' doesn't do anything in the code yet it's important.</li>
  <li>printing new line doesn't work efficiently. program outputs spaces as well</li>
  </ol>
  
  <p>can you help me out? </p>