Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rep_lodsb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
rep_lodsb
5mo ago
Last I checked, it's still mostly unusable, especially on real hardware (both modern and Win2k-era). Not saying this because I have anything against it, that's just a fact. Of course one could say that Windows 11 provides negative
32.
▲
by
rep_lodsb
5mo ago
The original code using ROL should have been correct? As I see it, what is needed is a rotation without involving the carry flag, and the fix emulates that by RCL'ing the two bits separately, giving the same effect on the RELOC var
33.
▲
by
rep_lodsb
6mo ago
Division by zero is handled the same on x86, and also changed from "trap" to "fault" after the original 8086/8088. And despite what is often said about its variable-length instruction format, skipping over opcodes i
34.
▲
by
rep_lodsb
6mo ago
Most of mul/div was implemented in hardware since the 80186 (and the more or less compatible NEC V30 too). The microcode only loaded the operands into internal ALU registers, and did some final adjustment at the end. But it was still d
35.
▲
by
rep_lodsb
6mo ago
That's greatly oversimplified, or less generously, just flat out wrong. Win32 programs have always had their own isolated address space. That infamous BSOD is the result of memory protection hardware catching an access to something o
36.
▲
by
rep_lodsb
6mo ago
I don't doubt that this specific processor special-cased XOR (regardless of how it was called in the assembly language)! Merely pointing out that where both operations were available, there seems to have been a preference to use SUB in
37.
▲
by
rep_lodsb
6mo ago
These two steps usually run in parallel though, with transistors to enable them depending on what operation should be performed.
38.
▲
by
rep_lodsb
6mo ago
Some other architectures like PDP-11 and 680x0 had a dedicated "clear register" instruction. It could have been added to x86, even as a group of single-byte opcodes with the register encoded in three bits (as with PUSH, POP, and I
39.
▲
by
rep_lodsb
6mo ago
Interesting, since the general culture at IBM seems to have preferred SUB over XOR -- their earlier business-oriented machines didn't even have a XOR instruction, and even on later ones the use of SUB has persisted, including in the IB
40.
▲
by
rep_lodsb
6mo ago
Comparing for equality can use either SUB or XOR: it sets the zero flag if (and only if) the two values are equal. That's why JE/JNE (jump if equal/not equal) is an alias for JZ/JNZ (jump if zero/not zero). There&#x
41.
▲
by
rep_lodsb
6mo ago
Yes, the far jump was never necessary on any processor, only a convention. You can stay in the same segment as in real mode and it will continue to work. But some kind of control transfer to flush the queue must be done shortly after the LM
42.
▲
by
rep_lodsb
6mo ago
Well, Intel documented that the very first instruction after enabling protected mode had to be an "intra-segment" ( not inter-segment ) jump, to flush the prefetch queue. At least that was what it said in the 286 and 386 documen
43.
▲
by
rep_lodsb
6mo ago
OP probably meant to post in another thread: https://news.ycombinator.com/item?id=47767398
44.
▲
by
rep_lodsb
6mo ago
Again a very interesting look at how this chip works internally! I've decoded the entry point PLA of the 80286 (not the actual microcode though). It also has separate entries for real and protected mode, but only for segment loads fr
45.
▲
by
rep_lodsb
6mo ago
https://en.wikipedia.org/wiki/+++ATH0#Hayes'_solution What was patented was the technique of checking for a delay of about a second to separate the command from any data. It still had to be sent from the local sid
46.
▲
by
rep_lodsb
6mo ago
Thinking a bit more about it (and reading TFA more carefully), what's the point of rewriting the instructions anyway? I first assumed it was redirecting them to a library in user mode somehow, but actually the syscall is replaced with
47.
▲
by
rep_lodsb
6mo ago
For this use case, there would also have to be an extension to the SSH protocol to send such out-of-band information. Maybe this already exists and isn't used? The broader problem with terminal control sequences didn't exist on Wi
48.
▲
by
rep_lodsb
6mo ago
From your previous post: >It's user data in JSON in an HTTP stream in a TLS record in a TCP stream in an IP packet in an ethernet frame. Then it goes into a SQL query which goes into a B-tree node which goes into a filesystem extent
49.
▲
by
rep_lodsb
6mo ago
>All of those have control data in the same stream under the hood. Not true. For most binary protocols, you have something like <Header> <Length of payload> <Payload>. On magnetic media, sector headers used a special pa
50.
▲
by
rep_lodsb
6mo ago
Yes, that seems unneccessary. The overhead of trapping and rewriting every syscall instruction once can't be (much) greater than that required for rewriting them at the start either. Even if you disallow executing anything outside of
51.
▲
by
rep_lodsb
6mo ago
Dedicated mail clients have existed for a lot longer than GMail has, work with any service using the POP3 or IMAP protocol, and don't run inside a web browser.
52.
▲
by
rep_lodsb
6mo ago
It's doing things that are against the interest of the user. But obviously, that's no longer an acceptable definition! According to our benevolent overlords, Android is definitely not malware, while yt-dlp is </s>
53.
▲
by
rep_lodsb
6mo ago
There's also a problem with unmodified phones containing malware, namely an operating system made by an advertising company, which is designed to collect as much information about you as possible. And this malware is largely based on
54.
▲
by
rep_lodsb
7mo ago
For the code generator, it produced this annotated disassembly: 2100 push ax ;--- EmitByte: write one byte to code output --- 2101 mov di, [code_ptr] ;DI → current position in output buffer 2104 stosb ;
55.
▲
by
rep_lodsb
7mo ago
Yes, you can detect signed overflow that way, but it's a lot more instructions so it won't be used in practice. The designers of RISC-V included the bare minimum needed to compile C, everything else was deemed irrelevant.
56.
▲
by
rep_lodsb
7mo ago
>Protip: your functions should be padded with instructions that'll trap if you miss a return. Galaxy brained protip: instead of a trap, use return instructions as padding, that way it will just work correctly! Some compilers insert
57.
▲
by
rep_lodsb
7mo ago
That only works for unsigned integers.
58.
▲
by
rep_lodsb
7mo ago
Secure boot can be disabled even on modern PCs.
59.
▲
by
rep_lodsb
7mo ago
It has nothing to do with being unable to run 16-bit code, that's a myth. https://man7.org/linux/man-pages/man2/modify_ldt.2.html Set seg_32bit=0 and you can create 16-bit code and data segments. Still w
60.
▲
by
rep_lodsb
7mo ago
You're confusing several things here. The only x86 processor that didn't allow returning to real mode was the 16-bit 80286 - on all later ones it's as simple as clearing bit 0 of CR0 (and also disabling paging if that was ena
More ›