Introduction to ibm pc assembly languagewarda aziz
The Solution manual of COAL
Chapter NO 4. exercise
if anyone has Questions Regarding this exercise.
contact me on my given Email-ID.
i will guide you. Thank you!
Linked list
Advantages and disadvantages
Types of linked lists
Singly linked list
Doubly linked list
Header linked lists
Applications of linked list
Algorithm to search a value
Example of LinkedList
Algorithm for inserting a node
single link list
Applications of Arrays
data in continuous memory
queues
stacks
beginning of a linked list
traversing a linked list
Algorithm for traversing
Grounded header linked list
Circular Header linked list
Chapter 5The proessor status and the FLAGS registerswarda aziz
solution manual to COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE CHAPTER 5.
If you find any mistake in the manual please share with me ... it will be appreciated
chapter 7 Logic, shift and rotate instructionswarda aziz
this is a solution to exercise of chapter 7 from Assembly language programming and organization of the IBM PC.
If you find any mistakes in my solution , please discuss with me. as i am also a human and can do mistakes.
Introduction to ibm pc assembly languagewarda aziz
The Solution manual of COAL
Chapter NO 4. exercise
if anyone has Questions Regarding this exercise.
contact me on my given Email-ID.
i will guide you. Thank you!
Linked list
Advantages and disadvantages
Types of linked lists
Singly linked list
Doubly linked list
Header linked lists
Applications of linked list
Algorithm to search a value
Example of LinkedList
Algorithm for inserting a node
single link list
Applications of Arrays
data in continuous memory
queues
stacks
beginning of a linked list
traversing a linked list
Algorithm for traversing
Grounded header linked list
Circular Header linked list
Chapter 5The proessor status and the FLAGS registerswarda aziz
solution manual to COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE CHAPTER 5.
If you find any mistake in the manual please share with me ... it will be appreciated
chapter 7 Logic, shift and rotate instructionswarda aziz
this is a solution to exercise of chapter 7 from Assembly language programming and organization of the IBM PC.
If you find any mistakes in my solution , please discuss with me. as i am also a human and can do mistakes.
Organization of the ibm personal computerswarda aziz
The Solution manual of COAL
Chapter NO 3. exercise
if anyone has Questions Regarding this exercise.
contact me on my given Email-ID.
i will guide you. Thank you!
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...warda aziz
this pdf covers solution to chapter 8 and 9 of assembly language and organization of the IBM PC. if you find any mistakes in my writing , please disccuss with me.
INC and DEC Instructions
ADD Instruction
SUB Instruction
NEG Instruction
Implementing Arithmetic Expressions
Flags Affected by Addition and Subtraction
Example Program (AddSub3)
Assembly Language Programming and Organization of the IBM PC
By Yu and Marut
Solution Manual
( Ch.1 to ch.10 )
Written by :
Eng. Amer Mohammed Al-khsabah
For Online Tutorial :
http://sh.st/QaM4Z
Solution manual of assembly language programming and organization of the ibm ...Tayeen Ahmed
This introduction to the organization and programming of the 8086 family of microprocessors used in IBM microcomputers and compatibles is comprehensive and thorough. Includes coverage of I/O control, video/graphics control, text display, and OS/2. Strong pedagogy with numerous sample programs illustrates practical examples of structured programming.
Organization of the ibm personal computerswarda aziz
The Solution manual of COAL
Chapter NO 3. exercise
if anyone has Questions Regarding this exercise.
contact me on my given Email-ID.
i will guide you. Thank you!
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...warda aziz
this pdf covers solution to chapter 8 and 9 of assembly language and organization of the IBM PC. if you find any mistakes in my writing , please disccuss with me.
INC and DEC Instructions
ADD Instruction
SUB Instruction
NEG Instruction
Implementing Arithmetic Expressions
Flags Affected by Addition and Subtraction
Example Program (AddSub3)
Assembly Language Programming and Organization of the IBM PC
By Yu and Marut
Solution Manual
( Ch.1 to ch.10 )
Written by :
Eng. Amer Mohammed Al-khsabah
For Online Tutorial :
http://sh.st/QaM4Z
Solution manual of assembly language programming and organization of the ibm ...Tayeen Ahmed
This introduction to the organization and programming of the 8086 family of microprocessors used in IBM microcomputers and compatibles is comprehensive and thorough. Includes coverage of I/O control, video/graphics control, text display, and OS/2. Strong pedagogy with numerous sample programs illustrates practical examples of structured programming.
Advance procedures in assembly are fully explained by me and my group mates.
Main topics are:
*Stack frames
-Recursion
-ADDR, INVOKE , LOCAL, PROC , PROTO directives and variables
-MultiModule Programs in assembly
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basicssecurityxploded
This presentation is part of our Reverse Engineering & Malware Analysis Training program.
For more details refer our Security Training page
http://securityxploded.com/security-training.php
1.1 Nested Loops – Lab3C.cppLoops often have loops inside .docxchristiandean12115
1.1 Nested Loops – Lab3C.cpp
Loops often have loops inside them. These are called “nested” loops. In this exercise you will finish a nested loop that reads lines of numbers from a file and computes and prints out the sum of each line.
//C++ Lab3C.cpp
// <Your Name>
// <Your Section>
// <Your student id>
//1. [include required header files]//
using namespace std;
int main()
{
[2. Declare required variables]
try
{
//3> put your file name & Open file as an input mode
ifstream Openfile(" “);
//4> If file doesn't exist then throw error number
if(Openfile.good())
{
while( getline(Openfile, sLine)) //Outer While Loop Condition
{
cout << "The Contents of line sLine" << sLine << "\n";
stringstream Str(sLine);
while (Str >> temp ) //Inner While Loop Condition
{
cout << "String ~to double" << temp;
}// Inner while Loop
} //Outer While Loop
Openfile.close();
//3> Catch the error number and display message
}
else {
throw 10;
}
} //if
catch(int e)
{
cout << "File Not found " << e << endl;
}
//system("pause"); //Pause
return 0;
}//main
1.2 Once you have completed the program, run it on the input file below:
Lab4C.in
10 20 30 40 50
60 70 80 90.0
11 13.0
20 40 70 19.0
Lab4C.out or Lab4C.doc with screen shot
Read Line 0 10.0 Sum 10.0
Read Line 0 20.0 Sum 30.0
Read Line 0 30.0 Sum 60.0
Read Line 0 40.0 Sum 100.0
Read Line 0 50.0 Sum 150.0
…..
Read Line 3 20.0 Sum 20.0
Read Line 3 40.0 Sum 60.0
Read Line 3 70.0 Sum 130.0
Read Line 3 19.0 Sum 149.0
1.3 Upload your four files (Lab3A.cpp, Lab3B.cpp, Lab3C.cpp and Lab3C.doc) as one single zip file named “Lab3ABC.zip”)
2. Lab3D – Two Dimensional Arrays
2.1 Declaring 2D arrays
In C++, to make a 2D array, we simply declare an array where the type is an array. To see how this works, first look at how we create an int array with 10 elements. One might type
int arr1D[ 10] ;
What the above code actually does is create a new “int Array” that reserves enough space to store 10 integers. For creating a 2D arrays, we can make an array of them, by appending another set of square brackets:
int arr2D[3][7];
This declares a two dimensional array of ints with 3 rows and 7 columns. By convention, we think of the array as being indexed in “Row Major Order”, which means that the row (y value) comes before the column (x value).
Thus, visually, the array looks like this:
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
The top left element is at position [0][0], and the bottom right element is at position [2][6]. The array elements are initialized just as in the 1D case ( Numerics are set to 0, and object types are set to null). To access one of the elements of a 2D array, we use double bracket notation again, so we can write
arr2D[0][1] = 1;
arr2D[2][3] = 4;
This would give us the array:
0 1 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 4 0 0 0
If.
I have question in c++ program I need the answer as soon as possible.docxdelciegreeks
I have question in c++ program I need the answer as soon as possible
I attached the file
1.1
Nested Loops – Lab3C.cpp
Loops often have loops inside them. These are called “nested” loops. In this exercise you will finish a nested loop that reads lines of numbers from a file and computes and prints out the sum of each line.
//C++ Lab3C.cpp
//
//
//
//1. [include required header files]//
using namespace std;
int main()
{
[2. Declare required variables]
try
{
//3> put your file name & Open file as an input mode
ifstream Openfile(" “);
//4> If file doesn't exist then throw error number
if(Openfile.good())
{
while( getline(Openfile, sLine)) //Outer While Loop Condition
{
cout << "The Contents of line sLine" << sLine << "\n";
stringstream Str(sLine);
while (Str >> temp ) //Inner While Loop Condition
{
cout << "String ~to double" << temp;
}// Inner while Loop
} //Outer While Loop
Openfile.close();
//3> Catch the error number and display message
}
else {
throw 10;
}
} //if
catch(int e)
{
cout << "File Not found " << e << endl;
}
//system("pause"); //Pause
return 0;
}//main
1.2
Once you have completed the program, run it on the input file below:
Lab4C.in
10 20 30 40 50
60 70 80 90.0
11 13.0
20 40 70 19.0
Lab4C.out or Lab4C.doc with screen shot
Read Line 0 10.0 Sum 10.0
Read Line 0 20.0 Sum 30.0
Read Line 0 30.0 Sum 60.0
Read Line 0 40.0 Sum 100.0
Read Line 0 50.0 Sum 150.0
…..
Read Line 3 20.0 Sum 20.0
Read Line 3 40.0 Sum 60.0
Read Line 3 70.0 Sum 130.0
Read Line 3 19.0 Sum 149.0
1.3
Upload your four files (Lab3A.cpp, Lab3B.cpp, Lab3C.cpp and Lab3C.doc) as one single zip file named “Lab3ABC.zip”)
2.
Lab3D – Two Dimensional Arrays
2.1
Declaring 2D arrays
In C++, to make a 2D array, we simply declare an array where the type is an array. To see how this works, first look at how we create an int array with 10 elements. One might type
int arr1D[ 10] ;
What the above code actually does is create a new “int Array” that reserves enough space to store 10 integers. For creating a 2D arrays, we can make an array of them, by appending another set of square brackets:
int arr2D[3][7];
This declares a two dimensional array of ints with 3 rows and 7 columns. By convention, we think of the array as being indexed in “Row Major Order”, which means that the row (y value) comes before the column (x value).
Thus, visually, the array looks like this:
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
The top left element is at position [0][0], and the bottom right element is at position [2][6]. The array elements are initialized just as in the 1D case ( Numerics are set to 0, and object types are set to null). To access one of the elements of a 2D array, we use double bracket notation again, so we can write
arr2D[0][1] = 1;
arr2D[2][3] = 4;
This would give us the array:
0 1 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 4 0 0 0
If we want to visit or process every ele ...
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
4. String Primitives
These instructions use memory operands pointed by the
ESI register or EDI register or both.
Used register(s) is automatically incremented or
decremented after instruction execution based on the
Direction flag (a bit in the EFLAGS register).
If the direction flag is cleared (DF = 0), registers are incremented.
Otherwise (DF = 1), they are decremented.
Direction flag can be set by std instruction, and cleared by cld
instruction
5. String Primitives
They often used with repeat prefix which allows them to
be automatically repeated using ECX as a counter. So, you
can process an entire array or string using only single
instruction.
The following repeat prefixes are used:
REP inst_Name
6. String Primitives
When repeat prefix is used, the sequence of its operation
is as follows:
1. Test repeat condition(s) [ECX > 0 and zero flag status
with REPE and REPNE]
2. If test success, perform the instruction (in addition to
incrementing or decrementing ESI or EDI or both).
Otherwise, skip the entire instruction.
8. MOVSB / MOVSW / MOVSD Instructions
These instructions copy data pointed by ESI to the
memory location pointed by EDI. They are used with
repeat prefixes to copy arrays and strings.
It’s Like:
T
H
E
T
H
E
ESIEDI
ESI
ESI
EDI
EDI
MOV [EDI], [ESI]
9. [Hands On] Copy an Array
Use string primitive instructions to copy items from
double word array to another, then display the output
10. .data
source dword 10,20,30,40,50
target dword 5 dup(?)
.code
main proc
cld ;clear direction flag. Move forward
mov ecx, lengthof source
mov esi, offset source
mov edi, offset target
rep movsd
; display the target array
mov edx, OFFSET target
mov ecx, lengthof target
L1:
MOV eax, [edx]
CALL WriteInt
CALL CRLF
ADD edx, TYPE target
LOOP L1
exit
main endp
end main
12. CMPSB / CMPSW / CMPSD
These instructions compare a memory operand pointed
by ESI (source) with the memory operand pointed by EDI
(destination).
They actually subtract target from source and set flags
according to the result like CMP instruction.
It’s Like:
CMP [EDI], [ESI]
14. [Solved Example] CMP 2 Strings
Compare two strings assuming that both strings have the
same size.
15. .data
source byte 'ameen'
target byte 'ayman'
strSmall byte "source is smaller",0
strGreat byte "source is greater",0
strEqual byte "both strings are equal",0
.code
main proc
cld ;clear the direction flag
mov esi, offset source
mov edi, offset target
mov ecx, lengthof source
repe cmpsb ;compare the 2 arrays and stop at the first
mismatch
jb source_smaller ;check last char in source and last
ja source_greater ;char in dest
mov edx, offset strEqual
jmp done
16. source_smaller:
mov edx, offset strSmall
jmp done
source_greater:
mov edx, offset strGreat
done:
call writestring
call Crlf
exit
main endp
end main
17. [Hands On] CMP 2 Strs with Diff Len
Implement the same previous example but assume the
strings have different length
Key Idea:
1.Loop for the length of the minimum
2.Handle case JB and JA like pervious
3.In case of having the same chars check the length of
each
18. .data
source byte 'ameen'
target byte 'ayman'
strSmall byte "source is smaller",0
strGreat byte "source is greater",0
strEqual byte "both strings are equal",0
.code
main proc
cld ;clear the direction flag
mov esi, offset source
mov edi, offset target
mov ecx, lengthof source
mov eax, lengthof target ;EAX = length of target string
19. .if ecx > eax
mov ecx, eax
.endif
repe cmpsb ;compare the 2 arrays and stop at the first mismatch
jb source_smaller ;check last char in source and last char in dest
ja source_greater
.if eax < lengthof source ;if both chars are equal then
jmp source_greater ;check the length of each one
.elseif eax > lengthof source
jmp source_smaller
.else
mov edx, offset strEqual
jmp done
.endif
source_smaller:
mov edx, offset strSmall
jmp done
source_greater:
mov edx, offset strGreat
done:
call writestring
call Crlf
exit
main endp
20. SCASB / SCASW / SCASD Instructions
Compare a value in AL/AX/EAX to a byte, word, or double
word addressed by EDI respectively.
They are useful when looking for a single value in an array or
a string.
1. Start = EDI
2. Inversed Index = ECX
3. What to search for = AL/AX/EAX
4. Return the index if exists in ECX register
It counts from the end of the array
20
21. [Hands On] Find ‘W’
Write an assembly program the search for letter ‘w’ in a
given string
It’s a sequential search…
22. .data
str1 byte "hello world",0
.code
main proc
cld
mov edi, offset str1
mov ecx, lengthof str1
mov al, 'w'
repne scasb ;scan string till 'w' is found
jne not_found ;'w' is not found, jump to not_found label
;Otherwise, ecx has the index of that character but
reversed
;So, make eax = lengthof(str1) - ecx - 1
mov eax, lengthof str1 - 1
sub eax, ecx
jmp done
not_found:
mov eax, -1
done: ;eax has the index of the char OR -1 if not found
call writeint
exit
main endp
24. STOSB / STOSW / STOSD Instructions
These instructions store the content of AL/AX/EAX into
memory at the offset pointed to by EDI.
They are useful for filling all elements of a string or array
with a single value.
It’s Like
MOV BYTE PTR [EDI], AL
MOV WORD PTR [EDI], AX
MOV DWORD PTR [EDI], EAX
25. [Solved Example] Fill an Array
Uses string primitive instructions to initialize an array by a
specific value.
It reminds me with DUP API ;)
Use an already defined word array with length 20
Init. it with 5
26. .data
arr1 word 20 dup (?)
.code
main proc
cld
mov edi, offset arr1
mov ecx, lengthof arr1
mov ax, 5 ;save number you want to initialize with in
the AX
rep stosw ;set all items in arr1 by AX value
;display the array elements
mov ecx , lengthof arr1
mov esi, offset arr1
L1:
movzx eax, WORD PTR[esi]
call writeInt
Call CRLF
LOOP L1
exit
main endp
end main
28. LODSB / LODSW / LODSD Instructions
These instructions load a byte, word, or double word
from memory at ESI into AL/AX/EAX respectively.
REP prefix is rarely used with them as each new value
loaded into accumulator overwrites its previous
contents.
MOV AL, BYTE PTR [ESI]
MOV AX, WORD PTR [ESI]
MOV EAX, DWORD PTR [ESI]
29. [Hands On] Array Multiplier
Write an assembly program the multiply a Dword array with
10
Example
You have a fixed array 1, 2, 3, 4, 5
Print 10, 20, 30, 40, 50
Key Idea
1. Load array element by element
2. Multiply loaded element by 10
3. Store element
30. .data
arr1 dword 1, 2, 3, 4, 5
multiplier dword 10
.code
main proc
cld
mov esi, offset arr1 ;initialize ESI for LODSD
instruction
mov edi, esi ;initialize EDI for STOSD instruction
mov ecx, lengthof arr1
l1:
lodsd ;mov eax, [esi]
mul multiplier ;edx:eax = eax * multiplier
stosd ;mov [edi], eax
loop l1
31. ;display array elements…
mov ecx, lengthof arr1
mov esi, offset arr1
L2:
mov eax, [esi] ;Or use LODSB instruction…
call writeInt
call crlf
add esi, type arr1
Loop L2
exit
main endp
end main
33. Two Dimensional Arrays
Multi-dimensional arrays in assembly are defined as
single dimensional arrays… WHY??
For example, a 2D array can be defined as 1D array where
rows are concatenated in a single row.
Accessing items in 2D arrays can be done by indirect
memory addressing mode using a base register and an
index register like [ebx+esi].
In such addressing mode, a base register (i.e. ebx) should contain
the row offset while an index register (i.e. esi) should contain the
column offset.
34. [Solved Example] Sum 2D Arr
Given 2D array
Calculate it’s sum in the EAX
Then display it
Questions?
1. 2D Array how to declare?
2. How to parse/navigate from row to row? key idea
36. Sum2DArr proc USES esi ecx ebx edx,
table: PTR DWORD, nrows:DWORD, ncols:DWORD
mov esi, table ;ESI = start of 1st row
mov ecx, nrows ;ECX: # of rows
; will be used as a row index
mov edx, ncols
shl edx, 2 ;EDX: # of bytes in each row (ncols*4)
mov ebx, 0 ;col index
mov eax, 0 ;EAX: accumulator for the result
l1:
.while ebx < ncols
add eax, [esi+4*ebx]
inc ebx
.endw
mov ebx,0 ;Reset col. Index for each row
add esi, edx ;ESI: points to the next row
loop l1
ret
Sum2DArr endp
37. [Hands On] Sum i Col. In 2D Arr
Calculate the sum of a given column in a 2D array
USING PROC
Given in .data
table1 dword 1, 2, 3, 4
dword 5, 6, 7, 8
dword 9, 10, 11, 12
Col to be summed = 3
Sum = 24
39. SumCol proc USES esi ecx ebx edx,
table: PTR DWORD, nrows:DWORD, ncols:DWORD, icol:DWORD
mov esi, table ;ESI: points to the beginning of array
(1st row) base reg
mov ecx, nrows ;ECX: # of rows
; will be used as a row index
mov edx, ncols
shl edx, 2 ;EDX: # of bytes in each row (ncols*4)
mov ebx, icol ;EBX: index of target column
mov eax, 0 ;EAX: accmulator for the result
l1:
add eax, [esi+4*ebx]
add esi, edx ;ESI: points to the next row
loop l1
ret
SumCol endp
end main
41. asm_strCat
1. Write a procedure named asm_strCat that
concatenates a source string to the end of a target string.
Use string primitive instructions when is possible.
42. asm_strFind
2. Write a procedure named asm_strFind that searches
for a string inside a target string and returns the first
matching position if any. Use string primitive instructions
when is possible.
43. asm_strRemove
3. Write a procedure named asm_strRemove that
removes n characters from a string. This procedure
should take a pointer to a string, the position in the string
where the character are to be removed and number of
characters to be removed n. Use string primitive
instructions when is possible.