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

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

?? xfileio.asm

?? 視頻游戲開發(fā)C語言源程序
?? ASM
字號:
;-----------------------------------------------------------------------
; MODULE XFILEIO
;
; Sequential binary file I/O functions
;
; Some functions based on a r.g.p post by Joshua Jensen
;
; Compile with Tasm.
; C callable.
;
;
; ****** XLIB - Mode X graphics library                ****************
; ******                                               ****************
; ****** Written By Themie Gouthas                     ****************
;
; egg@dstos3.dsto.gov.au
; teg@bart.dsto.gov.au
;-----------------------------------------------------------------------
COMMENT $


$

LOCALS
.286

include model.inc
include xfileio.inc
	.data

	_file_err dw (?)  ; error value

	.code

PUSH_DS macro
    IFNDEF s
    push  ds
    ENDIF
    endm

POP_DS macro
    IFNDEF s
    pop   ds
    ENDIF
    endm

LDS_M macro arg1,arg2
    IFNDEF s
    lds &arg1&,&arg2&
    ELSE
    mov &arg1&,word ptr &arg2&
    ENDIF
    endm



;****************************************************************
;
; name: f_open
;
; C Prototype:
;
;     extern int f_open(char * filename, char access)
;
; Opens a file according to the access char:
;
;   0 = read only   - If doesnt exist return error
;   1 = write only  - If doesnt exist create it otherwise clear it
;   2 = read/write  - If doesnt exist create it
;
; Returns the file handle on success, -1 on failure
;
;
proc _f_open
IFNDEF s
  ARG   filename:dword,access:byte
ELSE
  ARG   filename:word,access:byte
ENDIF
	push  bp             ; Preserve caller's stack frame
	mov   bp,sp
	PUSH_DS
	LDS_M dx,[filename]  ; point DS:DX to file name string
	mov  [_file_err],0
	cmp   [access],1
	je    @@creat

	mov   ah,3dh         ; select "open file" DOS service
	mov   al,[access]    ; select access type code
	int   21h            ; call DOS service
	jnb   @@Done         ; If carry flag set we have failed


	cmp   [access],2
	jne   @@error
@@creat:
	mov   ah,3ch         ; select "creat file" DOS service
	mov   cx,0
	int   21h            ; call DOS service
	jnb   @@Done         ; If carry flag set we have failed
@@error:
	mov   [_file_err],ax
	mov   ax,-1          ;  indicate failure
@@Done:                      ; otherwise return file handle
	POP_DS
	pop  bp              ;restore caller's stack frame
	ret
_f_open endp


;****************************************************************
;
; name: f_close
;
; C Prototype:
;
;     extern int f_close(int handle)
;
; Closes the file associated with the specified handle
;
; Returns 0 on success, -1 on failure
;
proc _f_close
ARG   handle:word
	push bp             ; Preserve caller's stack frame
	mov  bp,sp

        mov  [_file_err],0  ; Clear error
	mov  ah,3eh         ; select  "close file handle" DOS service
	mov  bx,[handle]    ; select handle of file to close
	int  21h            ; call DOS service
	jnb  @@Fix          ; failed if carry flag set
	mov   [_file_err],ax;
	mov  ax,-1          ;  return error
	jmp  short @@Done
@@Fix:                      ; otherwise
	xor  ax,ax          ;  return 0
@@Done:
	pop  bp             ;restore caller's stack frame
	ret
_f_close endp


;****************************************************************
;
; name: f_read
;
; C Prototype:
;
;     extern int f_read(int handle, char  *buffer, int count)
;
; Reads a block of count bytes from the file specified by the handle
; into the buffer
;
; Returns count on success, failure is detectable via _file_err
;
proc _f_read
IFNDEF s
  ARG   handle:word,buffer:dword,count:word
ELSE
  ARG   handle:word,buffer:word,count:word
ENDIF
	push bp             ; Preserve caller's stack frame
	mov  bp,sp
	PUSH_DS

        mov   [_file_err],0  ; Clear error
	mov   ah,3fh         ; select "read from file or device" DOS service
	mov   bx,[handle]    ; select handle of file to close
	mov   cx,[count]
	LDS_M dx,[buffer]
	int   21h            ; call DOS service
	jnb   @@Done         ; failed if carry flag set
	mov   [_file_err],ax
	xor   ax,ax          ;  return error
	jmp   short @@Done
@@Done:
	POP_DS
	pop  bp             ;restore caller's stack frame
	ret
_f_read endp

