Assembly Language 2
-
Upload
nurul-badriah-anwar-ali -
Category
Documents
-
view
217 -
download
0
description
Transcript of Assembly Language 2
Course Name : Computer OrganisationCourse Code : TDB1123/TCB1043Date Assigned : Week 10________________________________________________________________________1.0 Flag RegisterThe Flags register is a special 16-bit register with individual bit positions assigned to show the status of theCPU or the results of arithmetic operations. Each relevant bit position is given a name; other positions areundefined!it Position1" 1# 1$ 1% 11 1& ' ( ) 6 " # $ % 1 &* * * * +, - T . /*0 * P * C+ 1 +verflow, 1 ,irection - 1 -nterruptT 1 Trap2 1 undefined3ortunatel4 we do not have to memori5e each flag position. -nstead6 there are special instructions designedto test and manipulate the flags. 0 flag or bit is set when it e7uals 1; it is clear 8to reset9 when it e7uals &.The CPU sets flags b4 turning on individuals bits in the flags register. There are two basic t4pes of flagscontrol flags and status flags.a. Control Flags-ndividual bits ma4 be set in the 3lags register b4 the programmer to control the CPU:s operation.These are the Direction, Interrupt6 and Trap flags. The Direction flag controls the assumed direction used b4 string processing instructions. The flagsvalues are 11 up and &1 down. The programmer controls this flag6 using the .T, and C;, instructions.The Interrupt flag ma