Đang chuẩn bị liên kết để tải về tài liệu:
The 80x86 IBM PC and Compatible Computers- P5

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

The 80x86 IBM PC and Compatible Computers- P5: Praised by experts for its clarity and topical breadth, this visually appealing, one-stop source on PCs uses an easy-to-understand, step-by-step approach to teaching the fundamentals of 80x86 assembly language programming and PC architecture. Offering users a fun, hands-on learning experience, it uses the Debug utility to show what action the instruction performs, then provides a sample program to show its application. | TITLE PROGRAM 5-5.MOUSE BOX PROGRAM Performs the following a gets the current video mode and saves it b sets the video mode to a new one and clears screen c draws a colored box and gets the mouse position d displays different messages depending on whether the mouse is clicked inside or outside the box Pressing any key will return to DOS. Thanks to Travis Erck and Gary Hudson for their input on this program CURSOR MACRO ROW COLU MN MOV AH.02H MOV BH.00 MOV DH ROW MOV DL COLUMN INT 10H ENDM DISPLAY MACRO STRING MOV AH.09H MOV DX OFFSET STRING load string address INT 21H ENDM FILL MACRO ROW START COL START ROW END COL END COLOR LOCAL START AG AIN MOV DX.ROW START START MOV CX.COL START AGAIN MOV AH.OCH MOV AL COLOR INT 10H INC CX CMP CX.COL END JNE AGAIN INC DX CMP DX.ROW END JNE START ENDM MODEL SMALL .STACK DATA MESSAGE 1 DB AN EXAMPLE OF HOW TO USE INTERRUPT 33H FOR MOUSE. MESSAGE 2 DB IT WORKS MESSAGE 3 DB CLICK IN THE BOX TO SEE WHAT HAPPENS MESSAGE 4 DB No NO NO I SAID IN THE BOX MESSAGE 5 DB NOW PRESS ANY KEY TO GET BACK TO DOS. OLDVIDEO DB NEWVIDEO DB 12H .CODE MAIN PROC MOV AX @DATA MOV DS AX MOV AH.OFH get the current video mode INT 10H MOV OLDVIDEO AL save it MOV AX.0600H clear screen MOV BH.07 MOV CX 0 MOV DX.184FH INT 10H MOV AH OOH set new video mode MOV AL NEWVIDEO INT 10H CURSOR 0 0 FILL 150 250 250 350 4 draw red box CURSOR 1 1 DISPLAY MESSAGE 1 CURSOR 5 22 DISPLAY MESSAGE 3 MOV AX.0000H initialize mouse INT 33H MOV AX 01H INT 3 3H show mouse cursor Program 5-5 continued on next page 165 BACK MOV AX.03H check for mouse button press INT 33H now CX COL and DX ROW location CMP BX.0001H check to see if left button is pressed JNE BACK lf not keep checking CMP CX.250 see if on right side of box JB NOT INSIDE if less it must be outside box CMP CX.350 see if on left side of box JA NOT INSIDE if not then it is outside the box CMP DX.150 check for the top of the box JB NOT INSIDE if not then outside the box CMP DX.250 see if bottom of the box JA NOT INSIDE .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.