Microprocessor Simulator 0 Help



Download 1.18 Mb.
Page71/82
Date18.03.2021
Size1.18 Mb.
#56105
1   ...   67   68   69   70   71   72   73   74   ...   82
sms32v50 (3)
sms32v50 (3), sms32v50 (6)

Stack Overflow


The stack is repeatedly pushed until it is full. The simulator does not detect this condition and the stack can overwite program code or data. Real life programs can fail in the same way.

Stack Underflow


The stack is repeatedly popped until it is empty. The next pop causes an underflow.


Procedures and Interrupts


Detailed Instruction Set


Procedures and Interrupts - Flags are NOT set.


These are available in the registered version. Please register.

It is essential to save the registers and flags used by any procedure or interrupt and restore them after the procedure or interrupt has finished its work. Use push and pushf to save. Use pop and popf to restore values.

 

Assembler

Machine Code

Explanation

CALL 30

CA 30

Call the procedure at address 30.
The return address is pushed onto the stack and the Instruction Pointer (IP) is set to 30.
CA is the machine instruction for CALL.
30 is the address of the start of the procedure being called.

RET

CB

Return from the procedure.
Set the Instruction Pointer (IP) to the return address popped off the stack.
CB is the machine instruction for Return.

INT 03

CC 03

The Instruction Pointer (IP) is set to the address of the interrupt vector retrieved from RAM address 03.
The return address is pushed onto the stack.
CC is the machine instruction for INT.
03 is the address of the interrupt vector used by the INT command.

IRET

CD

Return from the interrupt.
Set the Instruction Pointer (IP) to the return address popped off the stack.
CD is the machine instruction for IRET.





Download 1.18 Mb.

Share with your friends:
1   ...   67   68   69   70   71   72   73   74   ...   82




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

    Main page