Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [assembly]

Assembly language questions. Please tag the processor and/or the instruction set you are using, as well as the assembler, a valid set should be like this: ([assembly] [x86] [gnu-assembler] or [att]). Use the [.net-assembly] tag instead for .NET assemblies, [cil] for .NET assembly language, [wasm] for web assembly, and for Java bytecode, use the tag java-bytecode-asm instead.

assembly
-1 votes
0 answers
5 views

How to overwrite a string in NASM

im writing my own programming language and im unsure on how to overwrite a string, whats the fastest way given two string to overlap one of them with the value of the other? for an example this is how ...
Hrodebert's user avatar
0 votes
0 answers
25 views

How can i use functions from libc in NASM 64 bit

im making my own programming language and i wanted to call some functions from libc (es strcat and printf) but im unsure on how to call them correctly(i dont which cpu registry to use and if i have to ...
Hrodebert's user avatar
0 votes
0 answers
17 views

Cypress PSoC1 assembly OR

I'm trying to write ad educational emulator of PSoC1 microcontroller. Right now I'm testing the result of my preliminary coding and cross-checking it with microcontroller manual(s) to check if the ...
weirdgyn's user avatar
  • 926
1 vote
1 answer
28 views

z80 assembler ret z; and a; ret

I have the following Z80 asm code (from pokemon legacy crystal) CheckOnWater:: ld a, [wPlayerStandingTile] call GetTileCollision sub WATER_TILE ret z and a ret i was wondering ...
nnolte's user avatar
  • 1,738
0 votes
1 answer
52 views

How to use x86-64 SIMD vector instructions and registers for polynomial evaluation

I need to write a x86-64 assembly function that uses x86 vector/SIMD instructions and the %ymm registers to evaluate this expression: x*(x*(a*x + b) + c) + d. The function will have this signature: ...
Gyro's user avatar
  • 25
2 votes
2 answers
57 views

Using printf from c in Nasm causes the string to add random end line statment

this morning i tried to make a simple output library for my asm projects, i realized using the sys call each time is a waste of time and so i decided to automatize the program using printf function ...
Hrodebert's user avatar
0 votes
0 answers
43 views

Disabling write protection on Windows

I've been learning win internals and I came across an interesting thing called Write Protection. I know Windows relies on interrupts but I don't know any other way to do this. I decided to try it ...
what's user avatar
  • 1
0 votes
0 answers
27 views

pwntools p32(arg1) got issue when arg1=10, maybe because 0xa

I was tring to learn stackoverflow so I wrote me a program, here's the source code: # include <stdio.h> void pwn(int a, int b) { printf("Pwned! arg1 = %d, arg2 = %d\n", a, b); } ...
winny's user avatar
  • 1
0 votes
2 answers
28 views

How to print in NASM assembly

i've made a simple print function in assembly which does not work as intended. The function should print only the msg variable but instead its printing all the variables declared this is the code ...
Hrodebert's user avatar
0 votes
2 answers
37 views

JAL- RICSV Architecture

Why immediate[0] is set to zero for jump and link instruction in riscv architecture? What is the main purpose do do that? I am not sure of whether the JAL is a PC relative instruction and even if it ...
Badhrinadh Alladurgam's user avatar
2 votes
0 answers
50 views

ARM Cortex M4 context switching: How does the hardware know where xPSR, PC, LR, R12, R3-R0 are on the stack?

I'm working on a context switching mechanism for my RTOS which runs on Cortex-Ms. When I initialize a task's stack, I have it like this Then, I decrement the stack pointer 8 times to fit R11-R4. I ...
Tsz Kit Koon's user avatar
0 votes
0 answers
45 views

Bootloader randomly jumping to address

For some reason here I'm very confused why its jumping to putsc16 after returning from puts32_done? I Tried investigating this heavily but so far no bite, would appreciate some guidance. All code is ...
amanuel2's user avatar
  • 4,606
3 votes
2 answers
125 views

Why does this assembly implementation of strcmp behave unexpectedly?

I've been writing my own naive implementation of the strcmp function in x86_64 assembly. I've written a c test program to compare the behavior with the real strcmp from the C library. Even if both ...
aLeuleu's user avatar
  • 31
0 votes
0 answers
40 views

cc -o out out.s on macOS with M1 chip

I have been learning the chapter of 04_Assemblyhttps://github.com/DoctorWkt/acwj/tree/master/04_Assembly. According to the README.md, after I typed cc -o comp1 -g cg.c expr.c gen.c interp.c main.c ...
ge1mina023's user avatar
0 votes
0 answers
56 views

Create buffer on stack in x86_64 assembly to print number

when trying to print numbers in assembly instead of number i'm getting O=N84NioR/\_dsPfec IS/pRDNui/0SmL3lSegmentation fault i'm using Linux with NASM my code is: _printNum: ;prints number stored ...
cuper's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
2976