Lecture Computer organization and assembly language: Chapter 19 - Dr. Safdar Hussain Bouk

After studying this chapter you will be able to understand: Data is efficiently managed by storing them in files on disk, data files and programs are separate, the program does not need to be modified when the data changes, different programs can share the same data sets. | CSC 221 Computer Organization and Assembly Language Lecture 19: I/O and Conditional Jumps in Assembly Lecture 18: Review I/O Instructions StdIn proc lpszBuffer:DWORD,bLen:DWORD Description StdIn receives text input from the console and places it in the buffer required as a parameter. The function terminates when Enter is pressed. Parameters 1. lpszBuffer The buffer to receive the text input from the console. 2. bLen The length of the buffer. Source: C:\masm32\help\ Include \masm32\include\ includelib \masm32\lib\ invoke StdIn, addr buffer, 100 Program Components Lecture 18: Review StdOut proc lpszText:DWORD Description: StdOut will display a zero terminated string at the current position in the console. Parameter lpszText : A zero terminates string. Return Value There is no return value. Source: C:\masm32\help\ (cont.) Include \masm32\include\ includelib \masm32\lib\ invoke StdOut, addr message1 I/O Instructions: Example .data message1 BYTE "Type your name: ", 0 message2 BYTE "Your name is ", 0 .data? buffer BYTE 100 dup(?) .code start: invoke StdOut, addr message1 invoke StdIn, addr buffer, 100 invoke StdOut, addr message2 invoke StdOut, addr buffer invoke StdIn, addr buffer, 100 invoke ExitProcess, 0 end start Conditional Jump (Jcond) Instructions A conditional jump instruction branches to a label when specific register or flag conditions are met. Examples: JB, JC jump to a label if the Carry flag is set JE, JZ jump to a label if the Zero flag is set JS jumps to a label if the Sign flag is set JNE, JNZ jump to a label if the Zero flag is clear JECXZ jumps to a label if ECX equals 0 Jcond Ranges Prior to the 386: jump must be within –128 to +127 bytes from current location counter. IA-32 processors: 32-bit offset permits jump anywhere in memory. Jumps Based on Specific Flags Jumps Based on Equality Jumps Based on Unsigned Comparisons Jumps Based on Signed Comparisons Lecture Outline ASSEMBLY . | CSC 221 Computer Organization and Assembly Language Lecture 19: I/O and Conditional Jumps in Assembly Lecture 18: Review I/O Instructions StdIn proc lpszBuffer:DWORD,bLen:DWORD Description StdIn receives text input from the console and places it in the buffer required as a parameter. The function terminates when Enter is pressed. Parameters 1. lpszBuffer The buffer to receive the text input from the console. 2. bLen The length of the buffer. Source: C:\masm32\help\ Include \masm32\include\ includelib \masm32\lib\ invoke StdIn, addr buffer, 100 Program Components Lecture 18: Review StdOut proc lpszText:DWORD Description: StdOut will display a zero terminated string at the current position in the console. Parameter lpszText : A zero terminates string. Return Value There is no return value. Source: C:\masm32\help\ (cont.) Include \masm32\include\ includelib \masm32\lib\ invoke StdOut, addr message1 I/O Instructions: .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.