Microprocessor Simulator V5.0 Help

final paperfor profes Kelvin James only
March 3, 2021
The Case for Free Markets: The Price System.
March 3, 2021

Microprocessor Simulator V5.0 Help

; ---------------------------------------------------------------_x000D_
_x000D_
;  A general purpose time delay procedure._x000D_
_x000D_
;  The delay is controlled by the value in AL._x000D_
_x000D_
;  When the procedure terminates, the CPU registers are_x000D_
;  restored to the same values that were present before _x000D_
;  the procedure was called. Push, Pop, Pushf and Popf_x000D_
;  are used to achieve this.  In this example one procedure _x000D_
_x000D_
;  is re-used three times.  This re-use is one of the main _x000D_
;  advantages of using procedures._x000D_
_x000D_
;------ The Main Program ----------------------------------------_x000D_
Start:_x000D_
	MOV	AL,8	; A short delay._x000D_
	CALL	30	; Call the procedure at address [30]_x000D_
_x000D_
	MOV	AL,10	; A middle sized delay._x000D_
	CALL	30	; Call the procedure at address [30]_x000D_
_x000D_
	MOV	AL,20	; A Longer delay._x000D_
	CALL	30	; Call the procedure at address [30]_x000D_
_x000D_
JMP	Start	; Jump back to the start._x000D_
_x000D_
; ----- Time Delay Procedure Stored At Address [30] -------------_x000D_
	ORG	30	; Generate machine code from address [30]_x000D_
_x000D_
	PUSH	AL	; Save AL on the stack._x000D_
	PUSHF		; Save the CPU flags on the stack._x000D_
Rep:_x000D_
	DEC	AL	; Subtract one from AL._x000D_
	JNZ	REP	; Jump back to Rep if AL was not Zero._x000D_
_x000D_
	POPF		; Restore the CPU flags from the stack._x000D_
	POP	AL	; Restore AL from the stack._x000D_
_x000D_
	RET		; Return from the procedure._x000D_
; ---------------------------------------------------------------_x000D_
	END_x000D_
; ---------------------------------------------------------------_x000D_
_x000D_
TASK_x000D_
_x000D_
Re-do the traffic lights program and use this procedure _x000D_
	to set up realistic time delays.  02tlight.asm (See below)


; ===== CONTROL THE TRAFFIC LIGHTS =============================_x000D_ _x000D_ CLO ; Close unwanted windows._x000D_ Start:_x000D_ ; Turn off all the traffic lights._x000D_ MOV AL,0 ; Copy 00000000 into the AL register._x000D_ OUT 01 ; Send AL to Port One (The traffic lights)._x000D_ ; Turn on all the traffic lights._x000D_ MOV AL,FC ; Copy 11111100 into the AL register._x000D_ OUT 01 ; Send AL to Port One (The traffic lights)._x000D_ JMP Start ; Jump back to the start._x000D_ END ; Program ends._x000D_ _x000D_ ; ===== Program Ends ==========================================
 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.