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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? osfunc.asm

?? small c complier 它也Menuet OS的一個附件,同樣他也是有匯編實現(xiàn)
?? ASM
字號:
;
; OS function implementation
; SmallC for MenuetOS
;
   
;B+ General definitions
   
;B+ File defs
 ;const
  ;param
  BAD   equ -1
  files equ 100
  save_buffer equ 0x20000 ;32
  ;system
  EOF equ -1
   
 ;memory
 fileinfo     equ I_END
 start_data   equ (fileinfo+16384)
 ;
 mem_heap equ 0x100000
 ;
 g_handle equ 0x300000
  ;dword - pointer - relative to file
  ;dword - begin of file
  ;dword - file size
  ;dword - 0/1 <=> read/write
;E:.
   
;E:.
   
init_osfunc:
;B+ Init OS functions
;B+ Clear file handles
  mov  edi,g_handle
  mov  ecx,files
  shl  ecx,2 ;*4
  xor  eax,eax
  cld
rep stosd
;E:.
  ret
;E:.
   
;B+ Main OS functions
ppp dd 70
   
_OS_fopen:
;B+ Implement "fopen"
  ;esp+4 - mode
  ;esp+8 - file name
   
;  mov  eax,-1
;  int  0x40
   
;  mov  ebx,[esp+8];
; push dword 10
; push dword [ppp]
; push ebx
; push dword 12
;  call _outstrg
;  add  esp,4*4
;  add  [ppp],10
   
;  cmp  byte [ebx+8],0
;  jne .l
;  mov  byte [ebx+8],'?'
;.l:
;  cmp  [ppp],80
;  je   .l
   
;B+ Copy file name
  mov  esi,[esp+8]
  mov  edi,[p_filename]
  mov  ecx,12
.next_copy:
lodsb
  ;fill name (space)
  or   al,al
  jz   .fill_space
  ;set upper case
  cmp  al,'a'
  jb   .good_char
  cmp  al,'z'
  ja   .good_char
  add  al,'A'-'a'
.good_char:
stosb
  dec  ecx
  jnz  .next_copy
.fill_space:
  mov  al,' '
  cld
rep stosb
;E:.
;B+ Find file handle
  mov  eax,g_handle
.new_handle:
  cmp  dword [eax+4],0
  je   .find_place
  add  eax,16
  cmp  eax,g_handle+files*16-16
  jne  .new_handle
  xor  eax,eax ; no free handle
  ret
.find_place:
; TMP:  mov  eax,[.ccc]
; TMP:  add  [.ccc],16
;E:.
 push eax
;B+ Test open mode
  mov  eax,[esp+4+4]
  cmp  byte [eax],'r'
  je   .open_read
  cmp  byte [eax],'w'
  je   .open_write
  ;bad mode
  add  esp,4
  mov  eax,eax ; invalid open mode
  ret
;E:.
   
; TMP:.ccc dd g_handle
   
.open_read:
;B+ Open for read
;B+ Read file
   
  ;Wait to read correct
  mov  ebx,100
  mov  eax,5
  int  0x40
   
  mov  eax,[g_fileend]
  mov  dword [file_parameters+2*4],2000 ;read all
  mov  dword [file_parameters+3*4],eax
   
  mov  dword [file_parameters],0
  mov  ebx,file_parameters
  mov  eax,58
  int  0x40
;E:.
   
;B+ TEST FILE FOUND
  or   eax,eax
  jz   .file_found
  cmp  eax,5
  je   .file_found
   
;  mov  ecx,eax ; eax
;  mov  ebx,8 shl 16 + 0x0100
;  mov  edx,100 shl 16 + 120
;  mov  esi,0xffffff
;  mov  eax,47
;  int  0x40
   
  ;file not found - return 0
  add  esp,4
  xor  eax,eax
  ret
.file_found:
;E:.
 pop  eax
 push ebx
  xchg eax,ebx