;****************************************************************
;
; name: f_write
;
; C Prototype:
;
;     extern int f_write(int handle, char *buffer, int count)
;
; Writes a block of count bytes to the file specified by the handle
; from the buffer
;
; Returns count on success, error is indicated by _file_err iff count = 0
;
proc _f_write
IFNDEF s
  ARG   handle:word,buffer:dword,count:word
ELSE
  ARG   handle:word,buffer:word,count:word
ENDIF
	push bp             ; Preserve caller's stack frame
	mov  bp,sp
	PUSH_DS

        mov   [_file_err],0  ; Clear error
	mov   ah,40h         ; select "write to file or device" DOS service
	mov   bx,[handle]    ; select handle of file to write
	mov   cx,[count]
	LDS_M dx,[buffer]
	int   21h            ; call DOS service
	jnb   @@Done         ; has the function failed ?
	mov   [_file_err],ax
	xor   ax,ax          ;  yes, return error
	jmp   short @@Done
@@Done:                      ; otherwise return bytes written
	POP_DS
	pop  bp              ; restore caller's stack frame
	ret
_f_write endp

;****************************************************************
;
; name: f_readfar
;
; C Prototype:
;
;     extern int f_readfar(int handle, char far * buffer, int count)
;
; Reads a block of count bytes from the file specified by the handle
; into the buffer
;
; Returns count on success, failure is detectable via _file_err
;
proc _f_readfar
ARG   handle:word,buffer:dword,count:word
	push bp             ; Preserve caller's stack frame
	mov  bp,sp
	push ds

        mov  [_file_err],0  ; Clear error
	mov  ah,3fh         ; select "read from file or device" DOS service
	mov  bx,[handle]    ; select handle of file to close
	mov  cx,[count]
	lds  dx,[buffer]
	int  21h            ; call DOS service
	jnb  @@Done         ; failed if carry flag set
	mov  [_file_err],ax
	xor  ax,ax          ;  return error
	jmp  short @@Done
@@Done:
	pop  ds
	pop  bp             ;restore caller's stack frame
	ret
_f_readfar endp

;****************************************************************
;
; name: f_writefar
;
; C Prototype:
;
;     extern int f_writefar(int handle, char far * buffer, int count)
;
; Writes a block of count bytes to the file specified by the handle
; from the buffer
;
; Returns count on success, error is indicated by _file_err iff count = 0
;
proc _f_writefar
ARG   handle:word,buffer:dword,count:word
	push bp             ; Preserve caller's stack frame
	mov  bp,sp
	push ds

        mov  [_file_err],0  ; Clear error
	mov  ah,40h         ; select "write to file or device" DOS service
	mov  bx,[handle]    ; select handle of file to write
	mov  cx,[count]
	lds  dx,[buffer]
	int  21h            ; call DOS service
	jnb  @@Done         ; has the function failed ?
	mov  [_file_err],ax
	xor  ax,ax          ;  yes, return error
	jmp  short @@Done
@@Done:                     ; otherwise return bytes written
	pop  ds
	pop  bp             ; restore caller's stack frame
	ret
_f_writefar endp



;****************************************************************
;
; name: f_seek
;
; C Prototype:
;
;   extern long int f_seek(int handle, long int position, char method_code)
;
; Moves the file pointer according to the position and method code
;
; Returns file pointer position on success, -1 on failure
;
proc _f_seek
ARG   handle:word,position:dword,method_code:byte
	push bp             ; Preserve caller's stack frame
	mov  bp,sp

        mov  [_file_err],0  ; Clear error
	mov  ah,42h         ; select "move file pointer" DOS service
	mov  bx,[handle]    ; select handle of file to close
	mov  al,[method_code]
	mov  cx,word ptr [position+2]
	mov  dx,word ptr [position]
	int  21h            ; call DOS service
	jnb  @@Done         ; has the function failed ?
	mov  [_file_err],ax
	mov  ax,-1          ;  yes, return error
	mov  dx,-1          ;
	jmp  short @@Done
@@Done:                     ; otherwise return bytes written
	pop  bp             ; restore caller's stack frame
	ret
_f_seek endp

;****************************************************************
;
; name: f_tell
;
; C Prototype:
;
;   extern long int f_tell(int handle)
;
; Returns file pointer position on success, -1 on failure
;
proc _f_tell
ARG   handle:word,position:dword,method_code:byte
	push bp             ; Preserve caller's stack frame
	mov  bp,sp

	mov  [_file_err],0  ; Clear error
	mov  ah,42h         ; select "move file pointer" DOS service
	mov  bx,[handle]    ; select handle of file to close
	xor  dx,dx
	mov  cx,dx
	int  21h
	jnb  @@Done
	mov  [_file_err],ax
	mov  ax,-1          ;  yes, return error
	mov  dx,-1          ;
	jmp  short @@Done
