Assembly Lecture1

19
Lecture 1 Chapter 4 –Requirements for coding in Assembly Language

description

Computer is an interesting language

Transcript of Assembly Lecture1

Lecture 1Chapter 4 Requirements for coding in Assembly Language1Chapter OutlineAssembly Language FeaturesSimplified segment irecti!eefining "ypes of data#quate irecti!e4Assembly Language Features Program commentsReserved wordsIdentifiersStatementsDirectives13$rogram Comment The comment field of a statement is used by the rogrammer to say something about what the statement does! " semicolon mar#s the beginning of this field$ and the assembler ignores anything tyed after the semicolon! It is almost imossible to understand an assembly language rogram without comments! %ood rogramming ractice dictates a comment on almost every line!14$rogram Comment Thus$ comments is used to ut the instruction into the conte&t of the rogram! '&amles()*+ ,-$ . / ,- counts terms$ initially . It is ermissible to ma#e an entire line a comment$ and to use them to create sace in a rogram!Reser!ed %ordsInstructions$ such as )*+ and "DDDirectives$ such as '0D that used to rovideinformation to the assembler*eratorsPredefined symbols$ such as 1Data$ which return information to your rogram during the assembly&dentifiersTwo tyes of Identifiers ( name and label1! 0ame refers to the address of a data items e&(,*20T'R $S2)$ID3! 4abel refers to the address of an instruction$rocedure$or segment e&( )"I0&dentifiers,an be from 1 to 31 characters long 5not case sensitive6! )ay consist of letters$ digits$ and the secial characters 7 ! 1 8 9 : 5Thus$ embedded blan#s are not allowed6!0ames may not begin with a digit!If a dot is used$ it must be the first character!;&dentifiers'&amles( ,*20T'R1 3abc 1,