亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? casync.asm

?? 數字轉換的六個功能模塊
?? ASM
字號:
title IBM PC Communications I/O Routines -- Curt Klinsing
pgroup group prog
prog segment byte public 'prog'
;
;A set of Lattice C callable functions to support
;interrupt driven character I/O on the IBM PC. Input
;is buffered, output is polled.
;
public init_comm ;initialize the comm port,
public uninit_comm ;remove initialization,
public set_xoff  ;enable/disable XON/XOFF,
public get_xoff  ;read XON/XOFF state,
public rcvd_xoff ;returns true if XOFF rcvd,
public sent_xoff ;true if XOFF sent,
public inp_cnt  ;returns count of rcv chars,
public inp_char  ;get one char from buffer,
public inp_flush ;flush input buffer,
public outp_char ;output a character,
;
;A better description can be found in the comment
;block in each function.
;
 assume cs:pgroup
 
;
FALSE EQU 0
TRUE EQU NOT FALSE
;
BASE EQU 03F8H ;BASE FOR SERIAL BOARD
;
LCR equ BASE+3 ; Line control register
IER equ BASE+1 ; Interrup Enable Register
MCR EQU BASE+4 ;modem control register
EnblDRdy equ 01H ; enable 'data-ready' interrupt bit
IntCtlr  EQU 21H ;OCW 1 FOR 8259 CONTROLLER
EnblIRQ4 EQU 0EFH ;Enable COMMUNICATIONS (IRQ4)
DATAPORT EQU BASE ;transmit/receive data port
MaskIRQ4 EQU 10H ;BIT TO DISABLE COMM INTERRUPT (IRQ4)
 
MDMSTA EQU BASE+5 ;line status register
MDMMSR EQU BASE+6 ;modem status register
MDMBAD EQU BASE ;lsb baud resgister
MDMBD1 EQU BASE+1 ;msb baud rate register
MDMCD EQU 80H ;mask for carrier dectect
SETBAU EQU 80H ;code for Divisor Latch Access Bit
MDMTBE EQU 20H ;8250 tbe flag
MDMBRK EQU 40H ;command code for 8250 break
LINMOD EQU 03H ;line mode=8 bit, no parity
MDMMOD EQU 0BH ;modem mode = DTR and RTS HIGH
STOP2 EQU 04H ;BIT FOR TWO STOP BITS IF BAUD<300
RS8259 EQU 20H ;OCW 3 FOR 8259
RSTINT EQU 64H ;SPECIFIC EOI FOR COMM INTERRUPT
XOFF EQU 13H ;XOFF character
XON EQU 11H ;XON character
;
; MISCELLANEOUS EQUATES
;
CR EQU 13
LF EQU 10
DosCall EQU 33 ;INTERRUPT NUMBER FOR DOS CALL
CNSTAT EQU 11 ;FUNCTION NUMBER FOR CONSOLE STATUS
CNIN EQU 1 ;FUNCTION NUMBER FOR CONSOLE INPUT
BUFSIZ EQU 512 ;Max NUMBER OF CHARS
SetIntVect  EQU 25H ;SET INTERRUPT VECTOR FUNCTION NUMBER
 
;
; DUMP BUFFER, COUNT AND POINTER.
;
CIRC_BUF DB BUFSIZ DUP(?) ;ALLOW 512 MaxIMUM BUFFERED CHARACTERS
BUF_TOP EQU $ - 1  ;KEEP TRACK OF THE TOP OF THE BUFFER
CIRC_TOP DW BUF_TOP  ;
;
CIRC_IN DW OFFSET CIRC_BUF ;POINTER TO LAST CHAR. PLACED IN BUFFER
CIRC_CUR DW OFFSET CIRC_BUF ;POINTER TO NEXT CHAR. TO BE RETRIEVED FROM
    ; BUFFER
