@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.
@pernia it's fixed point, we have 16 fractional bits. the result has 32 fractonal bits, you only need the upper half. you can do the same with 8 or 32, just don't forget to shift the result appropriately. also it's binary, not decimal, don't forget that if you need output
@pernia the second one is easy, you have values dwordA:dwordB and dwordC:dwordD, the product is dwordB*dwordD + (dwordA*dwordD + dwordB*dwordC) << 16 + (dwordA*dwordC) << 32
@pernia can you even use 32 bit regs on 8068? i thought it was 16 bit only (product is stored in dx:ax instead of eax) and you need to store your variables in ram and do piece wise calculations
@pernia if you really want floating point, keep track of the exponent. you can also use fixed point: 16.16 (16 bit whole part, 16 bit fractional) is stored as dword:dword; in this case you'll need to shift the multiplication result 32 bits right
dw0h:dw0l * dw1h:dw1l =
dw0h*dw1h:0000:0000 +
dw0h*dw1l:0000 +
dw1h*dw0l:0000 +
dw0l*dw1l =
| <- you split the number here, discard the lowest dword and
the second lowest is your fractional part
@pernia yes, we lose precision beyond 1/65536th. with 8 or 32 fractional bits you discard the lower byte or dword (also I'm retarded, it should be word instead of dword in the example I gave you, but you get the idea)