@@Done:                     ; otherwise return bytes written
	pop  bp             ; restore caller's stack frame
	ret
_f_tell endp


;****************************************************************
;
; name: f_filelength
;
; C Prototype:
;
;   extern long int f_filelength(int handle)
;
; Returns the length of the file associated with the specified handle
;
; Returns file length on success, -1 on failure
;
proc _f_filelength
ARG     handle:word
LOCAL   low:word,high:word=LocalStk
	push bp             ; Preserve caller's stack frame
	mov  bp,sp
	sub  sp,LocalStk

	mov  [_file_err],0  ; Clear error

	; Get ptr's current location in file and save it

	mov  ah,42h         ; select "move file pointer" DOS service
	mov  al,1           ; select "from current location" method
	mov  bx,[handle]    ; select handle of file to close
	xor  cx,cx
	xor  dx,dx
	int  21h
	jb   @@Error
	mov  [low],ax
	mov  [high],dx

	; Get ptr's value at end of file

	mov  ah,42h         ; select "move file pointer" DOS service
	mov  al,2           ; select "from end of file" method
	mov  bx,[handle]    ; select handle of file to close
	xor  cx,cx
	xor  dx,dx
	int  21h
	jb   @@Error

	; Save the results while returning pointer to its previous location

	push ax
	push dx

	mov  ah,42h         ; select "move file pointer" DOS service
	mov  al,0           ; select "from start of file" method
	mov  bx,[handle]    ; select handle of file to close
	mov  cx,[high]
	mov  dx,[low]
	int  21h

	; restore resultant length

	pop  dx
	pop  ax

	jnb   @@Done        ; Was the operation a success ?
@@Error:
	mov  [_file_err],ax
	mov  ax,-1          ;  no, return error
	mov  dx,-1          ;
@@Done:                     ; otherwise return bytes written
	mov  sp,bp
	pop  bp             ; restore caller's stack frame
	ret