;B+ Fill file handle
  ;save current pointer
  xor  eax,eax
  mov  [ebx],eax
   
  ;save file begin
  mov  eax,[g_fileend]
  mov  [ebx+4],eax
   
  ;save file size
 pop  eax
  mov  [ebx+8],eax
  ;reserve file zone
  add  eax,7
  and  eax,not 7
  add  [g_fileend],eax
   
  ;save file mode
  mov  eax,0 ;read
  mov  [ebx+12],eax
;E:.
  xchg eax,ebx ;return pointer place
  ret
;E:.
   
.open_write:
;B+ Open for write
;B+ Reserve filename
  mov  esi,[p_filename]
  mov  edi,[g_fileend]
  mov  ecx,12
  cld
rep movsb
  add  [g_fileend],16
;E:.
 pop  ebx
;B+ Fill file handle
  ;save begin pointer
  xor  eax,eax
  mov  [ebx],eax
   
  ;save file begin
  mov  eax,[g_fileend]
  mov  [ebx+4],eax
   
  ;save file zone
  mov  dword [ebx+8],save_buffer
  ;reserve file zone
  add  [g_fileend],save_buffer
   
  ;save file mode
  mov  eax,1 ;write
  mov  [ebx+12],eax
;E:.
  xchg eax,ebx ;return pointer place
  ret
;E:.
   
;E:.
   
_OS_fclos:
;B+ Close file
 ;esp+4 - file handle
   
;B+ Test write mode - save file
  mov  eax,[esp+4]
  mov  eax,[eax+12]
  cmp  eax,1
;E:.
  jne  .no_write
   
;B+ Copy parameters
  mov  ebx,[esp+4]
  ;file size
  mov  eax,[ebx]
  mov  dword [file_parameters+2*4],eax
  ;file begin
  mov  eax,[ebx+4]
  mov  dword [file_parameters+3*4],eax
   
;B+ Update file memory
  sub  eax,16
  mov  dword [ebx+4],eax
  add  dword [ebx+8],16
;E:.
   
  ;copy filename
  mov  esi,[ebx+4]
  mov  edi,[p_filename]
  mov  ecx,12
  cld
rep movsb
;E:.
   
;B+ Save file
   
  ;Wait to read correct
  mov  ebx,100
  mov  eax,5
  int  0x40
   
  mov  dword [file_parameters+0],1
  mov  ebx,file_parameters
  mov  eax,58
  int  0x40
;E:.
  jmp  .read
   
 .no_write:
;B+ Test read mode - if no error end
  cmp  eax,0
  je   .read
  mov  eax,BAD
  ret
;E:.
.read:
   
;B+ Relace memory
  ;find file size
  mov  eax,[esp+4]
  mov  ecx,[eax+8]
  add  ecx,7
  and  ecx,not 7
 push ecx
   
  ;mov memory
  mov  esi,[eax+4]
  mov  edi,esi
  add  esi,ecx
  mov  ecx,[g_fileend]
  sub  ecx,edi
  jz   .is_last
  shr  ecx,2
  inc  ecx ;not neccessery
  cld
rep movsd
  ;update gl. memory
.is_last:
 pop  ecx
  sub  dword [g_fileend],ecx
   
  ;update file pointers
  mov  edx,ecx
  mov  ecx,[eax+4]
  mov  eax,g_handle
.new_handle1:
  mov  ebx,[eax+4]
  cmp  ebx,ecx
  jbe  .no_update
  sub  ebx,edx
  mov  [eax+4],ebx
.no_update:
  add  eax,16
  cmp  eax,g_handle+files*16
  jne  .new_handle1
   
  ;clear handle
  mov  edi,[esp+4]
  xor  eax,eax
  cld
  stosd
  stosd
  stosd
  stosd
;E:.
  ret
;E:.
   
_OS_fgetc:
;B+ Load char from file
 ;esp+4 - input file
   
  mov  eax,[esp+4]
  mov  ebx,[eax]
  cmp  ebx,[eax+8]
  je   .eof
  inc  dword [eax]
  add  ebx,[eax+4]
  movzx eax,byte [ebx]
  ret
.eof:
  mov  eax,EOF
  ret
;E:.
   
;rrr db 'g',0
   
