flat assembler
Message board for the users of flat assembler.
Index
> Main > macros, procedures, structures |
Author |
|
revolution 19 Dec 2007, 13:41
phreak wrote: Can I use the proc32 and struct macros without using win32a.inc? |
|||
19 Dec 2007, 13:41 |
|
phreak 20 Dec 2007, 10:28
Hi, I have this program, that seems to work on windows.. I followed it with a debugger and everything works ok. But in my "command line" that is bootable program, it isnt work (I only use the procedure in my program, this code is a test).
What can be the problem? use32 format PE include "PROC32.H" stdcall mode03h_clear, 0x90 jmp $ ;-- ------------------------ ;clean screen ;-------------------------- proc mode03h_clear, color:BYTE ; CLEAR (byte color) mov ah,0x06 mov al,0x00 mov bh,[color] mov ch,0x00 mov cl,0x00 mov dh,0x18 mov dl,0x4F ;int 0x10 ;This doesnt work on windows... ret endp |
|||
20 Dec 2007, 10:28 |
|
vid 20 Dec 2007, 10:31
you use PE format as your bootable format?
|
|||
20 Dec 2007, 10:31 |
|
phreak 20 Dec 2007, 10:33
no, That source is a test program... I used PE so I coud debug with ollydbg...
The booteable is flat binary... I can upload the source if you have some time to see them.. |
|||
20 Dec 2007, 10:33 |
|
vid 20 Dec 2007, 12:12
I believe problem is that you don't start 32bit protected mode before executing the code? Note that proc32.inc macros are written to be used in 32bit code, and PE is 32bit code too. And after you are in protected mode, interrupts doesn't work (so easily).
|
|||
20 Dec 2007, 12:12 |
|
phreak 21 Dec 2007, 06:11
no .. I do start protected mode ...
but.. I use interrupts being on protected mode, so might that is the problem.. The program works until I use procedures.. please help! I upload the sources...
|
|||||||||||
21 Dec 2007, 06:11 |
|
edfed 21 Dec 2007, 06:25
one error, you cannot use bios int in PM
int 13h, disk read, is unusable under protected mode because it is extracted from the IVT and not the IDT ivt =/= idt ivt = real mode idt = protected mode and even if the ivt = idt, in the most of case, code for RM doesn't work for PM. |
|||
21 Dec 2007, 06:25 |
|
phreak 21 Dec 2007, 15:22
ok .. Thanks! I'll learn a bit more about PM..
Cannot use interrupts means that I have to access everything direct from memory? |
|||
21 Dec 2007, 15:22 |
|
vid 21 Dec 2007, 15:40
phreak: no. you should start by writing just real mode code. But real mode code is (usually) only 16 bit, and those macros are for 32bit code.
That means: - write 16 bit real mode code - don't use proc32.inc, it is for 32bit code |
|||
21 Dec 2007, 15:40 |
|
edfed 21 Dec 2007, 15:42
yes, and GOTO int13h topic in OS construction forum...
|
|||
21 Dec 2007, 15:42 |
|
phreak 21 Dec 2007, 16:04
ja .. thanks for your help, but I want to use protected mode, no matter what it takes...
|
|||
21 Dec 2007, 16:04 |
|
edfed 21 Dec 2007, 16:44
here
if you want to PM, the good section is OS construction... why? because people who are iterested in OS construction consult automatically this forum... and possible they are not interrested by MAIN topic,, so they will not consult the new messages in MAIN... |
|||
21 Dec 2007, 16:44 |
|
phreak 21 Dec 2007, 22:45
ok, Thanks!
|
|||
21 Dec 2007, 22:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.