Student ID: MC190407267 Name: Mehwish Qandil: Assignment
Student ID: MC190407267 Name: Mehwish Qandil: Assignment
01
Semester: Spring 2021 Solution
CS609 System Programming
Assignment
Question No 1: 10 Marks
Reading Carry flag’s value using INTDOS() and REGS Union
Write a C language Function that will perform the following:
Place last digit of your Student ID in AH register and second last digit of your
Student ID in DL register (by using REGS Union only)
After that, read the value of Carry flag by using INTDOS() function
o If carry flag is set, print your Student ID, and
o If carry flag is not set, print your complete name
Solution:
#include <dos.h> // for intdos() and union REGS
Solution:
regs.h.ah = 0x10;
printf(“%x”, regss.x.ax);
}
Output/Result: 10116