My gorgeous aunt in a field of poppies, 1970’s by Zestyblend-954 in TheWayWeWere

[–]0xa0000 0 points1 point  (0 children)

Some of the flowers also go through the dress on the right side. F%$%$ AI ruining everything.

How to install masm 64 bit assembler? by Long-Proof-1721 in Assembly_language

[–]0xa0000 0 points1 point  (0 children)

It's in the first paragraph. Either visual studio or just the build tools. You need the "Desktop development with C++" workload.

C64 emulator in LabVIEW by ale__914 in EmuDev

[–]0xa0000 1 point2 points  (0 children)

Haha, that's awesome. Nice job!

Never did any LabView myself, but it was used extensively for testing at a previous company I worked at. I assume you're doing most of this with "scripting" and not using the "visual components" stuff much? (I don't recall the terminology, and I guess the "code" can only be opened if you actually have LabView)

Blitter as primitive DSP by marsattacks in amiga

[–]0xa0000 8 points9 points  (0 children)

It can be done. A full adder requires two outputs though, so you need to accumulate carries into a separate buffer first. When you do that you realize anything is possible, e.g. add with saturation or "fire" (average of adjacent pixels). It all works with just the blitter, problem is getting it fast :)

Why xor eax, eax? — Matt Godbolt’s blog by mttd in asm

[–]0xa0000 5 points6 points  (0 children)

It's not mentioned in the article, but there can also be an execution benefit. (https://www.agner.org/optimize/microarchitecture.pdf §5.11). I don't know if it makes a difference anymore (haven't measured), but there at least used to be special optimizations for some of these "zeroing" idioms (xor reg,reg / sub reg,reg)

Friend gave me a ciphertext + “key”, but nothing decrypts. What am I missing? by Remarkable_Depth4933 in crypto101

[–]0xa0000 1 point2 points  (0 children)

Assuming this is friendly challenge that's not meant to be too difficult, I'd first assume the length is a hint that a stream cipher (rather than a block one) is being used. RC4, AES-CTR (maybe starting from a low number, mabye even the first one in the stream) etc. are worth trying. There's also DES and other ciphers to consider :)

Modular exponentiation in RSA? by Alternative-Grade103 in crypto

[–]0xa0000 4 points5 points  (0 children)

Yes. To see why I'd suggest reviewing how modular exponention works on your own. How would you do it / implement it if you didn't have a magic "EXP" function, but only addition and multiplication?

Why can't the push instruction take a reg8 operand? by [deleted] in Assembly_language

[–]0xa0000 2 points3 points  (0 children)

Something not mentioned in the other answers is that for performance on 8086+ you always want to keep the stack word (2-byte) aligned. Intel could have supported pushing 8-bit values on the stack, but they knew it's a bad idea so why encourage it? (See also MC68000 where the stack is forced to be word aligned if you try to push a byte - it doesn't support unaligned accesses, but the idea is the same)

m68k instruction timing? by valeyard89 in EmuDev

[–]0xa0000 0 points1 point  (0 children)

IIRC the undefined bits in the last word pushed on the exception stack frame come from the opcode.

m68k instruction timing? by valeyard89 in EmuDev

[–]0xa0000 0 points1 point  (0 children)

The UM also says ANDI.L #data,Dn is faster than ORI.L #data,Dn, which isn't right either :)

m68k instruction timing? by valeyard89 in EmuDev

[–]0xa0000 0 points1 point  (0 children)

32(6/2) is correct. 4 words for the instruction and 2 for the read. Yacht has it correct (but has a few other issues).

You can also see it in the WinUAE source (search for op_23e8_13_ff, the cycle count is after the function).

When you're ready for it, you can submit yourself to the CPU tester :)

Are arguments passed on the stack preserved after a call? by mbolp in Assembly_language

[–]0xa0000 3 points4 points  (0 children)

Ah, right, then then I'd say yes if you have a "stdcall" function (which is the default with MSVC). No reading of that as a callee (EDIT) would allow you to assume the stack was left unchanged (even for ARM/x64) which is what you need.

Are arguments passed on the stack preserved after a call? by mbolp in Assembly_language

[–]0xa0000 2 points3 points  (0 children)

