D
D
D0ct0r_Murder2018-04-18 01:27:30
Iron
D0ct0r_Murder, 2018-04-18 01:27:30

Does the _outp function still work, I don't have it. What alternatives are there? Is it relevant to read hardware programming 8 years on win 8?

Here is the code from the book:

int GetBaseMemory()
{
  // объявляем переменные для получения младшего и старшего байтов
  BYTE lowBase = 0, highBase = 0;
  // читаем информацию из CMOS-памяти
  _outp(0x70, 0x15); // записываем номер первого регистра
  lowBase = _inp(0x71); // читаем младший байт
  _outp(0x70, 0x16); // записываем номер первого регистра
  highBase = _inp(0x71); // читаем старший байт
               // возвращаем размер базовой памяти в килобайтах
  return ((highBase << 8) | lowBase);
}

void KeyBoard_OnOff(bool bOff)
{
  BYTE state; // текущее состояние
  if (bOff) // выключить клавиатуру
  {
    state = _inp(0x61); // получаем текущее состояние
    state |= 0x80; // устанавливаем бит 7 в 1
    _outp(0x61, state); // записываем обновленное значение в порт
  }
  else // включить клавиатуру
  {
    state = _inp(0x61); // получаем текущее состояние
    state &= 0x7F; // устанавливаем бит 7 в 0
    _outp(0x61, state); // записываем обновленное значение в порт
  }
}

And is it possible to immediately study this with a normal result without knowing the assembler, computer architecture, etc.?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stalker_RED, 2018-04-18
@Stalker_RED

https://docs.microsoft.com/ru-ru/cpp/c-runtime-lib...
These features are deprecated. Starting with Visual Studio 2015, they are not available in the CRT.

And is it possible to immediately study this with a normal result without knowing the assembler, computer architecture, etc.?
Yes, yes, SSZB, xs.

C
CityCat4, 2018-04-18
@CityCat4

And is it possible to immediately study this with a normal result without knowing the assembler, computer architecture, etc.?

Full immersion method, yopt. :) Harsh, long, slow, but giving killer results. It can be compared with moving to a country whose language you do not know - but you are going to learn in the process of living in it :)

A
anikavoi, 2018-04-18
@anikavoi

The asm directive will save.
THIS? Not!
Ports are architecture.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question