flat assembler
Message board for the users of flat assembler.
Index
> Main > 32bit asm code in 16bit c++ compiler? |
Author |
|
cylo 15 Feb 2005, 17:18
Hello!
A short generall question: Is it possible to compile a 32bit asm code into a object or so and include it in my 16bit borland c++ 3.1 dos compiler? |
|||
15 Feb 2005, 17:18 |
|
cylo 15 Feb 2005, 18:31
my prob is that i have a asm code for my "vesa refresh rate tool" but it uses extended register which are not supported in borland c++ 3.1. inline asm
did i mention i am a asm noob? |
|||
15 Feb 2005, 18:31 |
|
vid 15 Feb 2005, 18:46
well there is one more problem. It works with db 66h before instruction (i have been using it too under turbo pascal), but there are several problems:
1. don't forgat to check for 386+ processor 2. If you use constants (immediates), they must be extended to 32 bits: 16 bit code: mov bx,3210h is ?? 10 32 mov ebx,76543210h is 66 ?? 10 32 54 76 (?? is same as in mov bx, i can't remember now) so as you see, you also have to add two bytes of constant, so you need ;mov ebx,765433210h db 66h mov bx,3210h dw 7654h you can also extend addressing to 32bit with 67h prefix but that is a little bigger problem. |
|||
15 Feb 2005, 18:46 |
|
cylo 17 Feb 2005, 13:59
havy stuff for me
okay.. lets say i want to do this: Code: mov ecx, 0x35714000 (requested pixel clock in hz) how do i solve this if my compiler does not understand ecx? |
|||
17 Feb 2005, 13:59 |
|
JohnFound 17 Feb 2005, 14:17
The most common and troubles-free answers are:
1. Get new compiler... there are many free 32bit compilers. 2. Waste all these fake HLL compilers and use FASM for writing whole programs - beleave me this is not so awfully as it looks. Actually the natural way of a programmer is: Code: interpreted HLL -> compiled HLL -> fashionable HLL -> any HLL with inline assembler -> more inline ASM -> MASM -> FASM Of course, there are exceptions - some of the programmers begin directly with compiled HLL, some of them never reach the FASM level...it is a matter of skills you know. Also, these days, the smartest one simply skip MASM level. Regards. |
|||
17 Feb 2005, 14:17 |
|
cylo 17 Feb 2005, 15:55
i would if i could... but i have to go the hard way.
|
|||
17 Feb 2005, 15:55 |
|
f0dder 17 Feb 2005, 17:48
You can use FASM to assemble the VESA code, and link with your C project. A (IMHO better) solution would be getting the microsoft visual c++ 2003 toolkit (which is free), produce PE executables, and use a dos extender like WDOSX to have it run under dos.
|
|||
17 Feb 2005, 17:48 |
|
cylo 21 Feb 2005, 13:55
no, i am bound to borland c++ 3.1
Another short question: how can i print out the value of a register to dos screen? |
|||
21 Feb 2005, 13:55 |
|
Vortex 22 Feb 2005, 11:00
Quote: Also, these days, the smartest one simply skip MASM level. John, every good man is deserving a chance. _________________ Code it... That's all... |
|||
22 Feb 2005, 11:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.