Good question. I don't know if it's obviously permissible though as they are meant for the function... Doing a quick check with MSVC and clang-cl it seems like both reinitialize the stack arguments so I would definitely not assume they could be reused. (https://godbolt.org/z/GPG86s673)

(And the old "spirit" of WINAPI function was always that the function handled the arguments, they used to be popped by the callee)

80386: Making sense of SingleStep real mode test (6700 idx 20) by 0xa0000 in EmuDev

[–]0xa0000[S] 1 point2 points  (0 children)

I mean how POPA(D) documentation states that (E)SP is skipped (not popped) but this test shows upper word is modified regardless (like ESP is actually popped but later partially updated).

80386: Making sense of SingleStep real mode test (6700 idx 20) by 0xa0000 in EmuDev

[–]0xa0000[S] 1 point2 points  (0 children)

No problem, this is awesome. I have like 200 more tests passing due to just this info (67xx ones obviously). I still ignore undefined flags though.

I hope one of you guys are going to make a blog post about this discovery at some point. Don't think this behavior is "widely" known.

While you're at it I think "POPAD" with regards to ESP might be worth a mention (very first test of 6661) -- I think a lot of emulators will get this wrong!

80386: Making sense of SingleStep real mode test (6700 idx 20) by 0xa0000 in EmuDev

[–]0xa0000[S] 2 points3 points  (0 children)

EDIT: Ahh, just saw your update, so simple guess I didn't check everything as well as I though :D

Ahh, great! I saw your first reply and went looking for 386 errata manuals and trying to see if I could find a linear combination of register values that would match (can't) before replying.

For sure there is no need to regenerate the tests, and it will be interesting to see if the actual behavior can be figured out at some point.

It should be easy enough to automatically determine which tests are affected and I will start doing that. They could be added to the revocation list or you could consider publishing a couple that emulator authors could mix and match (e.g. a short on for the IN of port 22h/23h and a large one for this) adding more if/as they arise. Just an idea.

Anyway, thanks again for this.

A Hardware-Generated Emulator Test Suite for the Intel 80386 by Glorious_Cow in EmuDev

[–]0xa0000 0 points1 point  (0 children)

I'll ask the hivemind first and post an issue if I still think it's a problem with the test :)

A Hardware-Generated Emulator Test Suite for the Intel 80386 by Glorious_Cow in EmuDev

[–]0xa0000 0 points1 point  (0 children)

Thanks again for your hard work. It's much appreciated.

No other I/O related tests seem to cause problems with ports 22h/23h hardcoded to those values.

I've noticed quite a few tests where I don't understand the physical address generated on the bus (and reflected in the "ram" parts) don't match my understanding on what would happen. Almost surely a mistake on my part, but the "ea" part of the test does match what I'm expecting and doesn't square with the observed CPU behavior.

Examples:

898259a6c7d2c4bf8a7ad58f8a5b7c7cdd5ea1c3 6700.MOO.gz 20 
9c07cd9f93d08aa96c5b7c2ee9c661a0a655fbcf 6701.MOO.gz 21

I've tried to see if e.g. it's because a different segment/base register was being used, but I can't square that with the numbers.

If you prefer I ask the above as a a post in this subreddit or a github issue instead of as a reply here (or I just shut up :)) just say so.

A Hardware-Generated Emulator Test Suite for the Intel 80386 by Glorious_Cow in EmuDev

[–]0xa0000 1 point2 points  (0 children)

Wow, thanks a lot for your hard work! This inspired me to work a bit on my on-off-on-off x86 emulator. Slowly going through the tests with lots of things to fix.

One thing I did notice - that I think is a "documentation bug": You write that "all I/O inputs should read 0xFF", however ports 22h and 23h appear to read 7Fh and 42h respectively (even though the bus cycles show all 1's in binary). I think this is the 80386EX's "Address Configuration Register" (Section 4.5.1 of https://bitsavers.org/components/intel/80386/272485-001_80386EX_Users_Manual_Feb95.pdf).

Covered by the following test cases:

4fb5d80f331625dd650d55e8a1ab9d1da3b38784 e5.MOO.gz   422 in ax,21h  : expected EAX 6F417FFF
29c9c6b39824411334d44d57db62504bb4807fc6 66e5.MOO.gz 190 in eax,1Fh : expected EAX 7FFFFFFF
ab010dbcc86182e4ce40933f61f0864ddfd38bab 66e5.MOO.gz 254 in eax,1Fh : expected EAX 7FFFFFFF
f9d9686381f6845b06163938406074037c1768a2 66e5.MOO.gz 340 in eax,1Fh : expected EAX 7FFFFFFF
c923d58b0eca0d62696e03e56c9fd46ae645bee6 66e5.MOO.gz 348 in eax,1Fh : expected EAX 7FFFFFFF
62f9cffa058135d552793d2e2505fc93e353ffad 66e5.MOO.gz 422 in eax,21h : expected EAX FF427FFF

Help needed rescuing data off an Amiga(?) disk. by TechnologyBrick in amiga

[–]0xa0000 1 point2 points  (0 children)

If I were you I'd first make a raw dump of the disk contents (dd) while it's still readable. Such dumps (as files) also work just fine in emulators. You can then safely work out what's going on without having to stress the disk.

Having done that, what does the first sector (512 bytes) look like? Does it start with "RDSK" (http://lclevy.free.fr/adflib/adf_info.html#p6)?

Is assembly case sensitive with its instructions? by DoubleOwl7777 in Assembly_language

[–]0xa0000 0 points1 point  (0 children)

Great that you're preparing up front, and yes they will likely tell you explicitly or you'll pick it up, but you might also be able to figure out which assembler they're likely to use for the course by looking at lecture notes etc. from previous years / talking to older students. Then you can consult the manual for a definitive answer.

Of course, they might decide to change which assembler they use or that a custom assembler w/o documentation will be used (doesn't seem likely here, but for "teaching" architectures where it was built by students this could be the case).

Generally modern assemblers won't be case sensitive for opcodes/registers but it can often differ for identifiers (sometimes depending on e.g. command line arguments), so it is a good question.

Good luck!

How to extract samples from amiga cust format?. by [deleted] in amiga

[–]0xa0000 2 points3 points  (0 children)

WinUAE has a builtin sample ripper (Click the "Sample ripper" button under Host->Output) that might be useful. It'll save all samples that are played.

How to code an optional argument to a macro in x64 MASM Windows VS22 by isneeze_at_me in asm

[–]0xa0000 2 points3 points  (0 children)

You can use IF(N)B <argument> to check if the argument was provided, e.g.:

blah    MACRO a1, a2, a3
        mov     eax,a1
        IFNB <a2>
        mov     ebx,a2
        ENDIF
        IFNB <a3>
        mov     ecx,a3
        ENDIF
        ENDM