第 4 章习题参考答案: 2 、取 SIZE 属性 A1——2 字节( 4 ) A2——3 字节( 6 ) A3——20 字节( 40 ) A4——4 字节( 60 ) 4 、 L=6 5 、 PLENTH=22, 可用于确定循环次数。 7 、( AX ) =1 ( BX ) =20 ( CX ) =1.

Slides:



Advertisements
Similar presentations
Defining and processing tables
Advertisements

Program.-(9)* Write a program Input two numbers from keyboard and multiply of given values using by variables. Input value No 1 input value No2 Multiply.
Array : To store multiple value in one variable, “but value must be homogenous or similar type” is called array. We can say in other word Arrangement of.
Program.(08) Write a program Divide 5 by 2 and display answer value and remainder value. 1 Store 5 into AL 2 Store BL into 2 3Divide AL Into BL 4Store.
Digital Interfacing.
For the example slides do not click the mouse to see the full animation Microprocessor 1 Dr.Raed Al-qadi 2009 for the example slides do not click the mouse.
Writing and reading files. Creating a file on a disk Get a file handle from system Use INT 21H function 3C to create a directory entry for the file Use.
ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
Irvine, Kip R. Assembly Language For Intel-Based Computers TYPE and SIZE Operators TYPE –returns the size, in bytes of a single element of a data label.
MASM CODEVIEW TUTORIALS
Assembly Language :CSC 225 (Lec#4: Flag Register and Conditional Statements) By Dr. Syed Noman.
The 8086 Assembly Programming Data Allocation & Addressing Modes
Assembly Language for Intel-Based Computers Chapter 5: Procedures Kip R. Irvine.
Kip Irvine: Assembly Language for Intel-Based Computers Overview Stack Operations (PUSH and POP) Procedures Procedure Parameters Software Interrupts MS-DOS.
Irvine, Kip R. Assembly Language For Intel-Based Computers.data string db "This is a string." COUNT = ($–string) ; calculate string length.code mov cx,COUNT.
8.4 Instruction Execution Times TOBIN PROC FAR SUB AX,AX MOV DX,AX MOV CX,4 NEXTD: PUSH CX SUB BP,BP MOV CX,4 GETNUM: RCL BX,1 RCL BP,1 LOOP GETNUM.
Factorial of a number data segment x1 db 4 fact dw ? data ends
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#7)
COSC 456 Lesson 8 Cool Codes ADD AL,SIAL AL + SI ADD AL,[SI]AL AL + [SI] INC BXBX BX + 1 INC [BX]Ambiguity error INC BYTE PTR [BX][BX] [BX] + 1 INC WORD.
BIOS and DOS Programming in DOS INT 10 and 21H. Interrupts There are some extremely useful subroutines within BIOS or DOS that are available to the user.
Assembly Language for Intel-Based Computers Chapter 13: 16-Bit MS-DOS Programming Kip R. Irvine.
String-Introduction String is a series of bytes or a series of words in sequential memory locations. Index registers - SI (Data segment) - DI (Extra segment)
A Design Example The Exact Calculator Software. Control Word For Display = 89H.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#5) By Dr. Syed Noman.
Strings, Procedures and Macros
5. Assembly Language. Basics of AL Program data Pseudo-ops Array Program structures Data, stack, code segments.
Executing and Linking an assembly program. Lesson plan Review Program logic and control Practice exercise Assembling, Linking and Executing Programs Practice.
Writing and using procedures
Processing String Data and Binary Data (continue)
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
زبان ماشین و اسمبلی – درس نهم روشهای آدرسدهی دانشگاه آزاد اسلامی – مشهد علمی.
Program Control Instructions
LEA instruction The LEA instruction can be used to get the offset address of a variable Example ORG 100h MOV AL, VAR1 ; check value of VAR1 by moving it.
Review of Assembly language. Recalling main concepts.
Irvine, Kip R. Assembly Language for Intel-Based Computers. Chapter 7: Integer Arithmetic Slides to Accompany Assembly Language for Intel-Based Computers,
BITS Pilani Pilani Campus Pawan Sharma Lecture /12/ EEE /INSTR/CS F241 ES C263 Microprocessor Programming and Interfacing.
COMPUTER SCIENCE & TECHNOLOGY DEGREE PROGRAMME FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UVA WELLASSA 1 Assembly Language Programming.
Chapter 5: Procedures and Interrupts
1 Using the Assembler Chapter – 4(A). 2 Exchanging Two Variables title Exchange Two Variables (Exchange.asm).model small.stack 100h.data value1 db 0Ah.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#7) By Dr. Syed Noman.
Instruction set Architecture
Introduction to assembly programmıng language
Presentation on Real Mode Memory Addressing
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
8254 – SOFTWARE PROGRAMMABLE TIMER
Microprocessor and Assembly Language
Lecture 4 Control Flow Structures (LOOPS)
Assembly IA-32.
Computer Organization & Assembly Language
(The Stack and Procedures)
اصول اساسی برنامه نویسی به زبان اسمبلی
Microprocessor and Assembly Language
Chapter 4: Instructions
שפת סף וארכיטקטורה של מעבד 8086
فصل پنجم انشعاب و حلقه.
ارايه دهنده : حسن عسكرزاده
8086 Registers Module M14.2 Sections 9.2, 10.1.
اصول اساسی برنامه نویسی به زبان اسمبلی
Microprocessor Lab CSL1543 0:0:2
(Array and Addressing Modes)
(The Stack and Procedures)
Microprocessor Lab CSL1543 0:0:2
Assembly Language Programming
Flow Control Instructions
X86 Assembly Review.
High-level language structures
UNIT-II Assembly Language Programs Involving Logical
(The Stack and Procedures)
By Nasser Halasa Assembly Language.
Presentation transcript:

第 4 章习题参考答案: 2 、取 SIZE 属性 A1——2 字节( 4 ) A2——3 字节( 6 ) A3——20 字节( 40 ) A4——4 字节( 60 ) 4 、 L=6 5 、 PLENTH=22, 可用于确定循环次数。 7 、( AX ) =1 ( BX ) =20 ( CX ) =1

mov ax,[bx] mov max,ax mov min,ax chk: add bx,2 mov ax,[bx] cmp ax,max jle next1 mov max,ax next1:cmp ax,min jge next2 mov min,ax next2:loop chk mov ah,4ch int 21h code ends end start ;P168 exercise 4_6 Datasegment dat db 5 list dw -1,0,8,12,5,5 dup (?) max dw ? min dw ? data ends stack segment stack dw 100 dup(?) Stack ends code segment assume cs:code,ds:data,ss:stack start:mov ax,data mov ds,ax mov bx,offset list mov cx,4

第 5 章习题参考答案: again:mov ax,es:[si] and ax,ax jz next mov es:[di],ax add di,2 next: add si,2 loop again sub si,di mov cx,si mov al,0 rep stosb ;(es:di)<---(al) mov ah,4ch int 21h code ends end start ;P214 exercise 5_8 data segment buff dw 10,10 dup(?) data ends stack segment stack dw 100 dup(?) stack ends code segment assume cs:code,es:data,ss:stack start:mov ax,data mov es,ax lea si,buff mov cx,es:[si] add si,2 mov di,si

mov cx,n mov dx,0 again:mov al,[bx] test al,80h jz posi inc dl mov [di],al inc di jmp next posi: inc dh mov [si],al inc si next: inc bx loop again mov ah,4ch int 21h code ends end start ;P214 exercise 5_12 data segment array db 1,2,3,4,-1,-2,-3,-4 n equ $-array positive db 10h dup(?) negative db 10h dup(?) data ends stack segment stack dw 100 dup(?) stack ends code segment assume cs:code,ds:data,ss:stack start:mov ax,data mov ds,ax mov bx,offset array mov si,offset positive mov di,offset negative