0% found this document useful (0 votes)
40 views

CH - 2 - Assembly Language Programming

This document summarizes key aspects of assembly language programming as discussed in a textbook on x86 assembly language. It describes the basic structure of assembly language instructions, including labels, mnemonics, operands, and comments. It provides examples of directives like MODEL, CODE, DATA, STACK, DB, PROC, and ENDP. It also gives a sample assembly language program that defines data segments, loads data into registers, performs an addition, and stores the result before returning to the operating system. The document emphasizes that programs must be assembled and linked before being run to check for syntax and conceptual errors.

Uploaded by

Maryam Alyasini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

CH - 2 - Assembly Language Programming

This document summarizes key aspects of assembly language programming as discussed in a textbook on x86 assembly language. It describes the basic structure of assembly language instructions, including labels, mnemonics, operands, and comments. It provides examples of directives like MODEL, CODE, DATA, STACK, DB, PROC, and ENDP. It also gives a sample assembly language program that defines data segments, loads data into registers, performs an addition, and stores the result before returning to the operating system. The document emphasizes that programs must be assembled and linked before being run to check for syntax and conceptual errors.

Uploaded by

Maryam Alyasini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

6/28/2022

Dec Hex Bin


2 2 00000010

ORG ; TWO
Assembly
Language
Programming

The x86 PC 1
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

2.0: ASSEMBLY LANGUAGE

• An Assembly language program is a series of


statements, or lines.

• Assembly language instructions consist of four fields:


[label:] mnemonic [operands][;comment]
– Brackets indicate that the field is optional.

• The label field allows the program to refer to a line


of code by name.
– The label field cannot exceed 31 characters.
• A label must end with a colon when it refers to an
opcode generating instruction.

The x86 PC 2
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
1
2
6/28/2022

2.1: DIRECTIVES AND A SAMPLE PROGRAM


assembly language instructions
[label:] mnemonic [operands][;comment]
• The mnemonic (instruction) and operand(s) fields
together accomplish the tasks for which the
program was written.

– The mnemonic opcodes are ADD and MOV.


– "AL,BL" and "AX,6764" are the operands.
• Instead of a mnemonic and operand, these fields could
contain assembler pseudo-instructions, or directives.
• Directives do not generate machine code and are used
only by the assembler as opposed to instructions.

The x86 PC 3
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

2.1: DIRECTIVES AND A SAMPLE PROGRAM


assembly language instructions
[label:] mnemonic [operands][;comment]
• Examples of directives are DB, END, and ENDP.

The x86 PC 4
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
2
4
6/28/2022

2.1: DIRECTIVES AND A SAMPLE PROGRAM


assembly language instructions
[label:] mnemonic [operands][;comment]
• The comment field begins with a ";" and may be at
the end of a line or on a line by themselves.
– The assembler ignores comments.
• Comments are optional, but highly recommended to
make it easier to read and understand the program.

The x86 PC 5
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

2.1: DIRECTIVES AND A SAMPLE PROGRAM


model definition
• After the first two comments is the MODEL directive.
– This directive selects the size of the memory model.

The x86 PC 6
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
3
6
6/28/2022

2.1: DIRECTIVES AND A SAMPLE PROGRAM


model definition
• Among the options for the memory model are
SMALL, MEDIUM, COMPACT, and LARGE.

The x86 PC 7
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

2.1: DIRECTIVES AND A SAMPLE PROGRAM


segment definition
• Every line of an Assembly language program must
correspond to one an x86 CPU segment register.
– CS (code segment); DS (data segment).
– SS (stack segment); ES (extra segment).
• The simplified segment definition format uses three
simple directives: ".CODE" ".DATA" ".STACK“
– Which correspond to the CS, DS, and SS registers.

• The stack segment defines storage for the stack.


• The data segment defines the data the program will use.
• The code segment contains Assembly language instructions.

The x86 PC 8
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
4
8
6/28/2022

2.1: DIRECTIVES AND A SAMPLE PROGRAM


