I’m trying to rewrite a little text game in assembly for fun, and I noticed that I’m only able to run the following code successfully once. If I run it again elsewhere, it will seemingly skip over the code. I am compiling using the following command: nasm -f elf64 -o test.o textgame.s && ld -o test test.o && ./test Full
Tag: assembly
Calling printf() in assembly causes a ‘floating point exception’
I have the following code: I compile it with nasm -f elf64 1.asm and link it using ld -dynamic-linker /lib/ld-linux-x86-64.so.2 1.o -o 1 -lc. When I execute the binary, I get printf() doesn’t always fail when I call it in assembly code. Removing printf() calls from printax and printbx gives me Update: The exception also disappears if I remove the
Assembly on Raspberry Pi gives the error “command not found” for every command
This is my first time using assembly on a Raspberry Pi. I don’t have sudo access so I can’t try running it that way. Anytime I try to do sudo it just throws an error. When I try to run my program it returns this: and so on for all the lines in the file. I have no idea how
Is there a way of coding IBM’s BAL on ZLinux?
I am trying to learn IBM’s basic assembly language and I was wondering if there was a way of assembling BAL code on a Linux guest running on a mainframe? I have nasm and as installed, but I think these are normally used for Intel processors rather than Z. Answer There is a tool chain in Linux so that you
How to link C language libraries?
I am interested in executing a function which is written in C language:- I want to call this fun() through assembly language which i have written:- (NASM 64bit) I have created object file by using these commands nasm -f elf64 MyAsm.asm and gcc -c CLang.c. When I merge these two file with gcc gcc MyASM.o CLang.o i get an error
X86-64 passing float and int as arguments
When passing a float to a function as the first argument the %xmm0 register gets set. What if we want to pass an integer as the second argument in the function. Which one of %rdi or %rsi gets the argument? e.g. avg ( float f, int i ) Is the order preserved, so that %rsi will get the int? Edit:
What are the correct permissions while “sys_open”ing a file?
I am trying to read the contents of a file using x86 assembly on Linux. The question is, what we should put into edx – the “permissions” register for sys_open. I’ve used open() of C before; but there wasn’t any “permissions” field. I am trying to read a file belongs to the same owner of the executable. The file’s permissions
Segmentation fault when using memory with custom ELF file
I am trying to program a small ELF program with a custom ELF header but have a segmentation fault whenever i am writing to memory. Why would that code trigger a segmentation fault ? %assign LOAD_ADDRESS 0x08048000 BITS 32 org LOAD_ADDRESS ; load address ehdr: ; Elf32_Ehdr db 0x7F, “ELF”, 1, 1, 1 ; e_ident times 9 db 0 ;
Does the JVM have an option to automatically encrypt it’s memory?
just like most packers(PE encryptor) on windows,for protecting the secret they may encrypt the whole process memory when it’s running. wonder if jvm has a memory encryption option we can choose? just thinking if someone dumped the whole JVM memory and he could get some secret info on text, even vi or grep could do this kind of text search.
Interpreting basic ARM instructions
I have been a set few questions, one of them is: Which of these ARM instructions clears register r5, so that all of it’s bits are set to ’0’? From my understanding sub r5, r5, r5 clears the register as it subtracts the number from itself. The and and eor ones clearly look wrong. Does the lsr r5, #32 also