if you want to remove an article from website contact us from top.

    elements of assembly language programming

    Mohammed

    Guys, does anyone know the answer?

    get elements of assembly language programming from screen.

    elements

    5.1 Elements of Assembly Language

    5.1 Elements of Assembly Language

    Introduction

    1.1 What are microcontrollers and what are they used for?

    1.2 What is what in the microcontroller?

    2.1 What is 8051 Standard?

    2.2 Pinout Description

    2.3 Input/Output Ports (I/O Ports)

    2.4 Memory Organization

    2.5 Special Function Registers (SFRs)

    2.6 Counters and Timers

    2.7 UART (Universal Asynchronous Receiver and Transmitter)

    2.8 8051 Microcontroller Interrupts

    2.9 8051 Microcontroller Power Consumption Control

    3.1 Types of instructions

    3.2 Description of all 8051 instructions

    4.1 The AT89S8253 microcontroller ID

    4.2 Pinout Description

    4.3 The AT89S8253 Microcontroller Memory Organization

    4.4 Special Function Registers (SFRs)

    4.5 Watchdog Timer (WDT)

    4.6 Interrupts

    4.7 Counters and Timers

    4.8 Universal Asynchronous Receiver Transmitter (UART)

    4.9 SPI System (Serial Peripheral Interface)

    4.10 Power Consumption Control

    5.1 Elements of Assembly Language

    6.1 Basic connecting

    6.2 Additional components

    6.3 Examples

    7.1 At the end - from the beginning...

    7.2 Easy8051A Development System

    PAGE 24/29

    Assembly language is basically like any other language, which means that it has its words, rules and syntax. The basic elements of assembly language are:

    Labels; Orders; Directives; and Comments.

    Syntax of Assembly language

    When writing a program in assembly language it is necessary to observe specific rules in order to enable the process of compiling into executable “HEX-code” to run without errors. These compulsory rules are called syntax and there are only several of them:

    Every program line may consist of a maximum of 255 characters;

    Every program line to be compiled, must start with a symbol, label, mnemonics or directive;

    Text following the mark “;” in a program line represents a comment ignored (not compiled) by the assembler; and

    All the elements of one program line (labels, instructions etc.) must be separated by at least one space character. For the sake of better clearness, a push button TAB on a keyboard is commonly used instead of it, so that it is easy to delimit columns with labels, directives etc. in a program.

    Numbers

    If octal number system, otherwise considered as obsolite, is disregarded, assembly laguage allows numbers to be used in one out of three number systems:

    Decimal Numbers

    If not stated otherwise, the assembly language considers all the numbers as decimal. All ten digits are used (0,1,2,3,4,5,6,7,8,9). Since at most 2 bytes are used for saving them in the microcontroller, the largest decimal number that can be written in assembly language is 65535. If it is necessary to specify that some of the numbers is in decimal format, then it has to be followed by the letter “D”. For example 1234D.

    Hexadecimal Numbers

    Hexadecimal numbers are commonly used in programming. There are 16 digits in hexadecimal number system (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). The largest hexadecimal number that can be written in assembly language is FFFF. It corresponds to decimal number 65535. In order to distinguish hexadecimal numbers from decimal, they are followed by the letter “h”(either in upper- or lowercase). For example 54h.

    Binary Numbers

    Binary numbers are often used when the value of each individual bit of some of the registers is important, since each binary digit represents one bit. There are only two digits in use (0 and 1). The largest binary number written in assembly language is 1111111111111111. In order to distinguish binary numbers from other numbers, they are followed by the letter “b” (either in upper- or lowercase). For example 01100101B.

    Operators

    Some of the assembly-used commands use logical and mathematical expessions instead of symbols having specific values. For example:

    IF (VERSION>1) LCALL Table_2 USING VERSION+1 ENDIF ...

    As seen, the assembly language is capable of computing some values and including them in a program code, thus using the following mathematical and logical operations: NAME OPERATION EXAMPLE RESULT

    + Addition 10+5 15

    - Subtraction 25-17 8

    * Multiplication 7*4 28

    / Division (with no remainder) 7/4 1

    MOD Remainder of division 7 MOD 4 3

    SHR Shift register bits to the right 1000B SHR 2 0010B

    SHL Shift register bits to the left 1010B SHL 2 101000B

    NOT Negation (first complement of number) NOT 1 1111111111111110B

    AND Logical AND 1101B AND 0101B 0101B

    OR Logical OR 1101B OR 0101B 1101B

    XOR Exclusive OR 1101B XOR 0101B 1000B

    LOW 8 low significant bits LOW(0AADDH) 0DDH

    HIGH 8 high significant bits HIGH(0AADDH) 0AAH

    EQ, = Equal 7 EQ 4 or 7=4 0 (false)

    NE,<> Not equal 7 NE 4 or 7<>4 0FFFFH (true)

    GT, > Greater than 7 GT 4 or 7>4 0FFFFH (true)

    GE, >= Greater or equal 7 GE 4 or 7>=4 0FFFFH (true)

    LT, < Less than 7 LT 4 or 7<4 0 (false)

    LE,<= Less or equal 7 LE 4 or 7<=4 0 (false)

    Symbols

    Every register, constant, address or subroutine can be assigned a specific symbol in assembly language, which considerably facilitates the process of writing a program. For example, if the P0.3 input pin is connected to a push button used to stop some process manually (push button STOP), the process of writing a program will be much simpler if the P0.3 bit is assigned the same name as the push button, i.e. “pushbutton_STOP”. Of course, like in any other language, there are specific rules to be observed as well:

    स्रोत : www.mikroe.com

    Elements of assembly language programming

    Elements of assembly language programming elements of assembly language programming an assembly language is machine dependent, low level programming language

    1 out of 4

    स्रोत : www.studocu.com

    What Is Assembly Language? (With Components and Example)

    Learn about assembly languages, including what they are and why they're important, then review their key components and an example of assembly code.

    What Is Assembly Language? (With Components and Example)

    By Robert Preston

    Updated September 22, 2022

    Published August 25, 2021

    Robert Preston is a trained journalist with a deep interest in technology. He has been passionate about and studied coding for over 20 years.

    Assembly languages are critical components of functional computers. Although you don't directly interact with an assembly language when working as a software developer or other technical professional, they're essential connections between software programs and the hardware on a computer. Learning about assembly languages allows you to better understand the functionality of your computer, and it may help you ensure it continues to work effectively.

    In this article, we discuss what an assembly language is, why they're important and how they work, and we provide an example of an assembly language in action.

    Top job searches near you

    Part time jobs Full time jobs Work from home jobs

    Hiring immediately jobs

    View more jobs on Indeed

    What is assembly language?

    An assembly language is a programming language that communicates with the hardware of a computer directly. An assembly language allows a software developer to code using words and expressions that can be easier to understand and interpret than the binary or hexadecimal data the computer stores and reads. Assembly languages often serve as intermediaries, allowing for developing more complex programming languages, which can offer further efficiency to a developer.

    Some professional industries still use assembly language when creating programs or functions. For example, some financial firms and marketplaces use high-frequency trading (HFT) platforms, which developers write in assembly language. By having the only processor translate from an assembly code, these professionals can save processing time other firms may spend on the additional translation from a higher-level code.

    Related: Learning How To Code

    How do assembly languages work?

    Assembly languages differ between hardware architectures. A computer's architecture includes its machine components, hardware design, processor and the relationships it has with other machines. Specific computer architectures have corresponding assembly languages. Although the assembly languages are specific to their hardware, they typically run various operating systems, meaning an assembly language can often be compatible with any programming language.

    An assembler is a program that translates commands into machine code. The assembler gathers the instructions from the assembly language and translates each action into a series of electrical signals the machine can interpret. Although specifics for assembly languages can vary, there are common components an assembly language is likely to use, including:

    Syntax

    The syntax of an assembly language is its structural composition. For a computer to interpret and assemble code, it requires a consistent format the computer assembler understands. The syntax for assembly languages often uses a basic structure with a single command on each line of code.

    Related: How To Write Computer Code in 6 Steps (And Improve Skills)

    Label

    A label is a word, number or symbol the assembly code uses as a reference point to locate the date or instruction to use. The code can call the label elsewhere to access the information in that location. Often, labels in assembly languages comprise a numerical system, with lines of code possessing higher numbers as you progress down the code.

    Related: 12 Coding Careers To Explore

    Command

    A command is an order in a piece of assembly code that tells the assembler what action to perform. This provides a basic method of data manipulation the assembler can use to simplify a user's interactions with the system. Often, commands in assembly languages use abbreviations to keep the terminology short while also using self-descriptive abbreviations, such as a language using "ADD" for addition and "MOV" to transfer data.

    Related: What Is Source Code in Programming? (With Examples)

    Operand

    An operand is a component the assembler can manipulate, such as a variable or piece of data. By including operands in instructions, you can tell the assembly language to which data to apply any commands on that line. This makes operands a critical coding component with an assembly language to create functional applications.

    Related: Learn How To Code for Success in Your Career

    Directive

    A directive is a type of statement that provides instruction to the assembler to change a setting or perform an action. The syntax for an assembly language commonly dictates a specific character at the start of a directive, such as a period. This tells the assembler the following text is a directive to follow. Syntax also commonly requires each directive to begin on a new line in the code.

    Related: Top Computer Coding Skills for Your Resume

    Macro

    A macro is a statement that functions as a short representation of a sequence of other instructions and directives. You then can call this macro elsewhere in the code, which triggers the macro to run. This makes your code more efficient by allowing you to replicate extensive code sections more than once as shorter macro calls. You also can update your code more efficiently because changing the macro changes all references to the macro.

    स्रोत : www.indeed.com

    Do you want to see answer or more ?
    Mohammed 14 day ago
    4

    Guys, does anyone know the answer?

    Click For Answer