45,167 questions
1
vote
0
answers
78
views
Does interleaving data and instruction hurt performance in assemblies?
To expose the functions in an interpreted language as first-class C function pointers, I wrote a code to generate 'stubs' that, when executed, locates the module in which the interpreted functions ...
3
votes
2
answers
162
views
x86_64 assembly program to uppercase via LUT gives strange artefacts
I am trying to write a simple x86_64 assembly program for linux, that takes some random text and uppercases all letters using a pre-allocated LUT. The idea is simple, and I've already done it the same ...
3
votes
2
answers
169
views
Can NASM behave like a 8086 assembler? It accepts 32-bit addressing modes even with CPU 8086
How do I make NASM behave like a 1980 assembler that know only about 8086 and nothing about later processors, and reject or at least warn about anything that requires a later CPU?
I tried giving the ...
6
votes
1
answer
173
views
Custom 32-bit OS: Protected Mode GUI (VGA Mode 13h) hangs with black screen, although console works
I am developing a 32-bit operating system. The OS boots successfully, switches to Protected Mode, and the text-mode console (VGA text mode 0x03) works perfectly: I can type commands like help, clear, ...
Advice
1
vote
4
replies
127
views
How did programming transition from mechanical systems to digital code editors? What was the mechanism behind creating the first programming tools?
I’m trying to understand the historical and technical transition from early mechanical programming (like punched cards and hardware switches) to modern digital programming using code editors and ...
3
votes
3
answers
138
views
aarch64 b.nv (branch never) is always taken (acts as b.al)
I am working on an aarch64 Neoverse N3 CPU, and noticed that whenever I execute b.nv it is actually always taken. I execute this code inside a kernel module on Linux, at EL1.
Has anybody ever ...
3
votes
1
answer
190
views
What's wrong with this minimal static ELF executable made by GNU ld with a linker script with only a .text section?
The ELF executable at the end of this question (base64'd) is the result of an experiment with trying to cut the program headers down to the absolute minimum. As far as I am aware, it should be ...
3
votes
0
answers
56
views
What's the purpose of the BootRAM address in a STM32 microcontroller [duplicate]
I recently started working with STM32 and ARM Assembly. Studying the boot process of the STM32F103C8T6 microcontroller, I came across this line in the startup file generated by STM32CubeMX:
.equ ...
Advice
1
vote
17
replies
102
views
Make this code shorter and more optimized? DL 3155E24 || I/0 03
I need to implement an X in the I/O module, and I have some code that worked for me, but I don't know how I could optimize it: make it shorter but maintain the same functionality.
I also wanted to ask ...
2
votes
2
answers
131
views
Disassembly of VCVTSD2USI in 16bit mode - can it write a 16-bit register?
Intel instruction VCVTSD2USI (and some similar AVG512 instruction with GPRs) is encoded as
EVEX.LLIG.F2.0F.W0 79 /r VCVTSD2USI r32, xmm1/m64{er},
for instance VCVTSD2USI EAX,XMM0 is assembled to 62 F1 ...
Advice
0
votes
2
replies
135
views
Windows stack frame structure ? x86-64
How does the stack look like during procedure calls with it's shadow space ( 32 Bytes ) look like?
let's say I've this :
main :
push rbp
mov rbp,rsp
sub rsp ,0x20 ; 32 Bytes shadow ...
5
votes
1
answer
135
views
How Do You Test a Bitfield in Assembly?
I am writing some tests for VBE resolution using x86_16 assembly. I need to test a bitfield for some attribute flags, but I'm not sure of the best way to do so. The best solution I currently have is ...
Advice
0
votes
2
replies
141
views
How to become a great (excellent) kernel engineer?
I am a beginner kernel engineer and I have tried creating an x86-64 Unix-like kernel from scratch using C and assembly for my real machine. I am also trying contributing to the Linux kernel. I am ...
2
votes
1
answer
179
views
Why can't I boot my multiboot header kernel in Grub if VM firmware is legacy BIOS?
I created a kernel with a multiboot header but GRUB fails to boot the if VM firmware is legacy BIOS.
Linker script:
ENTRY(_start) /* the name of the entry label */
SECTIONS {
. = 0x00100000; /* ...
2
votes
1
answer
119
views
Assembly x86_64 code in Windows for creating a window has jittering in the oposite edges of the left and top edges when re-scaling
I think this might be a already solved issue previously, but I still don't understand why this is happening and how to fix this in a clean and satisfactory way.
I am writing a simple, basic GUI window ...