CIRC_CT DW 0  ;COUNT OF CHARACTERS USED IN BUFFER
SNT_XOFF DB FALSE  ;FLAG TO CHECK IF AN XOFF HAS BEEN SEND
GOT_XOFF  DB FALSE  ;FLAG TO CHECK IF AN XOFF HAS BEEN RECEIVED
SEE_XOFF  DB FALSE  ;FLAT TO SEE IF WE ARE INTERESTED IN XON/XOFF
;
;
;
;set_xoff(flag)  Enable (flag != 0) or disable
;int flag;  (flag == 0) XON/ XOFF protocol
;   for the character input stream.
;If enabled, an XOFF will be sent when the buffer
;reaches 3/4 full. NOTE: an XON will not be sent auto-
;matically. Your program must do it when it sees
;the rcvd_xoff() flag, and ready for more chars.
;
set_xoff proc near
 push bp
 PUSH DS  ;SAVE DATA SEGMENT
 mov bx,[bp+6]
 push cs
 pop ds  ; move code seg addr to data seg reg.
 cmp bx,0
 jnz to_on
 mov see_xoff,FALSE
 jmp done1
to_on: mov see_xoff,TRUE
done1: pop ds
 pop bp
 ret
set_xoff endp
;
;flag= get_xoff() Returns the current setting
;   of the XON/ XOFF flag set
;by set_xoff(), above.
;
get_xoff proc near
 push bp
 push ds  ; save data reg
 push cs
 pop ds  ; move code seg addr to data seg reg.
 xor ax,ax
 mov al,see_xoff
 pop ds
 pop bp
 ret
get_xoff endp
;
;flag= sent_xoff(); Returns true if an XOFF
;   character was sent, indicating
;the receive buffer is 3/4 full.
;
sent_xoff proc near
 push bp
 push ds  ; save data reg
 push cs
 pop ds  ; move code seg addr to data seg reg.
 xor ax,ax
 mov al,snt_xoff
 pop ds
 pop bp
 ret
sent_xoff endp
;
;rcvd_xoff()  Returns true if an XOFF was
;   received; will return false as
;soon as an XON is received. Does not effect data output,
;only indicates the above. (Obviously useless for binary
;data.)
;
rcvd_xoff proc near
 push bp
 push ds  ; save data reg
 push cs
 pop ds  ; move code seg addr to data seg reg.
 xor ax,ax
 mov al,got_xoff
 pop ds  ; restore data reg
 pop bp
 ret
rcvd_xoff endp
;
;count= inp_cnt() Returns the number of characters
;   available in the input buffer.
;
 
inp_cnt proc near
 push bp
 push ds  ; save data segment
 push cs
 pop ds  ; move code seg addr to data seg reg
 mov ax,circ_ct
 pop ds
 pop bp
 ret
inp_cnt endp
;
;inp_flush() Flush the input buffer.
;
inp_flush proc near
 push bp
 push ds  ; save data reg
 push cs
 pop ds  ; move code seg addr to data seg reg.
 mov bx,offset circ_buf
 mov circ_in,bx
 mov circ_cur,bx
 xor ax,ax
 mov circ_ct,ax
 pop ds
 pop bp
 ret
inp_flush endp
 
; --------- Init -----------------------------------
; Program initialization:
;   -- Set up vector for RS232 interrupt (0CH)
;   -- Enbl IRQ4
;   -- Enbl RS232 interrupt on data ready
;
; ---------------------------------------------------
 
init_comm proc near
 push bp
 cli
 
;  ---- Set up INT x'0C' for IRQ4
 
 push ds
 push cs
 pop ds  ;cs to ds
 mov dx,offset IntHdlr ;relative adddres of interrupt handler
 mov al,0cH  ;interrupt number for comm.
 mov ah,SetIntVect ;function number for setting int vector
 int DosCall  ;set interrupt in 8086 table
 pop ds  ;restore DS
 
;  ---- Enbl IRQ4 on 8259 interrupt controller
 
 cli
 
 in al,IntCtlr ; get current masks
 and al,EnblIRQ4 ; Reset IRQ4 mask
 out IntCtlr,al ; And restore to IMR
 
;  ---  Enbl 8250 data ready interrupt
 
 mov dx,LCR  ; DX ==> LCR
 in al,dx  ; Reset DLAB for IER access
 and al,7FH
 out dx,al
 mov dx,IER  ; Interrupt Enbl Register
 mov al,EnblDRdy ; Enable 'data-ready' interrupt
 out dx,al
 
;  ---  Enbl OUT2 on 8250
 
 mov dx,MCR  ; modem control register
 mov al,08H  ; Enable OUT2
 out dx,al
 
 sti
 
 pop bp
 ret
init_comm endp
;
;uninit_comm()  Removes the interrupt structure
;   installed by init_comm(). Must be
;done before passing control to the DOS, else chars received
;will be stored into the next program loaded!
;
uninit_comm proc near
 push bp
