nasm

Reading a single-key input on Linux (without waiting for return) using x86_64 sys_call

时光毁灭记忆、已成空白 提交于 2020-08-15 12:54:17
问题 I want to make linux just take 1 keystroke from keyboard using sys_read, but sys_read just wait until i pressed enter. How to read 1 keystroke ? this is my code: Mov EAX,3 Mov EBX,0 Mov ECX,Nada Mov EDX,1 Int 80h Cmp ECX,49 Je Do_C Jmp Error I already tried using BIOS interrupt but it's failed (Segmentation fault), I want capture number 1 to 8 input from keyboard. Thanks for the advance Sorry for bad english 回答1: Syscalls in 64-bit linux The tables from man syscall provide a good overview

Reading a single-key input on Linux (without waiting for return) using x86_64 sys_call

。_饼干妹妹 提交于 2020-08-15 12:53:55
问题 I want to make linux just take 1 keystroke from keyboard using sys_read, but sys_read just wait until i pressed enter. How to read 1 keystroke ? this is my code: Mov EAX,3 Mov EBX,0 Mov ECX,Nada Mov EDX,1 Int 80h Cmp ECX,49 Je Do_C Jmp Error I already tried using BIOS interrupt but it's failed (Segmentation fault), I want capture number 1 to 8 input from keyboard. Thanks for the advance Sorry for bad english 回答1: Syscalls in 64-bit linux The tables from man syscall provide a good overview

使用 VS2015 编译并调试 ffmpeg

我们两清 提交于 2020-08-14 08:56:18
导读   ffmpeg 是 音频处理方面 非常强大非常有名的开源项目了,然而如 雷神 所说,“ FFMPEG 难度比较大,却没有一个循序渐进,由简单到复杂的教程。现在网上的有关FFMPEG的教程多半难度比较大,不太适合刚接触 FFMPEG 的人学习;而且很多的例子程序编译通不过,极大地打消了学习的积极性 ” ,对于平时只习惯在 Windows 下开发的初学者来说,从零开始了解相关依赖,搭建起项目并调试 ffmpeg 并不是件容易的事,好在另一个非官方的 开源项目,提供了一整套 Windows 下,用 VS 来调试 ffmpeg 的解决方案—— Shift Media Project 。   本文使用最新版本的 ShiftMediaProject 的代码(20191015),展示在Windows10 下使用 VS2015 下载代码并成功编译的过程。在另一篇本文参考的 博文 中亦介绍了整个过程,不过由于是 20180307 写的,有些新的内容没有覆盖到,这里可当做是对其进行补充和拓展。同时也作为个人笔记分享出来,希望能帮助到更多刚好有需求的人。 目录 工具准备 下载源代码 按项目指引下载相关依赖 使用VS编译ffmpeg 编译与运行 1、工具准备 本文测试使用环境: 操作系统: Windows 10 编译使用开发环境: Visual Studio 2015 下载源代码工具: git

What cause segment fault after function call in assembly x64 [duplicate]

主宰稳场 提交于 2020-08-09 17:52:25
问题 This question already has answers here : Return from jump to main (1 answer) Nasm segmentation fault on RET in _start (1 answer) call subroutines conditionally in assembly (3 answers) How does $ work in NASM, exactly? (1 answer) Difference between JUMP and CALL (5 answers) Closed yesterday . My OS: Linux debian 4.19.0-9-amd64 #1 SMP Debian x86_64 GNU/Linux Compiler: NASM version 2.14 I try play with conditional jumps, function calling and comparing expressions. I wrote something simple, and

edk2+vs2019环境搭建

本秂侑毒 提交于 2020-08-09 13:32:43
所有命令行操作都在CMD内执行 CMD->Developer Command Prompt for VS 2019 (vs自带的命令行环境,也可以直接CMD执行 C:\"Program Files (x86)"\"Microsoft Visual Studio"\2019\Community\Common7\Tools\VsDevCmd.bat) 0. 软件安装/配置环境 VS2019 C++(官网) python 3.8(官网) NASM http://www.nasm.us/(随便找个地方解压) ASL https://acpica.org/downloads/binary-tools(必须解压到C:\ASL,否则找不到) 1. clone edk2 找个地方建立一个工作目录叫EFIwork然后cd进去(VsDevCmd里面先打盘符如E:才能在这个盘里cd) E: cd E:\EFIwork git clone https://github.com/tianocore/edk2.git edk2 cd edk2 git submodule update --init cd .. 1 2 3 4 5 6 如果要更新的话 cd edk2 git pull git submodule update 1 2 3 2. 编译edk2的win32生成工具 /////////////////

centos 7.5源码安装freeswitch 1.10.3

夙愿已清 提交于 2020-08-07 19:13:20
1、下载freeswitch安装包(freeswitch-1.10.2.-release.tar.gz) 2、安装对应依赖 yum install -y git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel libdb4-devel e2fsprogs-devel erlang flite-devel g722_1-devel gcc-c++ gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libxml2-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl

用于测试Collat​​z猜想的C ++代码比手写汇编要快-为什么?

孤街浪徒 提交于 2020-08-04 22:09:48
问题: I wrote these two solutions for Project Euler Q14 , in assembly and in C++. 我用汇编语言和C ++语言为 Euler Q14项目 编写了这两种解决方案。 They are the same identical brute force approach for testing the Collatz conjecture . 它们是用于测试 Collat​​z猜想 的相同相同的蛮力方法。 The assembly solution was assembled with 组装解决方案与 nasm -felf64 p14.asm && gcc p14.o -o p14 The C++ was compiled with C ++使用 g++ p14.cpp -o p14 Assembly, p14.asm 汇编, p14.asm section .data fmt db "%d", 10, 0 global main extern printf section .text main: mov rcx, 1000000 xor rdi, rdi ; max i xor rsi, rsi ; i l1: dec rcx xor r10, r10 ; count mov rax, rcx l2: test

can't compare user input with number, nasm elf64

笑着哭i 提交于 2020-07-31 04:30:03
问题 I swear I've read more than 20 pages today, from NASM's manual to Universities' guides to Wikipedia to everything in between but I just can't wrap my head around this, I wrote a single program to compare the user input with either a 0 or a 1 and then act based on that (I should probably use an array once I get the hang of them in Assembly), but this will do for now. Problem is, my checks never work , they always go straight to the err label, I looked at x86 NASM Assembly - Problems with Input

can't compare user input with number, nasm elf64

核能气质少年 提交于 2020-07-31 04:29:47
问题 I swear I've read more than 20 pages today, from NASM's manual to Universities' guides to Wikipedia to everything in between but I just can't wrap my head around this, I wrote a single program to compare the user input with either a 0 or a 1 and then act based on that (I should probably use an array once I get the hang of them in Assembly), but this will do for now. Problem is, my checks never work , they always go straight to the err label, I looked at x86 NASM Assembly - Problems with Input

NASM x86_64 assembly in 32-bit mode: Why does this instruction produce RIP-Relative Addressing code?

孤街浪徒 提交于 2020-07-29 06:59:12
问题 [bits 32] global _start section .data str_hello db "HelloWorld", 0xa str_hello_length db $-str_hello section .text _start: mov ebx, 1 ; stdout file descriptor mov ecx, str_hello ; pointer to string of characters that will be displayed mov edx, [str_hello_length] ; count outputs Relative addressing mov eax, 4 ; sys_write int 0x80 ; linux kernel system call mov ebx, 0 ; exit status zero mov eax, 1 ; sys_exit int 0x80 ; linux kernel system call The fundamental thing here is that I need to have