_OS_fputc:
;B+ Save char to file
 ;esp+4 - output file
 ;esp+8 - char to write
   
;push dword '<'
;mov  cl,1
;push dword 0
;call test_outch
;add  esp,8
   
;B+ Temp - write direct.
  cmp  dword [esp+4],__iob
  jne  .real_write0
  jmp  _OS_exit
.real_write0:
  cmp  dword [esp+4],__iob+32
  jne  .real_write1
  mov  [print_textcolor],0x00ffff
  jmp  test_outch
.real_write1:
  cmp  dword [esp+4],__iob+64
  jne  .real_write2
  mov  [print_textcolor],0x77ffff
  jmp  test_outch
.real_write2:
;E:.
   
;push dword '<'
;mov  cl,1
;push dword 0
;call test_outch
;add  esp,8
   
  mov  eax,[esp+4]
  mov  ebx,[eax]
 push ebx
  cmp  ebx,[eax+8]
  jne  .write_normal
   
;B+ Alloc save_buffer bytes
  ;mov memory
  mov  ebx,[esp+4+4]
  mov  esi,[g_fileend]
  mov  edi,esi
  add  edi,save_buffer-4
  mov  ecx,esi
  sub  ecx,[ebx+4]
  sub  ecx,[ebx+8]
  shr  ecx,2
  jz   .is_last
  sub  esi,4
  std
rep movsd
.is_last:
   
  ;expand file size
  add  dword [eax+8],save_buffer
   
  ;update file pointers
  mov  ebx,g_handle
.new_handle:
  mov  ecx,[ebx+4]
  cmp  [eax+4],ecx
  jae  .no_update
  add  dword [ebx+4],save_buffer
.no_update:
  add  ebx,16
  cmp  ebx,g_handle+files*16-16
  jne  .new_handle
;E:.
   
.write_normal:
 pop  ebx
  inc  dword [eax]
  add  ebx,[eax+4]
  mov  cl,[esp+8]
  mov  byte [ebx],cl
   
;sub  [test_outch.x_coord],2
;
;push dword '>'
;mov  cl,1
;push dword 0
;call test_outch
;add  esp,8
;
;sub  [test_outch.x_coord],6
   
  xor  eax,eax
  ret
;E:.
   
_OS_callo:
;B+ Alloc memory
  ;find all size
  mov  eax,[esp+4]
  mov  ebx,[esp+8]
  mul  ebx
 push eax
   
  ;clear memory
  mov  edi,[.mem_p]
  xor  eax,eax
  mov  ecx,[esp]
  cld
rep  stosb
   
  ;update new memory pointer
 pop  ebx
 push dword [.mem_p]
  add  ebx,7
  and  ebx,not 7
  add  [.mem_p],ebx
   
  ;return value
 pop  eax
  ret
   
.mem_p dd mem_heap
;E:.
   
_OS_exit:
;B+ Exit program
;  ;TMP
;  mov  eax,-1
;  int  0x40
  mov  esp,[exit_esp]
  sub  esp,4
  ret
;E:.
   
;E:.
   
   
   
   
;B+ Test procedures
   
;B+ Definitions
LEFTMARGIN equ 11
BEGIN_CHARS equ 20
NL equ 10
;E:.
   
print_textcolor dd 0x00ffff
   
_file_beg:
;B+ Show begin of file - test fopen
 ;esp+4 - file handle (descriptor)
   
  mov  eax,[esp+4]
  mov  ebx,10 shl 16 + 30
  mov  ecx,[print_textcolor]
  mov  edx,[eax+4]
  mov  esi,BEGIN_CHARS
  mov  eax,4
  int  0x40
  ret
;E:.
   
_outstrg:
;B+ Draw black text - test function call
 ;esp+4*4 - x
 ;esp+4*3 - y
 ;esp+4*2 - *c
 ;esp+4*1 - len
   
  mov  ebx,[esp+4*4]
  shl  ebx,16
  mov  bx,[esp+4*3]
  mov  ecx,[print_textcolor]
  mov  edx,[esp+4*2]
  mov  esi,[esp+4]
  mov  eax,4
  int  0x40
  ret