stack segment
• This directive reserves 64 bytes of memory for the
stack:

The x86 PC 9
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

2.1: DIRECTIVES AND A SAMPLE PROGRAM


data segment
• The data segment defines three data items:
– DATA1, DATA2, and SUM.

The x86 PC 10
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
5
10
6/28/2022

2.1: DIRECTIVES AND A SAMPLE PROGRAM


data segment
• The DB directive is used by the assembler to
allocate memory in byte-sized chunks.
– Each is defined as DB (define byte).
• Memory can be allocated in different sizes.
– Data items defined in the data segment will be
accessed in the code segment by their labels.
• DATA1 and DATA2 are given initial values in the
data section.
• SUM is not given an initial value.

The x86 PC 11
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

11

2.1: DIRECTIVES AND A SAMPLE PROGRAM


code segment definition
• The first line of the segment after the .CODE
directive is the PROC directive.

The x86 PC 12
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
6
12
6/28/2022

2.1: DIRECTIVES AND A SAMPLE PROGRAM


code segment definition
• The program loads AL & BL with DATA1 & DATA2,
ADDs them together, and stores the result in SUM.

The x86 PC 13
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

13

2.1: DIRECTIVES AND A SAMPLE PROGRAM


code segment definition
• The last instructions, "MOV AH,4CH" & "INT 21H"
return control to the operating system.

The x86 PC 14
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
7
14
6/28/2022

2.1: DIRECTIVES AND A SAMPLE PROGRAM


code segment definition
• The last two lines end the procedure & program.
– The label for ENDP(MAIN) matches the label for PROC.

The x86 PC 15
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

15

2.2: ASSEMBLE, LINK, AND RUN A PROGRAM

Before feeding the ".obj" file


into LINK, all syntax errors
must be corrected.
Fixing these errors will not
guarantee the program will
work as intended, as the program
may contain conceptual errors.

The x86 PC 16
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
8
16
6/28/2022

2.3: MORE SAMPLE PROGRAMS

• Program 2-1, and the list file generated when the


program was assembled.

See the entire program listing on page 63 of your textbook.

The x86 PC 17
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

17

2.3: MORE SAMPLE PROGRAMS


analysis of Program 2-1
• Program 2-1, explained instruction by instruction:
– "MOV CX,05" will load the value 05 into the CX register.
• Used by the program as a counter for iteration (looping).
– "MOV BX,OFFSET DATA_IN" will load into BX the
offset address assigned to DATA.
• The assembler starts at offset 0000 and uses memory for
the data, then assigns the next available offset memory for
SUM (in this case, 0005).
– "ADD AL,[BX]" adds the contents of the memory
location pointed at by the register BX to AL.
• Note that [BX] is a pointer to a memory location.
– "INC BX" increments the pointer by adding 1 to BX.
• This will cause BX to point to the next data item. (next byte)

The x86 PC 18
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
9
18
6/28/2022

2.3: MORE SAMPLE PROGRAMS


analysis of Program 2-1
• Program 2-1, explained instruction by instruction:
– "DEC CX" will decrement (subtract 1 from) the CX
counter and set the zero flag high if CX becomes zero.
– "JNZ AGAIN" will jump back to the label AGAIN as
long as the zero flag is indicating that CX is not zero.
• "JNZ AGAIN" will not jump only after the zero flag has been
set high by the "DEC CX" instruction (CX becomes zero).
– When CX becomes zero, this means that the loop is
completed and all five numbers have been added to AL.

The x86 PC 19
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

19

2.3: MORE SAMPLE PROGRAMS


various approaches to Program 2-1
• Variations of Program 2-1 clarify use of addressing
modes, and show that the x86 can use any general-
purpose register for arithmetic and logic operations.

The x86 PC 20
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
10
20
6/28/2022

2.3: MORE SAMPLE PROGRAMS


