Programar em Assembly com GAS/Interrupções do BIOS

Origem: Wikilivros, livros abertos por um mundo aberto.

Interrupções do BIOS[editar | editar código-fonte]

BIOS[editar | editar código-fonte]

O BIOS ele é um software um sistema elementar de entrada e saída (que comunica com dispositivos do hardware) é um conjunto de funções que esta contido na memória morta (ROM) de uma carta mãe. As funções do BIOS podem variar de um software a outro por isso é importante se puder encontrar um manual para programadores do BIOS com o qual quer se trabalhar.

Interrupções[editar | editar código-fonte]

Uma interrupção interrompe um procedimento normal de um programa para executar uma outra rotina (rotina de interrupção).
Quando uma interrupção acontece ela guarda tudo ou uma parte do estado de execução do programa na pilha e pula para executar a rotina de interrupção cujo endereço está em uma tabela.No modo real pode ser a IVT (Interrupt Vector Table) que contem todo os endereços segmento e offset (CS:IP) da rotina a ser executada.

Algumas Interrupções[editar | editar código-fonte]

  • CPU: Interrupção do microprocessador
  • BIOS: Serviços do BIOS ,interrupção de Software.
  • Sinais IRQ: Interrupção de Hardware.
  • soft: Interrupção de Software

Alguém motivado para traduzir?

Vetor(hexa) Pedido Utilização
INT 00h CPU Divisão por zero
INT 01h CPU Executed after every instruction while the trace flag is set
INT 02h CPU NMI, used e.g. by POST for memory errors
INT 03h CPU The lowest non-reserved interrupt, it is used exclusively for debugging, and the INT 03 handler is always implemented by a debugging program
INT 04h CPU Numeric Overflow. Usually caused by the INTO instruction when the overflow flag is set.
INT 05h CPU Executed when Shift-PrintScreen is pressed, as well as when the BOUND instruction detects a bound failure.
INT 06h CPU Código inválido (ou código de modo protegido no modo real)
INT 07h CPU Extensão não disponível (coprocessador não presente)
INT 08h IRQ0 Relógio de tempo real (timer tick).
INT 09h IRQ1 Teclado.
INT 0Bh IRQ3 (COM2/COM4)
INT 0Ch IRQ4 Portas seriais (COM1/COM3)
INT 0Dh IRQ5 Disco rígido.
INT 0Eh IRQ6 Drive de disquetes.
INT 0Fh IRQ7 Impressora.
INT 10h BIOS Serviços de Video

Instalado pela BIOS ou sistema operacional
Chamado por programas.

AH=00h 	Set Video Mode
AH=01h 	Set Cursor Shape
AH=02h 	Set Cursor Position
AH=03h 	Get Cursor Position And Shape
AH=04h 	Get Light Pen Position
AH=05h 	Set Display Page
AH=06h 	Clear/Scroll Screen Up
AH=07h 	Clear/Scroll Screen Down
AH=08h 	Read Character and Attribute at Cursor
AH=09h 	Write Character and Attribute at Cursor
AH=0Ah 	Write Character at Cursor
AH=0Bh 	Set Border Color
AH=0Eh 	Write Character in TTY Mode
AL             Caracter a ser escrito.
AH=0Fh 	Get Video Mode
AH=13h 	Write String
INT 11h BIOS Configuração do equipamento
INT 12h BIOS Retorna o tamanho de memória
INT 13h BIOS Serviços de Disco de Nível Baixos

Instalado pela BIOS ou sistema operacional
Chamado por programas.

AH=00h 	Reset Disk Drives
AH=01h 	Check Drive Status
AH=02h 	Read Sectors From Drive
AH=03h 	Write Sectors To Drive
AH=04h 	Verifies Sectors On Drive
AH=05h 	Format Track On Drive
AH=08h 	Get Drive Parameters
AH=09h 	Init Fixed Drive Parameters
AH=0Ch 	Seek To Specified Track
AH=0Dh 	Reset Fixed Disk Controller
AH=15h 	Get Drive Type
AH=16h 	Get Floppy Drive Media Change Status
INT 14h BIOS Rotinas para a comunicação via portas seriais RS232
  AH=00h 	Serial Port Initialization
  AH=01h 	Transmit Character
  AH=02h 	Receive Character
  AH=03h 	Status
INT 15h BIOS Serviços de cassete (PC) ou extensões.
AH=4FH 	Keyboard Intercept
AH=83H 	Event Wait
AH=84H 	Read Joystick
AH=85H 	Sysreq Key Callout
AH=86H 	Wait
AH=87H 	Move Block
AH=88H 	Get Extended Memory Size
AH=C0H 	Get System Parameters
AH=C1H 	Get Extended BIOS Data Area Segment
AH=C2H 	Pointing Device Functions
AH=0E8h, AL=01h (AX = 0E801h) 	Get Extended Memory Size(Newer function, since 1994). Gives results for memory  
size above 64 Mb.
INT 16h BIOS Serviços de teclado
   AH=00h 	Read Character
   AH=01h 	Read Input Status
   AH=02h 	Read Keyboard Shift Status
   AH=10h 	Read Character Extended
   AH=11h 	Read Input Status Extended
   AH=12h 	Read Keyboard Shift Status Extended
INT 17h BIOS Serviços de impressora - Usado pelo software para comunicar com a impressora.
  AH=00h 	Print Character to Printer
  AH=01h 	Initialize Printer
  AH=02h 	Check Printer Status
INT 18h BIOS Execute Cassette BASIC: True IBM computers contain BASIC in the ROM to be interpreted and executed by this routine in the event of a boot failure (called by the BIOS)
INT 19h BIOS Esta interrupção é usada pela BIOS para carregar o sistema operacional.
INT 1Ah BIOS Serviços de Relógio em Tempo real - chamado por programas de software para comunicar-se com o RTC
  AH=00h 	Read RTC
  AH=01h 	Set RTC
  AH=02h 	Read RTC Time
  AH=03h 	Set RTC Time
  AH=04h 	Read RTC Date
  AH=05h 	Set RTC Date
  AH=06h 	Set RTC Alarm
  AH=07h 	Reset RTC Alarm
INT 1Bh BIOS Tratamento de Ctrl-Break
INT 1Ch BIOS Called automatically by INT 08; available for use by software programs when a routine needs to be executed regularly
INT 1Dh Soft Parâmetros de controle do vídeo; Ponteiro para a VPT (Video Parameter Table)
INT 1Eh Soft Not to be called; simply a pointer to the DPT (Diskette Parameter Table), containing a variety of information concerning the diskette drives
INT 1Fh Soft Not to be called; simply a pointer to the VGCT (Video Graphics Character Table), which contains the data for ASCII characters 80h to FFh
INT 41h Soft Address pointer: FDPT = Fixed Disk Parameter Table (1st hard drive)
INT 46h Soft Address pointer: FDPT = Fixed Disk Parameter Table (2nd hard drive)
INT 4Ah Called by RTC for alarm
INT 70h IRQ8 Called by RTC
INT 74h IRQ12 Mouse no PS/2 - uso geral em um PC
INT 75h IRQ13 Coprocessador aritmético
INT 76h IRQ14 Controlador de disco rígido (controladora IDE primária)
INT 77h IRQ15 Uso geral (controladora secundária de disco)

Exemplos de utilização com o GAS[editar | editar código-fonte]