alp-05

alp-05 - Introduction to 8086 Programming (The 8086...

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

View Full Document Right Arrow Icon
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 1 Introduction to 8086 Programming (The 8086 microprocessor is one of the family of 8086,80286,80386,80486,Pentium,PentiumI,II,III …. also referred to as the X86 family.) Learning any imperative programming language involves mastering a number of common concepts: Variables : declaration/definition Assignment : assigning values to variables Input/Output: Displaying messages Displaying variable values Control flow: if-then Loops Subprograms: Definition and Usage Programming in assembly language involves mastering the same concepts and a few other issues. Variables For the moment we will skip details of variable declaration and simply use the 8086 registers as the variables in our programs. Registers have predefined names and do not need to be declared.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 2 The 8086 has 14 registers. Each of these is a 16-bit register. Initially, we will use four of them – the so called the general purpose registers: ax, bx, cx, dx These four 16-bit registers can also be treated as eight 8-bit registers: ah, al, bh, bl, ch, cl, dh, dl Assignment In Java, assignment takes the form: x = 42 ; y = 24; z = x + y; In assembly language we carry out the same operation but we use an instruction to denote the assignment operator (“=” in Java). The above assignments would be carried out in 8086 assembly langauge as follows mov x, 42 mov y, 24 add z, x add z, y The mov instruction carries out assignment.
Background image of page 2
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 3 It which allows us place a number in a register or in a memory location (a variable) i.e. it assigns a value to a register or variable. Example : Store the ASCII code for the letter A in register bx. mov bx, ‘A’ The mov instruction also allows you to copy the contents of one register into another register. Example : mov bx, 2 mov cx, bx The first instruction loads the value 2 into bx where it is stored as a binary number. [a number such as 2 is called an integer constant] The Mov instruction takes two operands, representing the destination where data is to be placed and the source of that data. General Form of Mov Instruction mov destination , source
Background image of page 3

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

View Full DocumentRight Arrow Icon
Introduction to 8086 Assembly Language Programming, Joe Carthy, UCD 4 where destination must be either a register or memory location and source may be a constant, another register or a memory location. Note : The comma is essential. It is used to separate the two operands. A missing comma is a common syntax error. Comments Anything that follows semi-colon ( ; ) is ignored by the assembler. It is called a comment . Comments are used to make your programs readable. You use them to explain what you are doing in English. More 8086 Instructions
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/09/2010 for the course IM 405 taught by Professor Irvine during the Spring '10 term at UNCuyo.

Page1 / 16

alp-05 - Introduction to 8086 Programming (The 8086...

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

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