Murugan.com
Murugan Andezuthu Dharmaratnam

  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  



8086 assembly language read a string using standard input keyboard


Home  > 8086  > 8086 assembly language read a string using standard input keyboard 
       
I guess this is basically for begiiners a tutorial. here is a simple procedure to read string from standard input that is the keyboard

readstring proc near           ;requires si(offset of the string to be stored)
    push ax bx cx dx si di
    mov bx,0b800h              ;row coloumn
    mov es,bx
    mov ax,row
    mov bx,160
    mul bx
    mov di,ax
    mov bx,2
    mov ax,coloumn
    mul bx
    add di,ax
    mov bl,attrf
    mov dl,0
    loop_readstring1:
        mov ah,00
        int 16h
        cmp al,08h
        jne loop_readstring_main
        cmp dl,0
        jle loop_readstring1
        dec dl
        dec di
        mov byte ptr es:[di],bl
        dec di
        mov al,' '
        mov byte ptr es:[di],al
        dec si
        jmp loop_readstring1
      loop_readstring_main:
        cmp al,0dh
        je loop_readstring2
        mov byte ptr cs:[si],al
        mov byte ptr es:[di],al
        cmp password,1
           jne readstring_nopass 
           push ax
           mov al,'*'
           mov byte ptr es:[di],al
           pop ax
        readstring_nopass:
        inc si
        inc di
        inc dl
        mov byte ptr es:[di],bl
        inc di
        jmp loop_readstring1
        loop_readstring2:
        cmp file,1
        jne loop_readstring3
          mov al,0
          mov byte ptr cs:[si],al
          inc si
        loop_readstring3:
          mov al,'$'
          mov byte ptr cs:[si],al
          pop di si cx dx bx ax
    ret
password db 0
file db 0
endp


8086 Assembly Lanaugage Clear the screen

8086 Assembly Lanaugage Program to Draw a box

8086 Assembly Writing Directly to Video Memory B800

8086 Assembly Causes a Delay in terms of 1 60 of a second Delay Macro

8086 Assembly Hello World Application

8086 Assembly Terminate the program and return to Dos prompt

8086 Assembly Language Wati for a keystroke or pause macro

8086 Assembly Language Delay Macro

8086 Game Programming Collusion Detection

8086 Assembly Game Collusion Detection Macro

8086 Assembly Lanuage Set the video display mode

8086 Write matrix of bytes to a memory game pogramming

8086 Assembly Language code procedure for delay

8086 Code Type String or Display String

8086 Assembly Language Convert from Hex to ascii

8086 Assembly Language Press Any Key to Continue Dialog

8086 Assembly Dialogbox or display a box with shadow in text mode

8086 Assembly cls clrscr or clear the screen

8086 assembly language read a string using standard input keyboard

8086 assembly language compare two strings strcmp procedure

8086 Assemly file io proc procedure to open a file

8086 Interrupt List

8086 Assembly Close FIle. Close a file opened for read write

8086 assembly language

8086 Assembly Language Sound Blaster Programming Play wav File

8086 assembly language program to play sound using pc speaker



  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  

Copyright 2009 @ Murugan Andezuthu Dharmaratnam