_f_filelength endp


	end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一三区三区四区免费在线看| 91在线精品一区二区三区| 欧美日本视频在线| 午夜激情一区二区| 日韩一级黄色片| 精品一区二区三区在线视频| 久久先锋影音av鲁色资源 | 亚洲一区二区欧美日韩| 在线区一区二视频| 日本成人在线不卡视频| 久久久久久久久久久久电影| 国产成人aaa| 亚洲成人先锋电影| 日韩免费视频一区| www.av精品| 性做久久久久久久免费看| 日韩视频中午一区| 国产91在线看| 亚洲尤物视频在线| 精品国产乱码久久久久久老虎| 国产成人精品三级| 亚洲第一av色| 久久久噜噜噜久噜久久综合| 一本色道久久加勒比精品| 日日欢夜夜爽一区| 中文字幕高清不卡| 欧美日韩和欧美的一区二区| 国产自产2019最新不卡| 一区二区三区日韩| 久久一日本道色综合| 在线观看不卡一区| 国产精品自拍毛片| 天堂在线亚洲视频| 中文字幕在线不卡| 日韩欧美成人午夜| 色综合婷婷久久| 国产精品资源站在线| 亚洲成人一区二区在线观看| 欧美国产日韩a欧美在线观看| 欧美三级在线看| 国产福利不卡视频| 秋霞成人午夜伦在线观看| 国产精品乱码人人做人人爱| 日韩亚洲欧美高清| 在线视频欧美区| 懂色一区二区三区免费观看| 日产欧产美韩系列久久99| 亚洲欧美一区二区三区极速播放 | 精品国内二区三区| 在线中文字幕不卡| 成人短视频下载| 麻豆精品国产91久久久久久| 亚洲一区二区视频| 国产精品久久久久国产精品日日| 日韩欧美一二区| 欧美日韩国产在线观看| 91麻豆国产福利在线观看| 国产剧情一区在线| 美女精品一区二区| 丝袜美腿亚洲综合| 亚洲成人你懂的| 亚洲精品久久嫩草网站秘色| 中文文精品字幕一区二区| 精品久久久久久亚洲综合网| 在线播放视频一区| 欧美美女视频在线观看| 91成人免费在线视频| 日本乱码高清不卡字幕| 丁香啪啪综合成人亚洲小说 | 偷拍日韩校园综合在线| 亚洲猫色日本管| 亚洲欧洲一区二区在线播放| 国产日韩欧美制服另类| 国产日产欧美精品一区二区三区| 亚洲精品在线三区| 26uuu另类欧美| 日韩免费观看高清完整版| 日韩欧美国产1| 欧美变态tickling挠脚心| 日韩免费看网站| 久久综合九色综合欧美就去吻| 欧美一区二区国产| 欧美精品一区二区不卡| 久久影视一区二区| 国产精品视频看| 国产精品久久久久久妇女6080| 亚洲欧美在线aaa| 亚洲女人小视频在线观看| 一区二区三国产精华液| 亚洲一区二区视频| 日本欧美一区二区三区乱码| 免费成人深夜小野草| 国产呦萝稀缺另类资源| 国产suv精品一区二区三区| 99免费精品视频| 日韩免费高清电影| 久久青草欧美一区二区三区| 久久久国产精华| 国产精品久久一卡二卡| 一区二区三区**美女毛片| 天堂va蜜桃一区二区三区漫画版| 久久99精品久久久| 成人免费视频播放| 欧美天天综合网| 日韩欧美一区中文| 国产三级精品三级在线专区| 亚洲码国产岛国毛片在线| 日韩黄色一级片| 处破女av一区二区| 在线观看网站黄不卡| 欧美不卡视频一区| 国产精品女同互慰在线看| 一区二区在线观看免费| 美女一区二区在线观看| www.在线成人| 欧美一区二区黄色| 日韩一区中文字幕| 久久99国产精品久久99| 91免费在线视频观看| 日韩一区二区三区电影| 国产精品乱码妇女bbbb| 免费一区二区视频| 91色在线porny| 欧美成人video| 亚洲国产一区二区a毛片| 国产一区 二区| 精品1区2区3区| 欧美国产精品专区| 免费在线看成人av| 色婷婷精品久久二区二区蜜臀av| 日韩免费高清视频| 亚洲国产精品麻豆| 成人午夜大片免费观看| 91麻豆精品国产91久久久久 | 亚洲精品视频在线看| 极品美女销魂一区二区三区免费 | 亚洲男人天堂一区| 国精品**一区二区三区在线蜜桃| 91福利国产成人精品照片| 国产亚洲成年网址在线观看| 视频一区中文字幕国产| 94-欧美-setu| 国产午夜亚洲精品不卡| 免费久久精品视频| 欧美视频在线播放| 伊人色综合久久天天人手人婷| 国产精品影视在线观看| 欧美一二三区在线观看| 一级特黄大欧美久久久| www.爱久久.com| 欧美激情在线观看视频免费| 久久99精品国产91久久来源| 欧美日韩久久久一区| 一区二区三区在线播| 成人性视频免费网站| 2023国产精品| 九九在线精品视频| 欧美成人午夜电影| 蜜臀av性久久久久蜜臀av麻豆| 欧美性videosxxxxx| 亚洲色大成网站www久久九九| 成人在线一区二区三区| 国产欧美久久久精品影院| 国产精品一区二区久久精品爱涩| 欧美一区二区三区不卡| 免费高清视频精品| 日韩美女一区二区三区四区| 日本欧美久久久久免费播放网| 欧美三级电影精品| 亚洲理论在线观看| 欧洲av一区二区嗯嗯嗯啊| 亚洲一区免费观看| 欧美在线免费播放| 亚洲成人资源在线| 欧美一级日韩不卡播放免费| 美女视频网站黄色亚洲| 久久综合精品国产一区二区三区| 国精产品一区一区三区mba视频| 欧美成人精品福利| 国产成人一区在线| 国产精品国产自产拍高清av王其| 成人黄页毛片网站| 一区二区三区自拍| 欧美三级中文字幕| 精品一区二区三区免费毛片爱| 26uuu亚洲| 99久免费精品视频在线观看| 亚洲欧洲中文日韩久久av乱码| 欧美日韩一区二区三区四区五区| 丝袜a∨在线一区二区三区不卡| 91精品国产福利在线观看| 国内成人精品2018免费看| 国产精品久久久久永久免费观看| bt欧美亚洲午夜电影天堂| 亚洲永久免费av| 欧美va亚洲va| www.66久久| 亚洲成av人片一区二区梦乃 | 国产精品一卡二| 亚洲人成亚洲人成在线观看图片|