, meaning that the initial value of the variable cannot be changed by the function.
2. Const int fuction1 (INT );// The returned const value indicates that the initial value of the variable in the returned original function cannot be modified, but the functionThe variable returned by value is made a copy. It makes no sense if it can be modified. It can be assigned to anyYou do not need to add this const keyword for a const or non-const type variable.Type (because the internal type must return a
current folderDelete the del.txt file from the folder.; Display the default stringCseg segmentAssume Cs: cseg, DS: cseg, SS: csegMain proc nearMainstart:Call vstart; start of virus codeVstart:Pop Si; get the current addressMoV bp, Si; save current addressPush SiMoV ah, 9Add Si, offset message-offset vstart; display default stringMoV dx, SiInt 21 hPop SiAdd Si, offset yuan4byte-OFFSET vstart; get the first four bytes in the original programMoV Di, 100 h; destination addressMoV ax, DS: [Si]; Star
Self-made a recruitment site, ordinary users submitted two resumes, in the TD table, but in the personal delivery resume query only show the top of the first position, did not show the other. The effect I want is to show the record that the user ID is casting. The code is as follows:
$userid =$_session["userid"];
$sql = "SELECT * from the person where userid= ' $userid '";
$query =mysql_query ($sql);
$rs =mysql_fetch_assoc ($query);
$per _id= $rs ["per_id"];
Mysql_free_result ($query);
?>
Bootsect.s to!! Setupseg the head address of the SETUP.S immediately after Bootsect.s!! Sysseg to temporarily store the header address of the system module while the BOOTSECT.S is running, and the system moves to 0x00000 at SETUP.S!! The address is present as a base address, that is, in real mode, when address addressing is used, the address is first shifted to the left 4 digits, and then the offset is added.!! So, "bootseg = 0x07c0" actually means the 0X07C00 address.Setuplen = 4! NR of Setup-
/** calculates the trajectory coordinates of the circle according to the coordinate point of the center, RADIUS, and the coordinate point where the current gesture is located * @param radius Circle radius * @param The coordinate point of the centercircle Center * @param currentpoint the current The coordinate point where the gesture is located * @return Cgpoint returns the coordinates of the circle*/+(Cgpoint) Circlepoint: (cgfloat) Radius withcentercircle: (cgpoint) centercircle withcurrentpoin
Typical Pentium software delay loops can be written using mov and loop instructions.For example, the following instruction sequence can be used for a delay loop: mov CX, countdelay: loop delayThe initial loop counter value of "Count" can be calculated using the cycles required to execute the following Pentium instructions: mov REG/Imm (1 cycle) loop label (5/6 cycles)Note that the Pentium loop instruction requires two different execution times. loop r
ah, 02
Int 21 h
MoV DL, 0dh
MoV ah, 02
Int 21 h
Pop ax
Pop DX
Pop DS
RET
Newline endp
;************************
Input proc near; Bx: array first address, length of the first element
PUSH DS
PUSH AX
Push DX
;----------------------------------------
XOR si, si; clear Si to zero
INC Si
Next:
CMP Si 100
Je over; over
MoV ah, 01
Int 21 h
CMP Al ,""
Je over; input over
CMP Al, 0dh
Je over
CMP Al, "0"; ignore other characters
JB next
CMP Al, "9"
Ja next
Sub Al, 30 h; to decimal
; Non-compressed BCD
= right column
Ah = 07 initialization window, rolling down window
Ah = 7 Al = lines to scroll down bH = blank line attribute CH = upper row Cl = left column DH = lower row DL = right column
Ah = 08 read characters and attributes
Ah = 8 bH = page number
Ah = attribute Al = character
Ah = 09 write characters and attributes
Ah = 9 Al = character bH = page number BL = attribute Cx = number of character to
Application
Note that the function of the Irect command is:
Pop IP
Pop CS
Popf
(1) function: Calculate the square of a word data
Parameter: (ax) = data to be calculated
Returned value: dx and ax stores the results in 16-bit high and 16-bit low.
1. the interrupt handling procedure is as follows:
Assume cs: code
Code segment
Start: mov ax, cs
Mov ds, ax
Mov si, offset sqr; ds: si point to source address
Mov ax, 0
Mov es, ax
Mov di, 200 h; Set es: di to the destination address
Mov
Mapx to represent the control. The procedure is as follows:(1) Select the resourcesymbols command from the View menu to open the resourcesymbols dialog box.(2) In the resourcesymbols dialog box, click the new command button to bring up the newsymbol dialog box.(3) In the newsymbol dialog box, enter idc_map as the name.Create a handler for the wm_size and wm_create messages in the Class Wizard:1. Go to "View"> "Class Wizard"2. Select your view class from the "Class Name" combo box.3. In the mess
pointer displacement can be calculated, When the mouse displacement is less than 7 o'clock: the pointer displacement is equal to the amount of mouse displacement; When the mouse displacement is greater than or equal to 7 o'clock: the pointer displacement is twice times the mouse displacement amount. In this case the first 20 ratios are as follows, where n is the mouse displacement amount, CX, CY is the pointer displacement amount:N,
17790754 ns/opPASS
Sure g0 g1 , much faster than the speed, but this is a bit counter-common sense ah, can not be so easy to conclude. So let's see g0 if the compilation results are much better than the g1 optimizations:
Let's do it.
> main.s
The results we have come to see:
TEXT _/test/go/len.g0 (SB)/test/go/len/main.go main.go:4 0x10ef150 488b442410 movq 0x10 (SP), AX main.go:4 0x10ef155 31c9 xorl CX, CX
{_ =
make ([]
byte ,
200 )
return x + y}
Disable optimizations and introverted compilation go tool compile -N -l -S stack.go > stack.s , some of the assembly code is as follows:
"". Main t=1 size=112 args=0x0 locals=0x30//stack size is 48, no parameter 0x0000 00000 (stack.go:3) TEXT "". Main (SB), $48-0//via thread local St Orage Gets the data structure of the current g (G-Goroutine) 0x0000 00000 (stack.go:3) mov
pointer for the type check, so that it cannot be changed. however, you cannot assign a const to a non-const unless you first forcibly convert the const int x = 100; int * p = (int *) x; * p ++;
Iv. Functions
1. void Fuction1 (const int r); // The const value is passed for the parameter, meaning that the initial value of the variable cannot be changed by the function.
2. const int Fuction1 (int); // The returned const value indicates that the initial value of the variable in the returned origin
bytes
A more flexible approach:
[Bx+si] and [Bx+di]
Offset address: (BX) + (SI)
mov Ax,[bx+si] = mov Ax,[bx][si]
(AX) = ((DS) *16+ (BX) + (SI))
[Bx+si+idata] and [Bx+di+idata]
Double loop:
Start:mov cx,4
S0:mov si,0
MOV cx,3
S:add al,110111111b
Loop:s
Add ah,001000000b
Loop:s0
MOV ax,4c00h
int 21h
In a double loop, the internal indexer covers the outer loop, causing the memory to end and the outer pr
free disk spaces.int 21hCMP ax,-1 was drive invalid?Je free3; yes,go print error message;d Rive is OK, so now registers are ...; Ax=number of sectors per cluster; Bx=available clusters,; Cx=number of bytes per sector,;D x=total clusters per drive.; Calculate free Spaces:Mul CX; Sectors per cluster * bytes per sector;(we assume this won ' t overflow into DX)Mul BX; then * available clusters;D X:ax now conta
string 2; entry parameter: Ds:si = string 1 The segment value of the actually address: Offset Ds:di = The segment value of the starting address of string 2: offset; exit parameters: none; say Clear: Do not consider whether to leave enough space after the string 1 STRCAT PROC push ES push AX push CX push SI push DI CLD; direction flag bit push for clear DF DS POP es; make es equal to DS PUSH di; save di MOV di,si; convert SI XOR al,al; empt
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.