home *** CD-ROM | disk | FTP | other *** search
- ;*********************************************************************
- ; These routines are assembler interfaces to the Lattice vers 2.10 *
- ; compiler. They allow the programmer to do some of the necessary *
- ; screen manipulations such as clearing the screen, setting the *
- ; cursor at a given location etc. I will add more routines to the *
- ; package as time permits me to do so. *
- ; *
- ; The routines should be assembled and then linked with the linker *
- ; as explained in the lattice manual. For example if you used the *
- ; clear screen routine in a c program called test the link command *
- ; would be: *
- ; link cs+test+screen,test,nul,lcs *
- ; Other routines I plan to add are: *
- ; scr_clrl------------>clears the rest of the current line *
- ; scr_clrs------------>clears the rest of the screen *
- ; scr_scup------------>scrolls the screen up xcept top line *
- ; scr_scdn------------>scrolls screen down xcept for top line *
- ; scr_co-------------->writes a character to the screen *
- ; scr_ci-------------->inputs a character from the keyboard *
- ; scr_csts------------>inputs a character from keyboard and *
- ; translates function and soft key values *
- ; scr_csts------------>returns 0 if no character has been *
- ; input. *
- ; scr_sinp------------>reads the screen and returns the char *
- ; under the cursor *
- ; scr_off------------->turns the cursor off *
- ; scr_on-------------->turns the cursor on *
- ; Many of you have probably guessed by now that I am converting *
- ; from DeSmet C to Lifeboat's Lattice C. I initially had the *
- ; DeSmet C package and found it to be an excellent package to *
- ; learn the c language with. I do think the Lattice C package is *
- ; a better package for the serious software developer however. I *
- ; have found the Lifeboat people both easy to work with and help- *
- ; ful when I needed information. I am told by many users on my *
- ; board that this is not the case with Microsoft who also markets *
- ; the Lattice C compiler. In the future I plan to have a group of *
- ; assembler routines that function with the communications ports, *
- ; and maybe a set of graphics routines. If you have suggestions or *
- ; comments then I can be contacted at: *
- ; Lynn Long *
- ; PC-Systems *
- ; PO Box 471114 *
- ; Tulsa, OK 74147-1114 *
- ; or be reached at my BBS # *
- ; Lynn Long *
- ; Tulsa IBBS C-SIG *
- ; 918-749-0718 *
- ; 24 hours, 300/450/1200, XMODEM *
- ; Registration required *
- ;*********************************************************************
- name screen
- include dos.mac
- pseg
- ;*********************************************************************
- ; This routine clears the monitor. It is called from Lattice C as *
- ; follows. *
- ; scr_cls(); *
- ;*********************************************************************
- public scr_cls
- scr_cls proc near
- mov ax,06
- mov bh,07
- mov cx,0000
- mov dx,184fh
- int 10h
- ret
- scr_cls endp
- public scr_pos
- ;*********************************************************************
- ; this routine will position the cursor at the specified location *
- ; location on the screen. It is called from c as: *
- ; scr_pos(row,col) *
- ;*********************************************************************
- scr_pos proc near
- push bp
- mov bp,sp
- mov ah,02
- mov bh,00
- mov dl,[bp+6]
- mov dh,[bp+4]
- int 10h
- pop bp
- ret
- scr_pos endp
-
- ;*********************************************************************
- ; this function turns the cursor off *
- ;*********************************************************************
- public scr_off
- scr_off proc near
- push bp
- mov ah,15
- int 10h
- cmp al,04
- jc text_off
- cmp al,7
- jnz no_cur
- text_off:
- mov cx,0f00h
- mov ah,1
- int 10h
- no_cur:
- pop bp
- ret
- scr_off endp
- ;*********************************************************************
- ; this function turns the cursor back on *
- ;*********************************************************************
- public scr_on
- scr_on proc near
- push bp
- mov ah,15
- int 10h
- mov cx,0c0dh
- cmp al,7
- jz newcur
- mov cx,0607h
- cmp al,4
- jc newcur
- jmp back
- newcur:
- mov ah,1
- int 10h
- back:
- pop bp
- ret
- scr_on endp
- endps
- end
-