feat: смог очистить от комментариев и отформатировать первый шаблон
This commit is contained in:
87
01-asm-basics/Labv1.cpp
Normal file
87
01-asm-basics/Labv1.cpp
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#include <bios.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <dos.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define PortCan0 0x40
|
||||||
|
|
||||||
|
void beep(unsigned iTone, unsigned iDlit);
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
|
||||||
|
long int lCnt = 0;
|
||||||
|
int iA = 0x1234;
|
||||||
|
|
||||||
|
char *pT = (char *)0x46C;
|
||||||
|
printf("\n\n");
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
printf(" \n %d ", *pT);
|
||||||
|
printf("\n\n");
|
||||||
|
getch();
|
||||||
|
|
||||||
|
printf("\n <20><>⠥<EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>ᮬ 40 <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨 <20><> \n");
|
||||||
|
printf("\n <20><><EFBFBD> <20><>室<EFBFBD> <20><> 横<><E6A8AA> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n");
|
||||||
|
|
||||||
|
while (bioskey(1) == 0) {
|
||||||
|
printf(" \n <20><><EFBFBD><EFBFBD>40 = %d ", inp(PortCan0));
|
||||||
|
delay(500);
|
||||||
|
}
|
||||||
|
getch();
|
||||||
|
printf("\n <20><>⠥<EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>ᮬ 40 <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD> \n");
|
||||||
|
|
||||||
|
while (bioskey(1) == 0) {
|
||||||
|
asm {
|
||||||
|
push ax
|
||||||
|
in al,0x40
|
||||||
|
}
|
||||||
|
unsigned char Tmm = _AL;
|
||||||
|
asm pop ax delay(500);
|
||||||
|
printf(" \n <20><><EFBFBD><EFBFBD>40 = %d ", Tmm);
|
||||||
|
}
|
||||||
|
getch();
|
||||||
|
printf("\n <20><><EFBFBD> <20>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n ");
|
||||||
|
getch();
|
||||||
|
|
||||||
|
long far *pTime = (long *)0x46C;
|
||||||
|
while (bioskey(1) == 0) {
|
||||||
|
printf("\n %ld", *pTime);
|
||||||
|
delay(1000);
|
||||||
|
}
|
||||||
|
getch();
|
||||||
|
|
||||||
|
int Time;
|
||||||
|
while (bioskey(1) == 0) {
|
||||||
|
asm push ds asm push si
|
||||||
|
|
||||||
|
asm mov ax,
|
||||||
|
40h asm mov ds, ax asm mov si, 0x6C asm mov ax, [ds : si] asm mov Time,
|
||||||
|
ax asm pop si asm pop ds
|
||||||
|
|
||||||
|
printf("\n %d", Time);
|
||||||
|
delay(300);
|
||||||
|
}
|
||||||
|
|
||||||
|
beep(400, 200);
|
||||||
|
for (lCnt = 0; lCnt < 1000000; lCnt++) {
|
||||||
|
a1:
|
||||||
|
asm { mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
mov ax,iA
|
||||||
|
a2:
|
||||||
|
mov ax,iA
|
||||||
|
}
|
||||||
|
}
|
||||||
|
beep(400, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
void beep(unsigned iTone, unsigned iDlit) {
|
||||||
|
sound(iTone);
|
||||||
|
delay(iDlit);
|
||||||
|
nosound();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user