alp1 - Introduction to 8086 Programming Learning any...

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

View Full Document Right Arrow Icon
Introduction to 8086 Assembly Language Programming 1 Introduction to 8086 Programming 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. We have seen that the 8086 has 14 registers. 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
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 2 Assignment In Java, assignment takes the form: x = 42 ; y = 24; z = x + y; In assembly language we carry out the same operaion but we use an instruction to denote the assignment operator (“=” in Java). mov x, 42 mov y, 24 add z, x add z, y The mov instruction carries out assignment in 8086 assembly language. 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. A has ASCII code 65D (01000001B, 41H) The following mov instruction carries out the task: movbx, 65d
Background image of page 2
Introduction to 8086 Assembly Language Programming 3 We could also write it as: movbx, 41h or movbx, 01000001b or movbx, ‘A’ All of the above are equivalent. They each carry out exactly the same task, namely the binary number representing the ASCII code of A is copied into the bx register. The value is copied into the right-hand side (low-order byte) of the register. The left-hand side will contain all 0’s. Thus we could also have written it as:
Background image of page 3

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

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

Page1 / 10

alp1 - Introduction to 8086 Programming Learning any...

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

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