; --- Disable IRQ4 on 8259
 
 cli
 in al,IntCtlr ;GET OCW1 FROM 8259
 or al,MaskIRQ4 ;DISABLE COMMUNICATIONS INTERRUPT
 out IntCtlr,al
 
; --- Disable 8250 data ready interrupt
 
 mov dx,LCR  ; DX ==> LCR
 in al,dx  ; Reset DLAB for IER access
 and al,7FH
 out dx,al
 mov dx,IER  ; Interrupt Enbl Register
 mov al,0  ; Disable all 8250 interrupts
 out dx,al
 
;  ---  Disable OUT2 on 8250
 
 mov dx,MCR  ; modem control register
 mov al,0  ; Disable OUT2
 out dx,al
 
 sti
  pop bp
 ret
uninit_comm endp
;
;char inp_char() Return a character from the input
;   buffer. Assumes you have called
;inp_cnt() to see if theres any characters to get.
;
inp_char proc near
 push bp
 push ds  ; save data reg
 push cs
 pop ds  ; move code seg addr to data seg reg.
 mov bx,circ_cur
 xor ax,ax
 mov al,[bx]  ;get next char from circ_buf
 DEC circ_ct  ;decrement circ_buf COUNT
 CMP bx,circ_top ;ARE WE AT THE TOP OF THE circ_buf?
 JZ reset_cur ;JUMP IF SO
 INC bx  ;ELSE, BUMP PTR
 JMP SHORT upd_cur
reset_cur:
 mov bx,OFFSET circ_buf ;RESET circ_in TO BOTTOM OF BUF.
upd_cur:
 mov circ_cur,bx  ;SAVE NEW PTR
 xor cx,cx
 mov cl,see_xoff ;check if interested in xon/xoff
 cmp cl,TRUE
 jnz clnup2  ;not interested, so goto return
 cmp snt_xoff,TRUE ;have we sent an xoff?
 jnz clnup2  ;no, so return
 cmp circ_ct,80h ;yes, so see in buf is now emptying
 jg clnup2  ;not empty enuf to send xon, jump to ret
 mov snt_xoff,FALSE
 mov cl,XON
 push ax  ; save char
 call comout
 pop ax
clnup2: pop DS  ;GET BACK ENTERING DS
 pop bp
 ret
inp_char endp
;
;outp_char(c)  Output the character to the
;char c;  serial port. This is not buffered
;   or interrupt driven.
;
outp_char proc near
 push bp
 mov bp,sp
 mov cl,[bp+4]
 sti
 call comout
 pop bp
 ret
outp_char endp
;
;Local subroutine: output CL to the port.
;
comout: mov dx,MDMSTA
 in al,dx  ; get 8250 status
 and al,MDMTBE ; check for transmitter ready
 jz comout  ; jump if not to wait
 mov al,cl  ; get char to al
 mov dx,DATAPORT
 out dx,al  ; output char to 8251
 ret
;
; RECEIVE INTERRUPT HANDLER (CHANGED TO PLACE CHARACTERS IN A
;  CIRCULAR circ_buf AND TO SEND AN XOFF IF THE circ_buf IS MORE THAN
;  3/4 FULL - S.G.)
;
IntHdlr:
 CLI
 push cx
 push dx
 push bx
 push ax
 push ds
 mov ax,cs  ;get cur code segment
 mov ds,ax  ; and set it as data segment
 mov bx,circ_in ;GET circ_buf IN PTR
 mov DX,DATAPORT ;GET DATA PORT NUMBER
 IN AL,DX  ;GET RECEIVED CHARACTER
; push ax
; push dx
; xor ax,ax
; xor dx,dx
; mov dl,al
; mov ah,2
; int DosCall
; pop dx
; pop ax
 xor cx,cx
 mov cl,see_xoff ;check if interested in xon/xoff
 cmp cl,TRUE
 jnz ck_full  ;not interested goto ck if buf full
 mov cl,al  ;put char in cl for testing
 and cl,7fh  ;turn off any parity bits
 cmp cl,XOFF  ;see if we got an xoff
 jnz ck_xon
 mov got_Xoff,TRUE ; code for handling xon/xoff from remote
 jmp clnup
ck_xon: cmp cl,XON
 jnz reg_ch
 mov got_Xoff,FALSE
 jmp clnup
