04-04-2005, 05:56 AM
I think I've found a bug in the FB compiler's treatment of inline assembly.
The .bas:
Compiles into this .asm:
Which generates (of course) the following error upon assembly:
because _floor isn't a valid mnemonic. FB has obviously translated int (as in int(4.3)=4) into floor, which makes no sense within an ASM block.
Is this real, am I crazy, or shouldn't I be using int anyway? (If the latter is the case, that's no good reason alone that FB shouldn't treat int right in ASM) In any case, I can correct the bad ASM file FBC generates, but what do I need to do to get it to finish the process and make me an EXE?
The .bas:
Code:
ASM
mov ax,[Regs.AX]
mov bx,[Regs.BX]
mov cx,[Regs.CX]
mov dx,[Regs.DX]
mov bp,[Regs.BP]
mov si,[Regs.SI]
mov di,[Regs.DI]
mov ds,[Regs.DS]
mov es,[Regs.ES]
int 10h
mov [Regs.ES],es
mov [Regs.DS],ds
mov [Regs.DI],di
mov [Regs.SI],si
mov [Regs.BP],bp
mov [Regs.DX],dx
mov [Regs.CX],cx
mov [Regs.BX],bx
mov [Regs.AX],ax
END ASM
Code:
mov ax,[Regs.AX]
mov bx,[Regs.BX]
mov cx,[Regs.CX]
mov dx,[Regs.DX]
mov bp,[Regs.BP]
mov si,[Regs.SI]
mov di,[Regs.DI]
mov ds,[Regs.DS]
mov es,[Regs.ES]
_floor 10h
mov [Regs.ES],es
mov [Regs.DS],ds
mov [Regs.DI],di
mov [Regs.SI],si
mov [Regs.BP],bp
mov [Regs.DX],dx
mov [Regs.CX],cx
mov [Regs.BX],bx
mov [Regs.AX],ax
Code:
test.asm:line: Error: invalid character '_' in mnemonic
Is this real, am I crazy, or shouldn't I be using int anyway? (If the latter is the case, that's no good reason alone that FB shouldn't treat int right in ASM) In any case, I can correct the bad ASM file FBC generates, but what do I need to do to get it to finish the process and make me an EXE?