; You may customize this and other start-up templates; ; The location of this template is c:\emu8086\inc\0_com_template.txt org 100h jmp begin i db ? j db ? data db 0 str db 20 dup(?),10,'__________________$' curser macro x,y pusha mov ah,2h mov dh,x mov dl,y mov bh,0 int 10h popa endm reads proc near mov dx,8000h in al,dx mov data,al ret endp writes proc near mov dx, 0 ;send 'a' through com1 mov al, 'a' mov ah, 01 int 14h ret ;.......................................... begin: mov ah,21 mov bh,43 mov i,ah mov j,bh for: pusha ;print __________ curser 20,15 lea dx,str mov ah,09 int 21h ;clear screen mov al,0h mov ah,06h mov bh,7 mov cx,0 mov dl,79 mov dh,24 int 10h curser 20,15 lea dx,str mov ah,09 int 21h ;print * curser i,j mov dl,'*' mov ah,02h int 21h popa dec ah inc bh inc bh mov i,ah mov j,bh cmp bh,79 jne for call writes forserial: mov ah,3 ;check serial port status int 14h ;to check if data is available shr ax,9 ;puts bit8 to the carryflag jc fetch ;if bit8=1, fetch jnc forserial ;call reads cmp al,22 jne forserial fetch: mov dx, 0 ;receives 'a' from com2 mov ah, 02 int 14h cmp al,'a' jne forserial beginserial: mov ah,04h mov bh,0 mov i,ah mov j,bh for1: pusha ;print __________ curser 20,15 lea dx,str mov ah,09 int 21h ;clear screen mov al,0h mov ah,06h mov bh,7 mov cx,0 mov dl,79 mov dh,24 int 10h curser 20,15 lea dx,str mov ah,09 int 21h ;print * curser i,j mov dl,'*' mov ah,02h int 21h popa dec ah inc bh inc bh mov i,ah mov j,bh cmp ah,24 jne for1 mov ah, 4ch int 21h ret