Ferguson Institute Online Div. of Jmlit
Assignment #17
Assembly programming and binary calculations. 

PROBLEMS:

1.  	Manually, add these two binary numbers and set the flags accordingly.

	10111101
    (+)	01110111
	---------------
    1	00110100	

2.  	Manually, subtract the bottom binary number from the top and set the flags accordingly.   First we take the two's complement of 01110111.

	10111101					10111101
     (-)	01110111		10001000 +1 = 	10001001
	---------------					---------------
						    1	01000110

3.  	Use the - E command to enter this short program into memory.   
	
	then type . . . to enter a program line into memory

-E B0 80					MOV	AL, 80H		
-E 04 03					ADD		AL, 03H
-E B3 50					MOV	BL, 50H
-E B2 30					MOV	DL, 30H
-E 02 C3					ADD		AL, BL		
-E 02 D3					ADD		DL, BL
etc.

1.  - E A 

2.  - E  A 

3.  - E  A .

4.  - E  A    

Single step the program and observe the condition code flags.
	They will be either  
	
	OV   	or	NV		- overflow
	DN	or	UP		- direction
	EI	or	DI		- enable or disable
	NG	or	PL		- sign + or -
	ZR	or	NZ		- zero
	AC	or	NA		- aux carry
	PE	or	PO		- parity
	CY	or	NC		- carry

	EX: 	-RF
		-OV DN EI NG ZR AC PE CY
___________________________________________________________
example #1:

ADD AL 63H

____________________________________________________________
example #2:

ADD BX 63H
____________________________________________________________
example #3:   Signed numbers

ADD CL, BL
____________________________________________________________
example #4: Unsigned numbers

ADD CL, BL
______________________________________
example #5:

CMP BH, BL
______________________________________
example #6:

CMP AX, 135H
JNBE RUN_LABEL
______________________________________
example #7:

IMUL CX,BX,06H
_______________________________________
example #8:

IN AL, 34H

______________________________________
example #9:

OUT AL, 34H