analysis of Program 2-2
• The address pointer is incremented twice, since the
operand being accessed is a word (two bytes).
– The program could have used "ADD DI,2" instead of
using "INC DI" twice.
• "MOV SI,OFFSET SUM" was used to load the
pointer for the memory allocated for the label SUM.
• "MOV [SI],BX" moves the contents of register BX
to memory locations with offsets 0010 and 0011.
• Program 2-2 uses the ORG directive to set the
offset addresses for data items.
– This caused SUM to be stored at DS:0010.

The x86 PC 21
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

21

2.3: MORE SAMPLE PROGRAMS


analysis of Program 2-3
• Program 2-3 shows the data segment being
dumped before and after the program was run.

See the entire program listing on page 67 of your textbook.


The x86 PC 22
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
11
22
6/28/2022

2.3: MORE SAMPLE PROGRAMS


analysis of Program 2-3
• C4 was coded in the data segments as 0C4.
– Indicating that C is a hex number and not a letter.
• Required if the first digit is a hex digit A through F.
• This program uses registers SI & DI as pointers
to the data items being manipulated.
– The first is a pointer to the data item to be copied.
– The second points to the location the data is copied to.
• With each iteration of the loop, both data pointers
are incremented to point to the next byte.

The x86 PC 23
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

23

2.4: CONTROL TRANSFER INSTRUCTIONS


conditional jumps
• Conditional jumps have mnemonics such as JNZ
(jump not zero) and JC (jump if carry).
– In the conditional jump, control is transferred to a new
location if a certain condition is met.
– The flag register indicates the current condition.
• For example, with "JNZ label", the processor looks
at the zero flag to see if it is raised.
– If not, the CPU starts to fetch and execute instructions
from the address of the label.
– If ZF = 1, it will not jump but will execute the next
instruction below the JNZ.

The x86 PC 24
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
12
24
6/28/2022

2.4: CONTROL TRANSFER INSTRUCTIONS


conditional jumps

The x86 PC 25
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

25

2.4: CONTROL TRANSFER INSTRUCTIONS


short jumps
• All conditional jumps are short jumps.
– The address of the target must be within -128 to +127
bytes of the IP.
• The conditional jump is a two-byte instruction.
– One byte is the opcode of the J condition.
– The second byte is a value between 00 and FF.
• An offset range of 00 to FF gives 256 possible addresses.
• In a jump backward, the second byte is the
2's complement of the displacement value

The x86 PC 26
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
13
26
6/28/2022

2.4: CONTROL TRANSFER INSTRUCTIONS


short jumps
• To calculate the target address, the second byte is
added to the IP of the instruction after the jump.

– "JNZ AGAIN" was assembled as "JNZ 000D", and 000D


is the address of the instruction with the label AGAIN.
• "JNZ 000D" has the opcode 75 and the target address FA.
The x86 PC 27
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

27

2.4: CONTROL TRANSFER INSTRUCTIONS


short jumps
• This is followed by "MOV SUM,AL", which is located
beginning at offset address 0013.

– The IP value of MOV,0013, is added to FA to calculate the


address of label AGAIN, and the carry is dropped.
• FA is the 2's complement of -6.
The x86 PC 28
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
14
28
6/28/2022

2.4: CONTROL TRANSFER INSTRUCTIONS


short jumps
• Calculate a forward jump target address by adding
the IP of the following instruction to the operand.
– The displacement value is positive, as shown.

– "JB NEXT" has the opcode 72, the target address 06


and is located at IP = 000A and 000B.
• The jump is 6 bytes from the next instruction, is IP = 000C.
• Adding gives us 000CH + 0006H = 0012H, which is the exact
address of the NEXT label.

The x86 PC 29
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

29

2.4: CONTROL TRANSFER INSTRUCTIONS


short jumps
• For conditional jumps, the address of the target
address can never be more than -128 to +127 bytes
away from the IP associated with the instruction
following the jump.
– Any attempt is made to violate this rule will generate a
"relative jump out of range" message.

The x86 PC 30
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
15
30
6/28/2022