;E:.
   
test_outch:
;B+ Draw one char - use as _OS_fputc, to test printf(...)
 ;esp+8 - char to write
   
  ;this is test! \b \r - not nesessary
   
  mov  al,[esp+8]
  cmp  al,NL
  jne  .no_newline
  add  [.y_coord],10
  mov  [.x_coord],LEFTMARGIN
  ret
.no_newline:
   
  mov  ebx,[.x_coord]
  shl  ebx,16
  mov  bx,word [.y_coord]
  mov  ecx,[print_textcolor]
  mov  [.out_char],al
  mov  edx,.out_char
  mov  esi,1
  mov  eax,4
  int  0x40
   
  add  [.x_coord],6
;mov  eax,5
;mov  ebx,5
;int  0x40
  ret
   
.x_coord dd LEFTMARGIN
.y_coord dd 60
.out_char db 0
;E:.
   
;E:.
   
;B+ Data section
;B+ Memory managment
g_fileend dd g_handle+files*4*4 ;from 2MB+100*4*4
   
;E:.
   
;B+ File parameters
file_parameters:
 dd 0x0 ; mode
 dd 0x0  ; first block
 dd 1000 ; block read
 dd -1   ; return place
 dd fileinfo ; work area
filepath: times 100 db 0
   
p_filename dd 0x0
;E:.
;E:.
   
  ;TO DO
  mov  eax,-1
  int  0x40
  ;TO DO
   
   

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜精品久久| 中文字幕在线观看不卡| 久久久三级国产网站| 久久综合一区二区| 自拍偷自拍亚洲精品播放| 亚洲成av人片在线观看无码| 美日韩黄色大片| 国产精品亚洲一区二区三区妖精| av电影天堂一区二区在线| 欧美艳星brazzers| 久久综合丝袜日本网| 亚洲综合久久久| 美女尤物国产一区| 91国模大尺度私拍在线视频| 91精品久久久久久蜜臀| 中文字幕免费不卡| 日韩电影在线一区| 暴力调教一区二区三区| 日韩精品一区二区三区在线观看| 国产精品三级av| 美腿丝袜亚洲一区| 成人av网站在线观看| 欧美一区二区三区思思人| 国产精品视频麻豆| 国产一区二区免费看| 欧美性生活一区| 国产精品久久久一区麻豆最新章节| 午夜视频一区在线观看| 99精品视频在线观看免费| 日韩欧美一二区| 亚洲va欧美va天堂v国产综合| 成人黄色国产精品网站大全在线免费观看 | 国产一区二区网址| 欧美一区二区三级| 亚洲国产视频在线| 色综合久久久久久久久| 欧美激情一区不卡| 国产成人精品免费看| 精品剧情在线观看| 麻豆精品视频在线观看视频| 欧美日韩高清一区二区| 亚洲女与黑人做爰| 91老师片黄在线观看| 国产精品国产三级国产普通话99| 久久 天天综合| 欧美一区二区网站| 亚洲综合清纯丝袜自拍| 色哦色哦哦色天天综合| 日韩毛片在线免费观看| 成人午夜大片免费观看| 国产福利一区二区三区视频在线| 一区二区三区波多野结衣在线观看| 色综合网色综合| 欧美成人精品福利| 日本女人一区二区三区| 日韩一区二区三区电影在线观看 | 久久久久久久久久看片| 国产剧情av麻豆香蕉精品| 欧美一级日韩不卡播放免费| 日韩黄色一级片| 欧美一级片在线看| 老司机精品视频导航| 精品久久久久久久久久久久包黑料| 日韩电影在线观看网站| 欧美电视剧免费观看| 精品亚洲免费视频| 久久婷婷色综合| 成人免费的视频| 国产视频一区在线观看| 国产精品 欧美精品| 国产欧美一区二区精品仙草咪| 成人性生交大片免费看中文网站| 国产精品理论片在线观看| 在线观看一区二区精品视频| 丝袜a∨在线一区二区三区不卡| 欧美一区二区三级| 国产精品白丝jk白祙喷水网站| 国产精品美女久久福利网站| 91丨porny丨中文| 亚洲成人久久影院| 欧美va在线播放| gogogo免费视频观看亚洲一| 亚洲国产精品嫩草影院| 欧美成人aa大片| 99久久久久久| 婷婷成人综合网| 国产三级精品三级在线专区| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 日韩精品福利网| 2020国产精品| www.亚洲在线| 奇米精品一区二区三区四区 | 制服.丝袜.亚洲.另类.中文| 国产乱色国产精品免费视频| 亚洲欧美自拍偷拍| 欧美夫妻性生活| 成人免费高清在线| 男男视频亚洲欧美| 亚洲欧美另类小说视频| 欧美大片国产精品| 欧美性生活影院| 大尺度一区二区| 蜜桃av噜噜一区二区三区小说| 国产精品污网站| 欧美一级高清大全免费观看| 日韩电影在线观看一区| 国产精品三级在线观看| 日韩欧美国产综合一区| 在线中文字幕一区| 成人h精品动漫一区二区三区| 日日夜夜精品视频天天综合网| 一区二区中文字幕在线| 亚洲精品一区二区三区香蕉| 欧美日韩久久久久久| 成人美女在线视频| 激情都市一区二区| 五月开心婷婷久久| 亚洲欧美精品午睡沙发| 中文字幕精品一区二区三区精品| 在线电影一区二区三区| 91豆麻精品91久久久久久| 成人av午夜影院| 国产91对白在线观看九色| 国产一区二区三区黄视频| 婷婷夜色潮精品综合在线| 一区二区三区成人| 一区视频在线播放| 国产精品久久毛片av大全日韩| 久久综合五月天婷婷伊人| 日韩精品专区在线影院观看| 7777女厕盗摄久久久| 欧美精品v日韩精品v韩国精品v| 色狠狠一区二区三区香蕉| 91丨porny丨首页| 99精品黄色片免费大全| 99久久er热在这里只有精品15| 国产成人三级在线观看| 国产精品主播直播| 韩国欧美国产1区| 国产一区二区91| 国产成人精品一区二| 国产91在线观看丝袜| av电影天堂一区二区在线观看| 成人国产免费视频| 91视视频在线直接观看在线看网页在线看| 国产成人精品aa毛片| 国内精品国产成人国产三级粉色| 激情六月婷婷久久| 不卡av免费在线观看| 91豆麻精品91久久久久久| 欧美xxxxx牲另类人与| 国产精品久久久久一区| 日韩精品久久理论片| 丁香啪啪综合成人亚洲小说| 欧美日韩国产精品成人| 国产嫩草影院久久久久| 亚洲福利视频三区| 成人在线视频一区二区| 欧美美女直播网站| 国产婷婷色一区二区三区在线| 亚洲精品视频一区二区| 国产美女av一区二区三区| 色狠狠av一区二区三区| 精品国产三级a在线观看| 亚洲区小说区图片区qvod| 麻豆成人久久精品二区三区小说| jlzzjlzz欧美大全| 久久男人中文字幕资源站| 亚洲成人av一区二区| 大陆成人av片| 精品美女在线观看| 亚洲国产人成综合网站| www.欧美精品一二区| 久久综合久色欧美综合狠狠| 亚洲成人www| 在线观看网站黄不卡| 中文字幕欧美日本乱码一线二线| 蜜臀久久久99精品久久久久久| 成人18精品视频| 久久精品亚洲乱码伦伦中文| 五月开心婷婷久久| 日本乱人伦一区| 亚洲色图.com| 成人免费毛片片v| 久久一二三国产| 麻豆国产一区二区| 日韩午夜在线影院| 日韩国产在线观看一区| 精品视频在线免费看| 亚洲综合男人的天堂| 色综合久久久久| 玉米视频成人免费看| 一本到一区二区三区| 最新中文字幕一区二区三区| 成人蜜臀av电影| 中文字幕一区二区在线观看| 午夜伊人狠狠久久| 不卡电影一区二区三区| 中文子幕无线码一区tr| 国产成人av福利|