feat: новые функции были подшиты к основному шаблону

This commit is contained in:
Miheev Egor
2024-09-10 23:53:08 +03:00
parent a338ac968e
commit 4c423c7acc
3 changed files with 24 additions and 4 deletions

View File

@ -2,6 +2,8 @@
#include <stdlib.h>
#include <unistd.h>
#include "substitutions.h"
#define PortCan0 0x40
void beep(unsigned iTone, unsigned iDlit);
@ -27,15 +29,18 @@ int main(void) {
printf("\n Читаем содержимое порта с адресом 40 с помощью функции Си \n");
printf("\n Для выхода из цикла - нажмите любую клавишу \n");
while (bioskey(1) == 0) {
set_input_mode();
while (isKeyPressed() == 0) {
printf("\n Порт40 = %d", inp(PortCan0));
delay(500);
}
reset_input_mode();
system("pause");
printf("\n Читаем содержимое порта с адресом 40 ассемблером \n");
while (bioskey(1) == 0) {
set_input_mode();
while (isKeyPressed() == 0) {
asm {
push ax
in al,0x40
@ -45,19 +50,23 @@ int main(void) {
delay(500);
printf("\n Порт40 = %d", Tmm);
}
reset_input_mode();
system("pause");
printf("\n Для продолжения - нажмите любую клавишу \n");
system("pause");
long *pTime = (long *)0x46C;
while (bioskey(1) == 0) {
set_input_mode();
while (isKeyPressed() == 0) {
printf("\n %ld", *pTime);
delay(1000);
}
reset_input_mode();
system("pause");
int Time;
while (bioskey(1) == 0) {
set_input_mode();
while (isKeyPressed() == 0) {
asm push ds
asm push si
asm mov ax, 40h
@ -71,6 +80,7 @@ int main(void) {
printf("\n %d", Time);
delay(300);
}
reset_input_mode();
beep(400, 200);
for (lCnt = 0; lCnt < 1000000; lCnt++) {