博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Irvine32.inc[汇编]

Posted on 2011-04-03 18:00  Code_HXH  阅读(3507)  评论(0编辑  收藏  举报
1 ; Include file for Irvine32.lib (Irvine32.inc)
2
3 ;OPTION CASEMAP:NONE ; optional: make identifiers case-sensitive
4
5 INCLUDE SmallWin.inc ; MS-Windows prototypes, structures, and constants
6 INCLUDE VirtualKeys.inc
7
8 .NOLIST
9 ; Last update: 7/29/05
10
11 ;----------------------------------------
12 ; Procedure Prototypes
13 ;----------------------------------------
14 CloseFile PROTO ; close a file handle
15 Clrscr PROTO ; clear the screen
16 CreateOutputFile PROTO ; create file for writing
17 Crlf PROTO ; output carriage-return / linefeed
18 Delay PROTO ; delay for n milliseconds
19 DumpMem PROTO ; display memory dump
20 DumpRegs PROTO ; display register dump
21 GetCommandTail PROTO ; get command-line string
22 GetDateTime PROTO, ; get system date and time
23 startTime:PTR QWORD
24 GetMaxXY PROTO ; get console rows and columns
25 GetMseconds PROTO ; get milliseconds past midnight
26 GetTextColor PROTO ; Get the console window's color attributes.
27 Gotoxy PROTO ; set the cursor position
28 IsDigit PROTO ; return ZF=1 if AL is a decimal digit
29 MsgBox PROTO ; display popup message box
30 MsgBoxAsk PROTO ; display popup yes/no question box
31 OpenInputFile PROTO ; open file in input mode
32 ParseDecimal32 PROTO ; convert unsigned decimal string to 32-bit binary
33 ParseInteger32 PROTO ; convert signed decimal string to 32-bit binary
34 Randomize PROTO ; reseed random number generator
35 RandomRange PROTO ; generate random integer in specified range
36 Random32 PROTO ; generate 32-bit random integer
37 ReadInt PROTO ; read signed decimal integer from console
38 ReadChar PROTO ; reach single character from console
39 ReadDec PROTO ; read unsigned decimal integer from console
40 ReadFloat PROTO ; read floating-point value from keyboard
41 ReadFromFile PROTO ; read buffer from input file
42 ReadHex PROTO ; read hexadecimal integer from console
43 ReadKey PROTO ; Reads keyboard input if available (4/6/03)
44 ReadKeyFlush PROTO ; Flush ReadKey buffer and repeat counter (4/6/03)
45 ReadString PROTO ; read string from console
46 SetTextColor PROTO ; set console text color
47 ShowFPUStack PROTO ; write floating-point stack to console window
48 StrLength PROTO ; returns the length of a string
49 WaitMsg PROTO ; display wait message, wait for Enter key
50 WriteBin PROTO ; write integer to output in binary format
51 WriteBinB PROTO ; write binary integer in byte, word,or doubleword format
52 WriteChar PROTO ; write single character to output
53 WriteDec PROTO ; write unsigned decimal integer to output
54 WriteFloat PROTO ; write ST(0) to console in floating-point format
55 WriteHex PROTO ; write hexadecimal integer to output
56 WriteHexB PROTO ; write hexadecimal integer in word or doubleword format
57 WriteInt PROTO ; write signed integer to output
58 ;WriteStackFrame ; write stack frame data (James Brink--see proto later in this file)
59 ;WriteStackFrameName ; write stack frame data with proc name (James Brink)
60 WriteString PROTO ; write null-terminated string to output
61 WriteToFile PROTO ; write a buffer to an output file
62 WriteWindowsMsg PROTO ; write last error message generated by MS-Windows
63
64
65 ; Copy a source string to a target string.
66 Str_copy PROTO,
67 source:PTR BYTE,
68 target:PTR BYTE
69
70 ; Return the length of a null-terminated string..
71 Str_length PROTO,
72 pString:PTR BYTE
73
74 ; Compare string1 to string2. Set the Zero and
75 ; Carry flags in the same way as the CMP instruction.
76 Str_compare PROTO,
77 string1:PTR BYTE,
78 string2:PTR BYTE
79
80 ; Trim a given trailing character from a string.
81 ; The second argument is the character to trim.
82 Str_trim PROTO,
83 pString:PTR BYTE,
84 char:BYTE
85
86 ; Convert a null-terminated string to upper case.
87 Str_ucase PROTO,
88 pString:PTR BYTE
89
90 ;******** Procedures by James Brink ********************************
91 ; Used by permission.
92
93 WriteStackFrameName PROTO,
94 numParam:DWORD, ; number of parameters passed to the procedure
95 numLocalVal: DWORD, ; number of DWordLocal variables
96 numSavedReg: DWORD, ; number of saved registers
97 procName: PTR BYTE
98
99 WriteStackFrame PROTO,
100 numParam:DWORD, ; number of parameters passed to the procedure
101 numLocalVal: DWORD, ; number of DWordLocal variables
102 numSavedReg: DWORD ; number of saved registers
103
104
105 ;-----------------------------------
106 ; Standard 4-bit color definitions
107 ;-----------------------------------
108 black = 0000b
109 blue = 0001b
110 green = 0010b
111 cyan = 0011b
112 red = 0100b
113 magenta = 0101b
114 brown = 0110b
115 lightGray = 0111b
116 gray = 1000b
117 lightBlue = 1001b
118 lightGreen = 1010b
119 lightCyan = 1011b
120 lightRed = 1100b
121 lightMagenta = 1101b
122 yellow = 1110b
123 white = 1111b
124
125 ; This structure is returned by the FSTSW
126 ; instruction in protected mode:
127
128 FPU_ENVIRON STRUCT
129 controlWord WORD ?
130 ALIGN DWORD
131 statusWord WORD ?
132 ALIGN DWORD
133 tagWord WORD ?
134 ALIGN DWORD
135 instrPointerOffset DWORD ?
136 instrPointerSelector DWORD ?
137 operandPointerOffset DWORD ?
138 operandPointerSelector WORD ?
139 WORD ? ; not used
140 FPU_ENVIRON ENDS
141
142 .LIST