GAS Informações do sistema
Publicado por Perfil removido (última atualização em 12/08/2011)
[ Hits: 4.854 ]
Mostra as informações do sistema, tais como RAM livre, Swap, Número de processos, etc...
.section .data espaco: .ascii "\n" strEmb: .ascii "\nInformações do Sistema \n===============================\n" strUp: .ascii "Up time: " numUp: .ascii " \n" strMem: .ascii "Total de Memória RAM: " strMemL: .ascii "Total de Memória RAM Livre: " strMemShared: .ascii "Memória RAM Compartilhada: " strBufRam: .ascii "Buffer Ram: " strSwap: .ascii "Total Swap: " strSwapL: .ascii "Espaço Livre de Swap: " strProc: .ascii "Procs: " strHigh: .ascii "Total High: " strUn: .ascii "Mem. Unit: " strCpu: .ascii "Seu processador é: " output: .ascii " xxxxxxxxxxxx " numMem: .ascii " \n" uptime: .int 0 load1: .int 0 load5: .int 0 load15: .int 0 totalram: .int 0 freeram: .int 0 sharedram: .int 0 bufferram: .int 0 totalswap: .int 0 freeswap: .int 0 procs: .byte 0, 0 totalhigh: .int 0 memunit: .int 0 .section .text _start: movl $4, %eax movl $1, %ebx movl $strEmb, %ecx movl $59, %edx int $0x80 movl $uptime, %ebx call saida movl $numUp, %edi call print movl $4, %eax movl $1, %ebx movl $strUp, %ecx movl $9, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numUp, %ecx movl $11, %edx int $0x80 movl $totalram, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strMem, %ecx movl $22, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $freeram, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strMemL, %ecx movl $28, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $sharedram, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strMemShared, %ecx movl $28, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $bufferram, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strBufRam, %ecx movl $12, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $totalswap, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strSwap, %ecx movl $12, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $totalswap, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strSwapL, %ecx movl $23, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $procs, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strProc, %ecx movl $7, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $totalhigh, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strHigh, %ecx movl $12, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $memunit, %ecx call saida movl $numMem, %edi call print movl $4, %eax movl $1, %ebx movl $strUn, %ecx movl $11, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $numMem, %ecx movl $11, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $strCpu, %ecx movl $19, %edx int $0x80 movl $0, %eax cpuid movl $output, %edi inc %edi movl %ebx, (%edi) addl $4, %edi movl %edx, (%edi) addl $4, %edi movl %ecx, (%edi) movl $4, %eax movl $1, %ebx movl $output, %ecx movl $13, %edx int $0x80 movl $4, %eax movl $1, %ebx movl $espaco, %ecx movl $2, %edx int $0x80 movl $1, %eax int $0x80 saida: movl $116, %eax int $0x80 movl %ecx, %eax movl (%eax), %eax ret print: addl $10, %edi movl $10, %ecx call converte ret converte: dec %edi dec %ecx movl $0, %edx movl $10, %ebx divl %ebx addl $48, %edx movb %edx, (%edi) cmp $0, %ecx jne converte ret #@
Escrita de um número em hexadecimal na tela em Assembly Puro para Linux x86 (GNU Assembly)
Escrita de um número em octal na tela em Assembly Puro para Linux x86 (Nasm - Netwide Assembler)
"Clear Screen" para Linux 64 bits em Assembly Puro (GNU Assembly)
Escrita de um número em hexadecimal na tela em Assembly Puro para Linux 64 bits (GNU Assembly
Como gerar um podcast a partir de um livro em PDF
Automatizando digitação de códigos 2FA no browser
Resolver problemas de Internet
Como compartilhar a tela do Ubuntu com uma Smart TV (LG, Samsung, etc.)
Conheça a 4Devs, caixa de ferramentas online para desenvolvedores
Como converter um vídeo MP4 para um GIF para publicar no README.md do seu repositório Github
Como Instalar o Microsoft Teams no Linux Ubuntu