Org 100h Mov Al, 5 Bin 00000101b Mov BL, 10 Bin 00001010b 5 + 10 15 (Decimal) or Hex 0Fh or Bin 00001111b Add Al, BL Ret
Org 100h Mov Al, 5 Bin 00000101b Mov BL, 10 Bin 00001010b 5 + 10 15 (Decimal) or Hex 0Fh or Bin 00001111b Add Al, BL Ret
LAB 02
Write the following code in the text editor
Program 01:
org 100h
ret
Register Value
AX 000F
BX 000A
CS 0700
IP 0106
Note the final values of registers in the following table
CEL-221 Lab Manual Computer Architecture and Organization
Program 02:
org 100h
mov al, 5 ; al = 5
add al, -3 ; al = 2
ret
Observe the values in the registers.
Register Value
AX 0002
BX 0000
CS 0700
IP 0104
Program 03:
Org 100h
mov bl, 5 ; bl = 5
add bl, -3 ; bl = 2
ret
Observe the values in the registers.
Program 04:
Org 100h
mov al, 5
sub al, 1 ; al = 4
ret
Observe the values in the registers.
Register Value
AX 0004
BX 0002
CS 0700
IP 0105
Program 05:
Org 100h
mov al, 7
mov bl, 4
sub al,bl
ret
Observe the values in the registers.
Register Value
AX 0003
BX 0004
CS 0700
IP 0106
CEL-221 Lab Manual Computer Architecture and Organization
Exercise:
1. Write a program to subtract two integer constants using SUB command.
Org 100h
mov bl, 10
sub bl, 6
ret
Computers convert binary data into the hexadecimal (hex) number system because it
is much less complex than converting data into decimal numbers, and it is much easier
for human beings to read hex numbers than to read binary numbers. This way, even
though the actual processing and inner workings of computers use the binary system,
they often display information using the hex system.
A language whose source programs can be compiled and run on a wide variety of
computer systems is said to be portable. Portability, in relation to software, is a
measure of how easily an application can be transferred from one computer
environment to another, it also refers to the ability of an application to move across
environments, not just across platforms (operating system and computer hardware
only). Some programming languages are fairly portable, for example the C language.
6. Is the assembly language for x86 processors the same as those for computer
systems such as the Vax or Motorola 68x00?