;
;Normal character; not XON/XOFF, or XON/XOFF disabled.
;
reg_ch: test snt_Xoff,TRUE ;SEE IF sentXoff IS SET
 jnz ck_full  ;IF SO, DON'T SEND ANOTHER XOFF
 CMP circ_ct,(BUFSIZ * 3)/4 ;ALLOW BUF TO BECOME 3/4 FULL BEFORE
     ; SENDING XOFF
 jb savch  ;IF IT'S OK, CONTINUE
 push ax  ;SAVE CHARACTER
 mov CL,XOFF  ;GET XOFF CHARACTER
 mov snt_Xoff,TRUE  ;RESET sentXoff
 call comout  ; AND SEND IT
 pop ax  ;RETRIEVE CHARACTER
 JMP SHORT savch  ;IF WE'RE HERE, THE circ_buf HAS BUFSIZ-80H
    ;  CHARACTERS
ck_full:
 CMP circ_ct,BUFSIZ ;SEE IF circ_buf ALREADY FULL
 JZ clnup  ; JUMP IF SO, DO NOT PLACE CHARACTER IN BFR
savch:
 mov [bx],AL  ;SAVE NEW CHARACTER IN circ_buf
 inc circ_ct  ;BUMP circ_buf COUNT
 CMP bx,circ_top ;ARE WE AT THE TOP OF THE circ_buf?
 JZ reset_in ;JUMP IF SO
 inc bx  ;ELSE, BUMP PTR
 JMP SHORT into_buf
reset_in:
 mov bx,OFFSET circ_buf ;RESET circ_in TO BOTTOM OF BUF.
into_buf:
 mov circ_in,bx  ;SAVE NEW PTR
clnup:
 mov AL,RSTINT
 OUT RS8259,AL ;ISSUE SPECIFIC EOI FOR 8259
 pop ds  ;GET BACK ENTERING DS
 pop ax
 pop bx
 pop dx
 pop cx
 sti
 iret
;
prog ends
 
end
 