2.4: CONTROL TRANSFER INSTRUCTIONS


unconditional jumps
• An unconditional jump transfers control to the target
location label unconditionally, in the following forms:
– SHORT JUMP - in the format "JMP SHORT label".
• A jump within -128 to +127 bytes of memory relative to the
address of the current IP, opcode EB.
– NEAR JUMP - the default, has the format "JMP label".
• A jump within the current code segment, opcode E9.
• The target address can be any of the addressing modes of
direct, register, register indirect, or memory indirect:
– Direct JUMP - exactly like the short jump.
• Except that the target address can be anywhere in the
segment in the range +32767 to -32768 of the current IP.

The x86 PC 31
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

31

2.4: CONTROL TRANSFER INSTRUCTIONS


unconditional jumps
• An unconditional jump transfers control to the target
location label unconditionally, in the following forms:
– Register indirect JUMP - target address is in a register.
• In "JMP BX", IP takes the value BX.
– Memory indirect JMP - target address is the contents
of two memory locations, pointed at by the register.
• "JMP [DI]" will replace the IP with the contents of memory
locations pointed at by DI and DI+1.
– FAR JUMP - in the format "JMP FAR PTR label".
register.
• A jump out of the current code segment
• IP and CS are both replaced with new values.

The x86 PC 32
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
16
32
6/28/2022

2.4: CONTROL TRANSFER INSTRUCTIONS


CALL statements
• The CALL instruction is used to call a procedure, to
perform tasks that need to be performed frequently.
– The target address could be in the current segment, in
which case it will be a NEAR call or outside the current
CS segment, which is a FAR call.
• The microprocessor saves the address of the
instruction following the call on the stack.
– To know where to return, after executing the subroutine.
• In the NEAR call only the IP is saved on the stack.
• In a FAR call both CS and IP are saved.

The x86 PC 33
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

33

2.4: CONTROL TRANSFER INSTRUCTIONS


CALL statements
• For control to be transferred back to the caller, the
last subroutine instruction must be RET (return).
– For NEAR calls, the IP is restored.
– For FAR calls, CS & IP are restored.
• Assume SP = FFFEH:

– Since this is a NEAR call, only IP


is saved on the stack.
• The IP address 0206, which belongs
to the "MOV AX,142F" instruction,
is saved on the stack.
The x86 PC 34
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
17
34
6/28/2022

2.4: CONTROL TRANSFER INSTRUCTIONS


short jumps
• The last instruction of the called subroutine must be
a RET instruction that directs the CPU to POP the
top 2 bytes of the stack into the IP and resume
executing at offset address 0206.
– The number of PUSH and POP instructions (which alter
the SP) must match.
• For every PUSH there must be a POP.

The x86 PC 35
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

35

2.4: CONTROL TRANSFER INSTRUCTIONS


rules for names in Assembly language
• The names used for labels in Assembly language
programming consist of…
– Alphabetic letters in both upper- and lowercase.
– The digits 0 through 9.
– Question mark (?); Period (.); At (@)
– Underline (_); Dollar sign ($)
• Each label name must be unique.
– They may be up to 31 characters long.
• The first character must be an alphabetic or special
character.
– It cannot be a digit.

The x86 PC 36
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
18
36
6/28/2022

2.5: DATA TYPES AND DATA DEFINITION


x86 data types
• The 8088/86 processor supports many data types.
– Data types can be 8- or 16-bit, positive or negative.
• The programmer must break down data larger than
16 bits (0000 to FFFFH, or 0 to 65535 in decimal).
– A number less than 8 bits wide must be coded as
an 8-bit register with the higher digits as zero.
• A number is less than 16 bits wide must use all 16 bits.

The x86 PC 37
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

37

2.5: DATA TYPES AND DATA DEFINITION


ORG origin
• ORG is used to indicate the beginning of the offset
address.
– The number after ORG can be either in hex or in decimal.
• If the number is not followed by H, it is decimal and the
assembler will convert it to hex.

