vm51_init.c

来自「c51 单片机模拟器C++文件格式元代纳一边以」· C语言 代码 · 共 47 行

C
47
字号
/*
  Name: emu51_init
  Copyright: rockins
  Author: rockins
  Date: 06-08-05 22:07
  Description: this module initial the circumstance
*/

#include "vm51.h"
#include <stdio.h>
#include <stdlib.h>

int VM51_init(void)
{
#ifdef __VM51_DEBUG__
	printf("init environment...\n");
#endif
    PC = 0x0000;
    ACC = 0x00;
    PSW = 0x00;
    SP = 0x07;
    DPL = 0x00;
    DPH = 0x00;
    P0 = 0xFF;
    P1 = 0xFF;
    P2 = 0xFF;
    P3 = 0xFF;
    IP = 0x00;
    IE = 0x00;
    TMOD = 0x00;
    TCON = 0x00;
    TL0 = 0x00;
    TH0 = 0x00;
    TL1 = 0x00;
    TH1 = 0x00;
    SCON = 0x00;
    SBUF = 0x00;
    PCON = 0x00;
        
    tick = 0;
    debug = OFF;
#ifdef __VM51_DEBUG__
    VM51_output_reg();
    VM51_output_mem();
#endif
}    

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?