CODE: [Copy to clipboard]
#include <stdio.h>
#include <conio.h>
#include <dos.h>
typedef unsigned char BYTE;
typedef unsigned int WORD;
typedef BYTE far* LPBYTE;
typedef WORD far* LPWORD;
int main()
{
LPBYTE pV = MK_FP(0x9FFF, 0x0000); // 0104 C42F LES BP, [BX]
LPWORD pT = MK_FP(0x0000, 0x046C); // 010A 6413066C04 ADC AX, FS:[046C]
WORD c = 0;
// 0100 B013 MOV AL,13
// 0102 CD10 INT 10
__asm{
mov ax, 0x0013;
int 0x10;
}
do{
// 0106 AA STOSB
*pV++ = (BYTE)c;
// 0107 11F8 ADC AX,DI
c += FP_OFF(pV);
__asm adc c, 0; // 处理进位
// 010A 6413066C04 ADC AX, FS:[046C]
c += *pT;
__asm adc c, 0; // 处理进位
//010E EBF6 JMP 0106
}while(!kbhit());
if (0==getch()) getch();
__asm{
mov ax, 0x0003;
int 0x10;
}
return 0;
}
[