*** COPIED 01/25/84 04:31:17 BY KSC ***

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人精品国产福利| 精品亚洲成a人| 欧美国产一区二区| 2017欧美狠狠色| 777a∨成人精品桃花网| 欧美精品乱人伦久久久久久| 日本电影欧美片| 色呦呦网站一区| 欧美图区在线视频| 欧美理论片在线| 欧美一个色资源| 久久亚洲一区二区三区四区| 国产日韩av一区二区| 欧美经典三级视频一区二区三区| 欧美国产日韩亚洲一区| 亚洲免费成人av| 亚洲成人综合视频| 久久99久久久久久久久久久| 国产成人在线色| 成人激情图片网| 欧美午夜一区二区| 日韩一区二区三区四区五区六区| 欧美mv日韩mv国产网站| 欧美精彩视频一区二区三区| 亚洲图片欧美激情| 香蕉久久夜色精品国产使用方法| 视频一区中文字幕| 国产宾馆实践打屁股91| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 91丨九色丨尤物| 欧美视频精品在线观看| 久久久五月婷婷| 尤物在线观看一区| 久久激情五月婷婷| 97国产一区二区| 日韩欧美国产一区二区在线播放| 国产精品久久久久7777按摩| 奇米色777欧美一区二区| 成人高清视频在线| 555夜色666亚洲国产免| 久久九九全国免费| 丝袜美腿亚洲综合| voyeur盗摄精品| 欧美成人精精品一区二区频| 18涩涩午夜精品.www| 奇米影视一区二区三区| 91网站在线播放| 国产片一区二区三区| 日韩中文字幕1| 99国产精品国产精品久久| 久久综合色之久久综合| 视频一区二区三区中文字幕| 成人精品高清在线| 欧美一区二区不卡视频| 亚洲在线视频网站| 成人晚上爱看视频| 久久嫩草精品久久久久| 日本美女一区二区三区视频| 日本久久一区二区| 国产精品卡一卡二| 成人免费看片app下载| 精品国产乱码久久久久久浪潮| 亚洲成av人片在www色猫咪| 99国产精品久| 亚洲精品综合在线| 91污在线观看| 亚洲欧美色一区| 91香蕉视频在线| 亚洲免费看黄网站| 一本到一区二区三区| 亚洲欧美一区二区三区国产精品 | 欧美人成免费网站| 亚洲一区二区三区视频在线 | 国产精品成人在线观看| 国产成人精品三级| 中文成人综合网| 国产黑丝在线一区二区三区| 久久久亚洲精品一区二区三区 | 亚洲欧洲日韩综合一区二区| 国产999精品久久久久久绿帽| 久久久亚洲精华液精华液精华液| 国产福利精品一区| 国产精品国产成人国产三级 | 精品剧情v国产在线观看在线| 久久精品免费看| 日韩久久免费av| 精品一区二区三区影院在线午夜| 久久色.com| 成人黄色软件下载| 亚洲视频电影在线| 欧美日韩久久一区二区| 麻豆91免费观看| 国产欧美中文在线| 91福利在线免费观看| 亚洲国产视频网站| 日韩欧美电影一二三| 久久99国产乱子伦精品免费| 国产网站一区二区三区| 色综合久久综合网欧美综合网 | 99riav一区二区三区| 婷婷综合五月天| 久久综合久久99| 色婷婷久久久综合中文字幕 | 另类专区欧美蜜桃臀第一页| 国产欧美日韩另类一区| 在线日韩国产精品| 久久电影国产免费久久电影| 国产精品家庭影院| 7777精品伊人久久久大香线蕉最新版| 国产盗摄一区二区三区| 亚洲成人在线免费| 欧美国产禁国产网站cc| 欧美午夜一区二区三区免费大片| 狠狠色狠狠色综合日日91app| 18欧美乱大交hd1984| 日韩精品一区二区三区视频播放| 99久久伊人网影院| 久久精品国产一区二区三区免费看| 国产精品乱码一区二三区小蝌蚪| 欧美日韩日日摸| 国产成人福利片| 精品一区在线看| 亚洲午夜日本在线观看| 国产精品欧美久久久久无广告| 欧美日韩精品三区| 99久久99精品久久久久久| 紧缚捆绑精品一区二区| 午夜欧美视频在线观看| 亚洲色欲色欲www| 欧美国产1区2区| 欧美成人a视频| 6080日韩午夜伦伦午夜伦| 色哟哟一区二区在线观看| 国产福利视频一区二区三区| 日韩高清一区在线| 亚洲成av人影院在线观看网| 亚洲精品一二三| 1024亚洲合集| 国产精品二三区| 国产精品麻豆网站| 精品国产sm最大网站免费看| 91精品国产综合久久精品性色| 色av成人天堂桃色av| 91丝袜美腿高跟国产极品老师| 成人性生交大片免费看视频在线| 极品少妇一区二区| 日本三级亚洲精品| 青娱乐精品视频| 蜜桃传媒麻豆第一区在线观看| 日本欧美久久久久免费播放网| 精品亚洲aⅴ乱码一区二区三区| 三级久久三级久久| 性做久久久久久久免费看| 亚洲精品久久久久久国产精华液| 亚洲三级免费观看| 一卡二卡欧美日韩| 亚洲电影你懂得| 青青草97国产精品免费观看无弹窗版| 日韩经典中文字幕一区| 久久精品国产亚洲一区二区三区| 久久se这里有精品| 国产乱国产乱300精品| 成人亚洲一区二区一| 91精品办公室少妇高潮对白| 在线区一区二视频| 欧美一区二区美女| 国产午夜亚洲精品不卡| 中文字幕国产一区| 亚洲综合色成人| 丝袜美腿一区二区三区| 国产一区二区三区免费| 成人精品鲁一区一区二区| 在线观看国产一区二区| 91精品国产福利在线观看| 久久午夜免费电影| 亚洲精品国产a久久久久久| 图片区小说区国产精品视频| 国产精品一二二区| 欧美丝袜丝交足nylons图片| 欧美一区二区三区在线| 中文字幕欧美三区| 亚洲.国产.中文慕字在线| 国产美女在线观看一区| 色先锋资源久久综合| 日韩三级.com| 亚洲免费观看高清完整版在线观看| 日韩av电影天堂| 成人av影院在线| 日韩视频中午一区| 国产精品久久精品日日| 久久精品噜噜噜成人av农村| 99久久99久久精品国产片果冻 | 成人午夜av电影| 欧美色男人天堂| 国产精品电影一区二区| 人人爽香蕉精品| 欧美伊人精品成人久久综合97| 久久影院午夜片一区| 日韩精品久久理论片| 成人av电影在线网|