Google

Jun 30, 2008

A subroutine program in assembly language

A subroutine based program in assembly language.

this is the MAIN PROGRAM

LXI SP 2400H
LXI H,2000H
LXI B,1020H
CALL SUB
HLT

this is the subroutine
SUB: PUSH B
PUSH H
LXI B,4080H
LXI H,4090H
DAD B
SHLD 2200H
POPH
POPB
RET

this subroutine is some thing like functions in c program language. here the main function is calling the subroutine SUB in the last but one line then the flow of the execution of the program is transfered to the subroutine once the program flow is reached to the end of the subroutine i.e RET statement then the execution will be going to the main program.


You might be also interested in:

:: free and open source 8086 Microprocessor Emulator
:: Invoke function

No comments: