add resultDh with resultCl, inc for the carry, add resultBl to that, inc for carry again, mov that result into the lowest part of a 3 word buffer, add the inc to resultCh inc for carry again starting from 0 add to that resultBh inc for carry add to that resultAl inc for carry again mov the result into the lower part of the 3 word buffer add inc to result Ah mov that result into the highest part of the 3 word buffer
and then i would have the entire result in one buffer.
and if not in one buffer, could i mov the results into separate buffers and then figure out how to print those out?
@p@Inginsub@qint > You asked me! you went through one paper, 3 opinions on tools that do the same thing, and missed the whole point of the question once, only to repeat something someone else said 3 days ago. read the FUCKING THREAD NIGGER.
> when i have a different word for fractional and whole parts,
No, that is your problem. It's fixed-point and you confuse fixed-point and floating-point. What you want to do is multiply 0xNNNN by 0xMMMM. You get 0xWWXXYYZZ, and the W is overflow, the Z is roundoff, your answer is 0xXXYY.
@p@Inginsub@qint >You get 0xWWXXYYZZ i got as far as that before you joined the thread > Well then why are you talking about it? if i ever did talk about fpu's, it was to say i wasn't allowed to use them
> lolno. "just multiply" is reiterating the problem
Unless you want to implement multiplication yourself, you want to use the multiplication instructions. I don't know how to make that easier. mul, imul.
> you think id be asking for help if i could?
Yes, you can. I listed all of the PoC||GTFO issues that have boot-sector hacks, including complete guides. "Here is the thing you want to do, here is a list of places that tell you how to do it. All of these PDFs are also zip files that include the code."
MOV EDX, CR0 ; Start probe, get CR0 AND EDX, (-1) - (CR0_TS + CR0_EM) ; clear TS and EM to force fpu access MOV CR0, EDX ; store control word FNINIT ; load defaults to FPU FNSTSW [.testword] ; store status word CMP word [.testword], 0 ; compare the written status with the expected FPU state JNE .nofpu ; jump if the FPU hasn't written anything (i.e. it's not there) JMP .hasfpu
.testword: DW 0x55AA ; store garbage to be able to detect a change
@p@Inginsub@qint >mul, imul no shit. when i have a different word for fractional and whole parts, or am doing ieee flaoting point numbers (because the format is something i had to figure out too), its a few more steps >Yes, you can maybe i'm not being clear: i'm not allowed to. or wasn't anyway, its done
> im saying, how do i multiply two numbers with decimals
I think you should do your own homework but when I wrote "Just do a 32-bit multiply, this yields a 64-bit result. You need to shift it right by 16 bits to correct the fractional part.", I already *did* your homework for you.
> ingisub suggested i use ieee 754 numbers, probably the most sane approach at this point.
You could work directly on the IEEE-754 numbers but "turn on the FPU" is probably way easier. If you wanna build it yourself from scratch, here, this is allegedly better: beating_floating_point--posit.pdf
@p@Inginsub@qint > i already did your homework for you lolno. "just multiply" is reiterating the problem >turn on the fpu you think id be asking for help if i could?
@Inginsub@p@qint yall niggas got any ideas? i'm multiplying two floating point numbers, each number with a whole part and fractional part in their own word
@pernia@Inginsub@qint I don't know what ideas you want. Just do a 32-bit multiply, this yields a 64-bit result. You need to shift it right by 16 bits to correct the fractional part. There must be a recipe book for fixed-point math somewhere.
> each number with a whole part and fractional part in their own word
@Inginsub@qint@p what i noticed is that it works mostly when i do this (throwing out the last 16 bits of the 16.16.16.16 product), but if im doing for example 5000*0.5, i end up with
0000.0000.25000.0000
which is almost right, and i think this is where a shift comes in correct?
@Inginsub@pernia@qint If he does a 16x16 multiplication, he'll just have to take the low half of one register and the high half of the other. But notionally, it's a shift, right, like that is the operation you do, you throw out the upper 8 as overflow and the lower 8 as underflow.
@p@qint@pernia he multiplies 32 bit numbers in 16.16 format. 16x16 comes from the 8086 limitation of only having 16 bit regs to work with, but in this case each product will have 0, 16, or 32 fractional bits.