Microprocessor Simulator 0 Help


Passing Parameters   MOV BL,70



Download 1.18 Mb.
Page48/82
Date18.03.2021
Size1.18 Mb.
#56105
1   ...   44   45   46   47   48   49   50   51   ...   82
sms32v50 (3)
sms32v50 (3), sms32v50 (6)

Passing Parameters


 

MOV BL,70


The BL register contains 70. This value is needed by the text input procedure. It is the address where the text will be stored in RAM. This is an example of passing a parameter using a register. All you are doing is getting a number from one part of a program to another.

INC BL


This command adds one to BL. The effect is to make BL point to the next memory location ready for the next text character to be stored.

CALL 10


Call the procedure at address [10]. This is achieved in practice by setting the CPU instruction pointer IP to [10].

RET


At the end of the procedure, the RET command resets the CPU instruction pointer IP back to the instruction after the CALL instruction to the procedure. This address was stored on the stack by the CALL instruction.

HALT


Don't confuse HALT and END. The END command causes the assembler to stop scanning for more instructions in the program. The HALT command generates machine code 00 which causes the CPU to halt. There can be several HALT commands in a program but only one END command.

ORG 10


Origin [10]. The assembler program starts generating machine code from address [10].

Download 1.18 Mb.

Share with your friends:
1   ...   44   45   46   47   48   49   50   51   ...   82




The database is protected by copyright ©ininet.org 2024
send message

    Main page