The x86 PC 38
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
19
38
6/28/2022

2.5: DATA TYPES AND DATA DEFINITION


DB define byte
• One of the most widely used data directives, it
allows allocation of memory in byte-sized chunks.
– This is the smallest allocation unit permitted.
– DB can define numbers in decimal, binary, hex, & ASCII.
• D after the decimal number is optional.
• B (binary) and H (hexadecimal) is required.
• To indicate ASCII, place the string in single quotation marks.
• DB is the only directive that can be used to define
ASCII strings larger than two characters.
– It should be used for all ASCII data definitions.

The x86 PC 39
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

39

2.5: DATA TYPES AND DATA DEFINITION


DB define byte
• Some DB examples:

– Single or double quotes can be used around ASCII


strings.
• Useful for strings, which should contain a single quote,
such as "O'Leary".

The x86 PC 40
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
20
40
6/28/2022

2.5: DATA TYPES AND DATA DEFINITION


DB define byte
• List file for DB examples.

The x86 PC 41
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

41

2.5: DATA TYPES AND DATA DEFINITION


DW define word
• DW is used to allocate memory 2 bytes (one word)
at a time:

• List file for DW examples.

The x86 PC 42
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
21
42
6/28/2022

2.5: DATA TYPES AND DATA DEFINITION


EQU equate
• EQU associates a constant value with a data label.
– When the label appears in the program, its constant value
will be substituted for the label.
– Defines a constant without occupying a memory location.
• EQU for the counter constant in the immediate
addressing mode:

• When executing the instructions "MOV CX,COUNT",


the register CX will be loaded with the value 25.
– In contrast to using DB:

The x86 PC 43
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

43

2.5: DATA TYPES AND DATA DEFINITION


EQU equate
• When executing the same instruction "MOV
CX,COUNT" it will be in the direct addressing mode.
– EQU can also be used in the data segment:

– Assume a constant (a fixed value) used in many


different places in the data and code segments.
• By use of EQU, one can change it once and the
assembler will change all of them.

The x86 PC 44
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
22
44
6/28/2022

2.6: FULL SEGMENT DEFINITION


code segment definition
• Immediately after PROC, the ASSUME directive,
associates segments with specific registers.
– By assuming the segment register is equal to the
segment labels used in the program.
• If an extra segment had been used, ES would
also be included in the ASSUME statement.
– ASSUME tells the assembler which of the segments,
defined by SEGMENT, should be used.
• Also helps the assembler to calculate the offset
addresses from the beginning of that segment.
• In "MOV AL, [BX] " the BX register is the offset of
the data segment.

The x86 PC 45
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

45

2.6: FULL SEGMENT DEFINITION


code segment definition
• On transfer of control from OS to the program, of
the three segment registers, only CS and SS have
the proper values.
– The DS value (and ES) must be initialized by the program.

The x86 PC 46
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
23
46
6/28/2022

2.6: FULL SEGMENT DEFINITION


the emu8086 assembler
• A simple, popular assembler for 8086 Assembly
language programs is called emu8086.

See emu8086 screenshots on page 80 - 82 of your textbook.

The x86 PC 47
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

47

2.6: FULL SEGMENT DEFINITION


the emu8086 assembler

Download the emu8086


assembler from this website:
http://www.emu8086.com
See a Tutorial on how to use it at:
http://www.MicroDigitalEd.com

The x86 PC 48
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
24
48
6/28/2022

2.7: FLOWCHARTS AND PSEUDOCODE


control structures

Flowchart vs. pseudocode for


Program 2-1, showing steps for
initializing/decrementing counters.
Housekeeping, such as initializing
the data segment register in the
MAIN procedure are not included
in the flowchart or pseudocode.

The x86 PC 49
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey

49

Dec Hex Bin


2 2 00000010

ENDS ; TWO

The x86 PC 50
Assembly Language, Design, and Interfacing
By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey
25
50

You might also like