IntroductiontoIBMPCAssemblyLanguage

IntroductiontoIBMPCAssemblyLanguage - Kingdom Of Saudi...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to IBM PC Assembly Language Chapter 4 in “Assembly Language Programming and Organization of the IBM” 1 Kingdom Of Saudi Arabia Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Information System Department 1 st semester, 2010 – 2011 CS 224: Computer Organization T. Hala A. Al-Rumaih
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Assembly Language Syntax Assembly language program are translated into machine language instructions by an assembler . Statement: Programs consist of statements , one per line. Statement: can be instruction assembler directive name operation operand(s) comment Ex of an instruction : START: MOV CX,5 ;initialize counter Ex of an assembler directive : Main PROC 2
Background image of page 2
Name Field Used for instruction labels, procedure names, variable names. The assembler translates names into memory addresses. 1-31 characters long May consist of letters, digits and special characters ? . @ _ $ % No blanks, not begin with a digit. If . is used, it must be 1 st character. No differentiate between Upper and lower case. 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Name Field (Cont.) Legal names: COUNTER1 @character SUM_OF_DIGITS $1000 DONE? .TEST Illegal names: TWO WORDS 2abc A45.28 4
Background image of page 4
Operation Field For an instruction : operation field contains a symbolic operation code (opcode) Assembler translate opcodes into a machine language opcode. Ex: MOV, ADD, SUB For an assembler directive : operation field contains a (pseudo-op). Pseudo-ops are not translated into a machine language, they tell the assembler to do something. Ex: PROC 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Operand Field For an instruction: operand field specifies the data that are to be acted on by operation. May have zero, one, or two operands. Ex: NOP INC AX ADD WORD1, 2 destination operand, source operand. For an assembler directive: The operand field contains more information about the directive. 6
Background image of page 6
Comment Field Used by programmer to say about what the statement does. Begin with “;” , Assembler ignores anything after ; Optional. WHY? Low level language EX 1: MOV CX,0 ;move 0 to CX MOV CX,0 ; CX counts terms, initially 0 EX 2 : ; ; initialize register ; MOV AX,0 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Program Data The processor operates only on binary data. Thus, the assembler must translate all data into binary numbers. In assembly language program: Binary, decimal, or hex numbers, and characters Numbers: Binary: 1010B , 1010b Decimal: 59 = 59D =59d Hex: begin with decimal , end with “h” or ”H” All have an optional sign Ex of legal numbers: 11011 11011B 64223 -21843D 1B4DH 0FFFH Ex of legal numbers: 1,234 1B4D FFFFH Characters : ‘’ or “” , Ex: ‘A’ “hello” Translated into their ASCII codes by the assembler “A”=41h 8
Background image of page 8
Variables Each var. has a Data type and memory address
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/09/2012 for the course CSCI 504 taught by Professor Jon during the Spring '11 term at IUP.

Page1 / 39

IntroductiontoIBMPCAssemblyLanguage - Kingdom Of Saudi...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online