1 / 29

Irvin32.LIB

Irvin32.LIB. 程式庫說明. 程式庫說明  組成. 輸出功能 資料輸出 輸入功能 鍵盤輸入 控制處理系統資訊控制 控制處理常用資訊處理. 輸出功能 資料輸出. Waitmsg Writebin Writechar Writedec Writehex Writeint Writestring. 輸入功能 鍵盤輸入. Readchar Readhex Readint Readstring. 控制處理系統資訊控制. Clrscr Clrf Delay Gotoxy Settextcolor. 控制處理常用資訊處理.

dudley
Télécharger la présentation

Irvin32.LIB

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Irvin32.LIB 程式庫說明

  2. 程式庫說明組成 • 輸出功能資料輸出 • 輸入功能鍵盤輸入 • 控制處理系統資訊控制 • 控制處理常用資訊處理

  3. 輸出功能資料輸出 • Waitmsg • Writebin • Writechar • Writedec • Writehex • Writeint • Writestring

  4. 輸入功能鍵盤輸入 • Readchar • Readhex • Readint • Readstring

  5. 控制處理系統資訊控制 • Clrscr • Clrf • Delay • Gotoxy • Settextcolor

  6. 控制處理常用資訊處理 • Dumpmem • Dumpregs • Getcommandtail • Getmseconds • Random32 • Randomize • Randomrang

  7. Clrscr 相關函數: Clrf Gotoxy Settextcolor 函數功能: 清除銀幕。 函數用法: call Clrscr 傳入參數:無 回傳參數:無 函數範例: ;清除銀幕資料。 call Clrscr

  8. Clrf 相關函數: Clrscr Gotoxy Settextcolor Readstring 函數功能: 游標換行回頭(跳至下一行, 或印空白行)。 函數用法: call Clrf 傳入參數:無 回傳參數:無 函數範例: ;游標換行回頭。 call Clrf

  9. Delay 相關函數: Dumpregs Getcommandtail Getmseconds Random32 Randomize 函數功能: 暫停程式執行,產生以毫秒(ms)計算之延遲。 函數用法: mov eax,暫停毫秒數 call delay 傳入參數: EAX,暫停之毫秒數。 回傳參數:無 函數範例: ;暫停1000毫秒=1秒。 mov eax, 1000 call delay

  10. Dumpmem 相關函數: Dumpregs Getcommandtail Random32 Randomize Randomrang 函數功能: 以Hex格式輸出一段範圍之記憶體內容。 ESI: 記憶體開始位址 ECX: 輸出個數 EBX: 輸出單位,1:byte,2:word,4:Dwd 函數用法: call Clrscr 傳入參數: ESI開始位址, ECX個數, EBX: 輸出單位,(1/2/4) 。 回傳參數:無 函數範例: ;輸出array array dword 1,2,3,4,5 mov esi, offset array mov ecx, lengthof array mov ebx, type array call Dumpmem

  11. Dumpregs 相關函數: Dumpmem Getcommandtail Random32 Randomize Randomrang 函數功能: 輸出目前運算結果之CPU暫存器值。 EIP=呼叫Dumpregs之下一指令 可用於偵錯。 函數用法: call Dumpregs 傳入參數:無 回傳參數:無 函數範例: ;清除銀幕資料。 call Dumpregs

  12. Getcommandtail 相關函數: Dumpmem Dumpregs Getcommandtail Getmseconds 函數功能: 將程式之命令列複製於edx所指之位址。 Edx=offset buffer Buffer byte 129 DUP(0) 函數用法: call getcommandtail 傳入參數: edx:儲存位址之偏移值 回傳參數: 命令列字串 函數範例: .data cmd byte 129 DUP(0) .code mov edx, offset cmd call getcommandtail ;cmd=命令列字串。

  13. Getmseconds 相關函數: Dumpmem Dumpregs Getmseconds Delay 函數功能: 讀取系統以毫秒計時之時間。 可以應用於估算程式執行時間。 函數用法: call getmseconds 傳入參數:無 回傳參數: eax=毫秒數。 函數範例: .data Starttime dword ? .code call getmseconds mov starttime,eax call test ;計算test之執行時間。 call getmseconds sub eax, starttime

  14. Gotoxy 相關函數: Clrscr Clrf Settextcolor Writestring Readstring 函數功能: 將游標移至指定之文字座標。 X軸0~79 Y軸0~24 函數用法: call gotoxy 傳入參數: dh: Y軸(列) dl: X軸(行) 回傳參數:無 函數範例: ;游標移至座標(20,10)(行列)。 mov dh, 10 mov dl, 20 call gotoxy

  15. Random32 相關函數: Dumpmem Dumpregs Randomize Randomrang 函數功能: 產生32位元之亂數。 需應用randomize產生亂數種子。 若不更動亂數種子,亂數序列將不更動。 函數用法: call random32 傳入參數:無 回傳參數: eax =所產生之亂數。 函數範例: ;清除銀幕資料。 ,data randval dword ? .code call random32 mov randval, eax

  16. Randomize 相關函數: Dumpmem Dumpregs Random32 Randomrang 函數功能: 應用系統時間函數,產生亂數運算所需之亂數種子。供 Random32 與 randomrang使用。 函數用法: call randomize 傳入參數:無 回傳參數:無 函數範例: ;產生十組亂數。 call randomize mov ecx,10 L1: call random32 ; 儲存eax亂數值 loop L1

  17. Randomrang 相關函數: Dumpmem Dumpregs Random32 Randomize 函數功能: 產生0~(n-1)之亂數。 需應用randomize產生亂數種子。 範圍n 由EAX設定 函數用法: call randomrang 傳入參數: EAX=n 回傳參數:eax =所產生之亂數 函數範例: ,data randval dword ? .code mov eax,5000 call randomrang ;產生0~4999之亂數 mov randval, eax

  18. Readchar 相關函數: Readhex Readint Readstring Writechar Writestring 函數功能: 由鍵盤輸入一字元,該字元不顯示於銀幕。 輸入時只由鍵盤讀取一字元。 函數用法: call readchar 傳入參數:無 回傳參數: al=輸入之字元。 函數範例: ;由鍵盤輸入一字元。 .data ch byte ? .code call readchar mov ch,al

  19. Readhex 相關函數: Readchar Readint Readstring Writehex Writestring 函數功能: 由鍵盤輸入32位元之Hex格式之資料 。 並不會檢查數字之正確性。 函數用法: call readhex 傳入參數:無 回傳參數: eax=輸入之數值。 函數範例: ;由鍵盤輸入一Hex數字。 .data hexval dword ? .code call readhex mov hexval, eax

  20. Readint 相關函數: Readchar Readhex Readstring Writeint Writestring 函數功能: 由鍵盤輸入32位元之有號數之數值資料 。超出範圍(-2,147,483,648 ~ +2,147,483,647)顯示錯誤訊息。 函數用法: call readint 傳入參數:無 回傳參數: eax=輸入之數值。 函數範例: ;由鍵盤輸入一Hex數字。 .data intval SDword ? .code call readint mov intval, eax

  21. Readstring 相關函數: Readchar Readhex Readint Writestring 函數功能: 由鍵盤輸入字串。 函數用法: call readstring 傳入參數: edx=buffer之偏移值 Ecx=最大字元數=sizeof(buffer)-1 回傳參數: buffer=輸入字串。 Eax=字串字元數。 函數範例: .data buffer byte 50 DUP(0) bytecount dword ? .code mov edxoffset buffer mov ecx, (sizeof buffer)-1 call readstring mov bytecount, eax

  22. Settextcolor 相關函數: Clrscr Clrf Gotoxy Writeint Writestring 函數功能: 設定文字顏色。 黑=0 紅=4 灰=8 淡紅=12 藍=1 洋紅=5 淡藍=9 淡洋紅=13 绿=2 棕=6 淡绿=10 黃=14 青绿=3 淡灰=7 淡青绿=11 白=15 函數用法: call settextcolor 傳入參數: eax=顏色設定 Eax=前景顏色+顏色背景*16 回傳參數:無 函數範例: ;白色字藍底。 ; mov eax, white+(blue*16) mov eax, 15+(1*16) call settextcolor

  23. Waitmsg 相關函數: Writechar Writestring Gotoxy Settextcolor 函數功能: 程式停止執行,等待輸入[enter]。 並顯示”press[enter] to continue…”。 函數用法: call waitmsg 傳入參數:無 回傳參數:無 函數範例: ;程式停止執行等待輸入[enter]。 call waitmsg

  24. Writebin 相關函數: Readhex Waitmsg Writechar Writehex Writestring 函數功能: 輸出32bit資料,以binary之格式。 函數用法: call writebin 傳入參數: eax=待輸出資料 回傳參數:無 函數範例: ;以binary之格式輸出資料。 mov eax, 17 call writebin

  25. Writechar 相關函數: Readchar Waitmsg Writebin Writeint Writestring 函數功能: 輸出一字元。 函數用法: call writechar 傳入參數: al=待輸出之字元 回傳參數:無 函數範例: ;輸出’a’。 mov al, ‘a’ call writechar

  26. Writedec 相關函數: Readint Waitmsg Writebin Writehex Writestring 函數功能: 輸出32bit之無號整數 (十進位格式)。 函數用法: call Clrscr 傳入參數: eax=待輸出數值 回傳參數:無 函數範例: ;輸出295。 mov eax, 295 call writedec

  27. Writehex 相關函數: Readhex Waitmsg Writebin Writehex 函數功能: 輸出32bit之整數 (十六進位格式)。 函數用法: call writehex 傳入參數: eax =待輸出數值 回傳參數:無 函數範例: ;輸出7FFFh。 mov eax, 7FFFh call writehex

  28. Writeint 相關函數: Readint Waitmsg Writestring 函數功能: 輸出32bit之有號整數 (十進位格式)。 函數用法: call writeint 傳入參數:eax =待輸出數值 回傳參數:無 函數範例: ;輸出216543。 mov eax, 216543 call writeint

  29. Writestring 相關函數: Readchar Readstring Waitmsg Writechar Writestring 函數功能: 輸出字串,字串須以null(數值=0)結尾。 函數用法: call writestring 傳入參數: edx=字串之偏移值 回傳參數:無 函數範例: ;輸出prompt。 .data prompt byte ”enter your name:“,0 .code mov edx, offset prompt call writestring

More Related