i386

Error: use of overloaded operator '[]' is ambiguous while building for i386

送分小仙女□ 提交于 2021-02-09 08:34:02
问题 Consider the following code: #include <stdio.h> #include <stdint.h> class test_class { public: test_class() {} ~test_class() {} const int32_t operator[](uint32_t index) const { return (int32_t)index; } operator const char *() const { return "Hello World"; } }; int main(void) { test_class tmp; printf("%d\n", tmp[3]); return 0; } When I use command clang++ -arch i386 test.cc to build those codes, it yields the following on clang++ (Apple LLVM version 9.1.0 (clang-902.0.39.1)): test.cc:24:21:

Error: use of overloaded operator '[]' is ambiguous while building for i386

a 夏天 提交于 2021-02-09 08:29:32
问题 Consider the following code: #include <stdio.h> #include <stdint.h> class test_class { public: test_class() {} ~test_class() {} const int32_t operator[](uint32_t index) const { return (int32_t)index; } operator const char *() const { return "Hello World"; } }; int main(void) { test_class tmp; printf("%d\n", tmp[3]); return 0; } When I use command clang++ -arch i386 test.cc to build those codes, it yields the following on clang++ (Apple LLVM version 9.1.0 (clang-902.0.39.1)): test.cc:24:21:

In x86 assembly, when should I use global variables instead of local variables?

梦想的初衷 提交于 2021-02-08 03:39:55
问题 I am creating some small programs with x86 assembly, and it's my first time using a low level language so I'm not used to it. In high level languages I rarely use global variables, but I've seen a lot of tutorials using global variables in assembly, so I'm not sure when to use global variables instead of local variables. By global variables I mean data created in the .bss and .data segments, and by local variables I mean data allocated on the stack of the current procedure, using the stack

How to install the i386 version of R on ubuntu? [closed]

一世执手 提交于 2021-01-28 07:13:22
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Improve this question How to install the i386 version of R on ubuntu? I already have the x64 version installed on the server, but I need the 32-bit version to use a library that is on the same version. 回答1: I would recommend installing VirtualBox, and running a 32 bit Ubuntu version in

How can the timer interrupt be 0x08 if the first 32 interrupts are reserved for exceptions?

倖福魔咒の 提交于 2021-01-27 05:05:06
问题 I am developing an embedded program for an intel i386, and I am trying to figure out how to use the hardware timer. I have read here (and other places) that the timer interrupt is 0x08, but this page (And various other sources) say that the first 32 interrupts are reserved for exceptions, and interrupt 0x08 specifically is for double fault. Which is true? How can I setup a timer interrupt handler, using either assembly or very low-level C with no operating system calls? I am developing a

Is the i386 instruction “div ah” pointless?

与世无争的帅哥 提交于 2021-01-18 11:04:15
问题 From https://www.felixcloutier.com/x86/div: ... temp ← AX / SRC; IF temp > FFH THEN #DE; (* Divide error *) ELSE AL ← temp; AH ← AX MOD SRC; FI; ... For div ah the SRC would be ah . IMHO temp will always be larger than FFH and therefore the exception will be raised since: AX = 256*AH+AL temp = AX / AH = (256*AH+AL)/AH = 256 + AL/AH temp is over FFH Do I miss something here? 回答1: That's correct, just like div edx it's never usable without faulting. The criterion for 2N/N => N-bit div not

Is the i386 instruction “div ah” pointless?

偶尔善良 提交于 2021-01-18 11:02:44
问题 From https://www.felixcloutier.com/x86/div: ... temp ← AX / SRC; IF temp > FFH THEN #DE; (* Divide error *) ELSE AL ← temp; AH ← AX MOD SRC; FI; ... For div ah the SRC would be ah . IMHO temp will always be larger than FFH and therefore the exception will be raised since: AX = 256*AH+AL temp = AX / AH = (256*AH+AL)/AH = 256 + AL/AH temp is over FFH Do I miss something here? 回答1: That's correct, just like div edx it's never usable without faulting. The criterion for 2N/N => N-bit div not

Why does gcc generates strange code without flag -fno-pie?

眉间皱痕 提交于 2020-05-09 06:35:09
问题 I am trying to compile dummy function in gcc with flag -fno-pie and without. void dummy_test_entrypoint() { } When i compile without the flag. gcc -m32 -ffreestanding -c test.c -o test.o I get the following disassembled code. 00000000 <dummy_test_entrypoint>: 0: 55 push ebp 1: 89 e5 mov ebp,esp 3: e8 fc ff ff ff call 4 <dummy_test_entrypoint+0x4> 8: 05 01 00 00 00 add eax,0x1 d: 90 nop e: 5d pop ebp f: c3 ret When i compile with the flag. 00000000 <dummy_test_entrypoint>: 0: 55 push ebp 1: 89

Why does gcc generates strange code without flag -fno-pie?

蹲街弑〆低调 提交于 2020-05-09 06:35:01
问题 I am trying to compile dummy function in gcc with flag -fno-pie and without. void dummy_test_entrypoint() { } When i compile without the flag. gcc -m32 -ffreestanding -c test.c -o test.o I get the following disassembled code. 00000000 <dummy_test_entrypoint>: 0: 55 push ebp 1: 89 e5 mov ebp,esp 3: e8 fc ff ff ff call 4 <dummy_test_entrypoint+0x4> 8: 05 01 00 00 00 add eax,0x1 d: 90 nop e: 5d pop ebp f: c3 ret When i compile with the flag. 00000000 <dummy_test_entrypoint>: 0: 55 push ebp 1: 89

Ubuntu18.04下 QQ、微信安装。deepinQQ、deepin微信、deepin百度网盘

生来就可爱ヽ(ⅴ<●) 提交于 2020-04-04 11:18:11
Ubuntu18.04下 QQ、微信安装。deepinQQ、deepin微信、deepin百度网盘 一.首先在ubuntu18.04中安装deepin-wine环境 在githuub上有人已经将deepin-wine环境打包好了,不需要我们一一安装依赖项 可以去https://gitee.com/wszqkzqk/deepin-wine-for-ubuntu 也可以使用下面代码进行下载 git clone https://gitee.com/wszqkzqk/deepin-wine-for-ubuntu.git 下载完成后进行安装 $cd deepin-wine-for-ubuntu $./install.sh 二.安装deepinQQ 、deepin微信、deepin百度网盘 去 http://mirrors.aliyun.com/deepin/pool/non-free/d/ 进行手动下载,下载好之后,双击进行安装即可 网址中也含有其他软件。 QQ: http://mirrors.aliyun.com/deepin/pool/non-free/d/deepin.com.qq.im/ 微信: http://mirrors.aliyun.com/deepin/pool/non-free/d/deepin.com.wechat/ 三.安装好之后,最小化界面之后,会找不到软件 这时