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

Lecture 10 - Data Transfer, Add & SUB (Flags). In this chapter, the following content will be discussed: What are computing systems used for? How are computing systems implemented? What are computing systems able to do and how well can they do it? | CSC 221 Computer Organization and Assembly Language Lecture 10: Data Transfer, Add & SUB (Flags) (In Assembly) Lecture 09: Review Data Transfer Instructions Operand Types Instruction Operand Notation Direct Memory Operands MOV Instruction Zero & Sign Extension XCHG Instruction Direct-Offset Instructions Direct Memory Operands .data var1 BYTE 10h .code mov al,var1 ; AL = 10h mov al,[var1] ; AL = 10h Lecture 09: Review (cont.) MOVE Instruction .data count BYTE 100 wVal WORD 2 .code mov bl,count mov ax,wVal mov count,al mov al,wVal ; error mov ax,count ; error mov eax,count ; error .data bVal BYTE 100 bVal2 BYTE ? wVal WORD 2 dVal DWORD 5 .code mov ds,45 mov esi,wVal mov eip,dVal mov 25,bVal mov bVal2,bVal immediate move to DS not permitted size mismatch EIP cannot be the destination immediate value cannot be destination memory-to-memory move not permitted Lecture 09: Review (cont.) Lecture 09: Review (cont.) Zero Extension mov bl,10001111b movzx ax,bl ; zero-extension Sign Extension . | CSC 221 Computer Organization and Assembly Language Lecture 10: Data Transfer, Add & SUB (Flags) (In Assembly) Lecture 09: Review Data Transfer Instructions Operand Types Instruction Operand Notation Direct Memory Operands MOV Instruction Zero & Sign Extension XCHG Instruction Direct-Offset Instructions Direct Memory Operands .data var1 BYTE 10h .code mov al,var1 ; AL = 10h mov al,[var1] ; AL = 10h Lecture 09: Review (cont.) MOVE Instruction .data count BYTE 100 wVal WORD 2 .code mov bl,count mov ax,wVal mov count,al mov al,wVal ; error mov ax,count ; error mov eax,count ; error .data bVal BYTE 100 bVal2 BYTE ? wVal WORD 2 dVal DWORD 5 .code mov ds,45 mov esi,wVal mov eip,dVal mov 25,bVal mov bVal2,bVal immediate move to DS not permitted size mismatch EIP cannot be the destination immediate value cannot be destination memory-to-memory move not permitted Lecture 09: Review (cont.) Lecture 09: Review (cont.) Zero Extension mov bl,10001111b movzx ax,bl ; zero-extension Sign Extension mov bl,10001111b movsx ax,bl ; sign extension We have analyzed Memory operands in Assembly ADD SUB Instruction NEG Instruction Flags (cont.) Summary 6 Reference Most of the Slides are taken from Presentation: Chapter 4 Assembly Language for Intel-Based Computers, 4th Edition Kip R. Irvine (c) Pearson Education, 2002. All rights reserved. You may modify and copy this slide show for your personal use, or for use in the classroom, as long as this copyright statement, the author's name, and the title are not .

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
8    79    1    30-04-2024
259    317    5    30-04-2024
Đã 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.