32-bit

Would one have to know the machine architecture to write code?

折月煮酒 提交于 2019-12-05 07:54:04
Let's say I'm programming in Java or Python or C++ for a simple problem, could be to build an TCP/UDP echo server or computation of factorial. Do I've to bother about the architecture details, i.e., if it is 32 or 64-bit? IMHO, unless I'm programming something to do with fairly low-level stuff then I don't have to bother if its 32 or 64 bit. Where am I going wrong? Or am I correct??? correct for most circumstances The runtime/language/compiler will abstract those details unless you are dealing directly with word sizes or binary at a low level. Even byteorder is abstracted by the NIC/Network

Difference between “mov eax, [num]” and “mov eax, num”

冷暖自知 提交于 2019-12-05 06:59:27
问题 I am a beginner and writing assembly program to print numbers from 1 to 9 using this code: section .text global _start _start: mov ecx,10 mov eax, '1' l1: mov [num], eax mov eax, 4 mov ebx, 1 push ecx mov ecx, num mov edx, 1 int 0x80 mov eax, [num] sub eax, '0' inc eax add eax, '0' pop ecx loop l1 mov eax,1 ;system call number (sys_exit) int 0x80 ;call kernel section .bss num resb 1 Here we have following three statements: mov [num], eax mov ecx , num mov eax, [num] I want to know why we

32 bit program on 64 bit computer doesn't crash on NullReferenceException

二次信任 提交于 2019-12-05 03:25:26
This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . I have a piece of code that throws a NullReferenceException : dataSource.DataSource = GetView(); It throws because dataSource is null . GetView returns a DataTable . However, when run on the one computer (64 bits), the program continues without any problems. The Exception does happen, because when I step, I end up completely somewhere else. The debugger doesn't stop though. When run on another (32 bits) it throws the exception and my debugger stops. My

Linking an assembler program: error “undefined reference to `printf'”

﹥>﹥吖頭↗ 提交于 2019-12-05 02:06:19
问题 I'm trying to compile this x86 assembly code on x64 Debian : BITS 32 %include 'training.s' global main extern exit ; =============================================== section .text main: ; The program begins here: call read_hex mov edx,eax call read_hex add eax,edx add eax,eax inc eax call print_eax ; Exit the process: push 0 call exit I'm getting these errors: ~$nasm -f elf -g 0_strange_calc.asm && ld -o 0_strange_calc 0_strange_calc.o ld: i386 architecture of input file `0_strange_calc.o' is

Using a 64 bit driver in a 32 bit program. Windows

ぐ巨炮叔叔 提交于 2019-12-05 02:05:16
问题 This is only a half-way programming question. First of all I have a PCI-Express card and 32/64 bit drivers. The target operating system has to be a Windows 64 bit system. I read that under Vista64 all drivers have to be certified 64 bit drivers. Is this a general restriction under 64 bit operating systems and does this also apply to "XP 64" or any Linux system? So for simplicity let's say I use a 64 bit driver for my PCIe card under Vista64 and have a bunch of 64 bit DLLs to use the cards

Can a 32-bit program use more than 4GB of memory on a 64-bit OS?

て烟熏妆下的殇ゞ 提交于 2019-12-05 00:42:19
Is a 32-bit program running on a 64-bit OS able to use more than 4GB of memory if available? Short answer is: yes. Longer answer is depends. There is a hardware support for page re-mapping, which basically gives your program a window of a few pages into a larger area of memory. This window is however, should be managed by the program itself and will not get support from memory manager. There are examples of programs doing that like SQL on Windows. However, in general it is a bad idea and the program should either limit itself for 4GB or move to 64bits :) Normally uou're limited to a 2GB

32bit application access to 64bit registry

青春壹個敷衍的年華 提交于 2019-12-04 21:22:32
I have an OS Shell written in 32bit that is replacing the Explorer.exe of a Vista machine. I run a utility which is also written in 32bit, which allows to switch between the Explorer shell and My shell. With some of the machines being 64bit based I can not Alter the HKLM\Microsoft\current\shell Key (short formed reg key). I end up getting intercepted by the WOW64 subkey redirection.. and effectively the changes to the shell key do not take place. Microsofts BS about realtime Redirection is not exactly true. That is one key that does not redirect unless you restart the whole-machine. So I am

Compiling and linking a 32 bit application on Debian 64 bit

纵饮孤独 提交于 2019-12-04 20:19:33
I am currently trying to compile and link a 32 bit application on my Debian 64 bit, but it fails at link time. The command I'm using (in my Makefile) to compile is: gcc -Os -m32 -Wall -g -c $< -o $@ This seems to work. Then I link with the following command: gcc -m32 -lcurses $^ -o $@ This fails and gives the following errors: /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libcurses.so when searching for -lcurses /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libcurses.a when searching for -lcurses /usr/bin/ld: skipping

Syscall or sysenter on 32 bits Linux?

本秂侑毒 提交于 2019-12-04 19:36:49
问题 Since MS‑DOS, I know system invocation using interrupts. In old papers, I saw reference to int 80h to invoke system functions on Linux. Since a rather long time now, I know int 80h is deprecated in favour of the syscall instruction. But I can't get it working on my 32 bits machine. The question Is the syscall instruction to be used on 64 bits platform only? Doesn't 32 bits Linux makes use of syscall ? A sample test On my 32 bits Linux (Ubuntu Precise), this program terminates with a core dump

What are the differences between .NET in 32 or 64 bit systems?

假装没事ソ 提交于 2019-12-04 13:35:05
问题 Imagine a pure .NET application which do not uses COM components nor PInvoke. Does it matters if the target system is 32 or 64 bits? 回答1: Assuming safe code with no COM components, P/Invoke, etc. there should be no semantic difference, but performance may be impacted. Consider: More memory under 64-bit, but references are bigger. Win some, lose some. Anyway, here are a few useful references: See MSDN: Migrating 32-bit Managed Code to 64-bit. Quote: "[...] Consider a .NET application that is