flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
listonoš 08 Jan 2005, 14:17
Hi FlashBurn, you should post the code in order to solve this problem easier.
|
|||
![]() |
|
FlashBurn 08 Jan 2005, 15:55
OK, now I know that it has something do to with the position of one function.
The behaviour for the several function addresses: 0x104e0 -> doesn´t work 0x104e4 -> function works and code doesn´t 0x104e8 -> doesn´t work 0x104ec -> function and code works 0x104f0 -> function and code works 0x104f4 -> function and code works 0x104f8 -> function works and code doesn´t 0x104fc -> function works and code doesn´t 0x10500 -> doesn´t work 0x10504 -> function works and code doesn´t These are the first lines of the function and it seems that the problem is here: Code: ;---------------------------- proc get_memmap ;---------------------------- ; <-------------------------- from here begin push es mov ax,9f00h mov es,ax .e820h: mov eax,0e820h mov edx,534d4150h xor ebx,ebx mov ecx,20 xor di,di int 15h jc .e801h add di,cx .loop: mov edx,eax ; <------------------------- till here you have to insert 2 nops and the function and the code works mov eax,0e820h int 15h jc .end add di,cx test ebx,ebx jz .end jmp .loop These are the needed macros: Code: ;---------------------------- macro proc name,[arg] { common prog_args fix arg if ..OPEN > 0 display "ERROR: no endp before proc",13,10 ..OPEN= 0 end if ..OPEN= ..OPEN+1 if ~ arg eq virtual at bp+4 forward local ..arg ..arg dw ? arg equ ..arg common end virtual end if ..LOCALS= 0 align 4 name: } ;---------------------------- ;---------------------------- macro begin { if ..OPEN = 0 display "ERROR: begin without proc",13,10 end if push bp mov bp,sp if ..LOCALS > 0 sub sp,2*..LOCALS end if } ;---------------------------- With function works I mean that he comes through the function. And with code works I mean that the above code did the right thing. When the function doesn´t work, I get a "RIP>CS.limit" in Bochs. When the code doesn´t work he writes nothing into the mem, but he increases the pointer to the right position. |
|||
![]() |
|
listonoš 09 Jan 2005, 16:05
I think your function shouldn't be on adress 0x10... because this adress is reserved for bios stuff (maybe for video things). Try lower or above 1MB
Also you use ax and eax side by side without use32 or use16 directives. While you are using bios function (so you are in real mode) you should put use16 before your code (work in 16bit mode). |
|||
![]() |
|
FlashBurn 09 Jan 2005, 16:20
This is only a piece of my function and my code does have the use16 instruction at the beginning! The area from 0x10000 till 0xa0000 is save to use! But I think I will start to use the Bochs debugger to come behind.
|
|||
![]() |
|
listonoš 09 Jan 2005, 16:53
So wether you have use16 at the begining you should use ax instead of eax, but this is not what you are looking for. (sorry for my bad english)
|
|||
![]() |
|
FlashBurn 06 Mar 2005, 08:52
I found the problem, but anyway thanks for your time!
|
|||
![]() |
|
f0dder 06 Mar 2005, 10:12
What was the problem?
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.