flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Simple question about output in PM |
Author |
|
vid 10 Sep 2006, 19:47
are you sure with "org 0" isn't that code loaded at org 7C00 or something like that?
|
|||
10 Sep 2006, 19:47 |
|
merlin 10 Sep 2006, 19:49
Usually it does... but not with non-standard BIOSes. As you might
guess I'm working with such, I've never been required to write such stuff, but now... Anyway, all offsets are calulated manually, so the code doesn't really care where it's loaded (as I need). Last edited by merlin on 11 Sep 2006, 12:58; edited 1 time in total |
|||
10 Sep 2006, 19:49 |
|
merlin 10 Sep 2006, 19:55
s**t, arggggggh ................
I forgot use32, stupid me.............. All works... topic closed... Well almost... Any idea on how to move that cursor? |
|||
10 Sep 2006, 19:55 |
|
UCM 10 Sep 2006, 20:13
Some port (look it up, I forgot.)
|
|||
10 Sep 2006, 20:13 |
|
merlin 10 Sep 2006, 20:17
Thanks, I'll check Ralph Brown...
|
|||
10 Sep 2006, 20:17 |
|
Dex4u 10 Sep 2006, 21:12
Cursor can be set like this:
Code: ;''''''''''''''''''''''''''''''''''''''''''''''''''''; ; Sets cursor pos ; ;----------------------------------------------------; ; ; ; Input: ; ; [screen_x] points to X ; ; ; ; [screen_Y] points to Y ; ; ; ; Output: ; ; None. ; ;....................................................;set_cursor_pos: push eax push ebx push ecx push edx xor ebx,ebx mov bl,[screen_x] mov ecx,ebx mov bl,[screen_y] mov eax,80 mul bx add eax,ecx mov edx,0x3d4 mov ecx,eax mov al,0x0f out dx,al mov eax,ecx inc edx out dx,al mov al,0x0e dec edx out dx,al mov eax,ecx mov al,ah inc edx out dx,al pop edx pop ecx pop ebx pop eax ret |
|||
10 Sep 2006, 21:12 |
|
vid 10 Sep 2006, 21:24
Quote: Anyway, all offsets are calulated manually, so the code doesn't hmm, what's this? Code: mov [gdtr+2], eax |
|||
10 Sep 2006, 21:24 |
|
merlin 11 Sep 2006, 12:50
@Dex4u:
Thanks man... It saved me quite a lot of time @vid: In the first lines of code I set the ds selector to point to the start of the code, so "org 0x0" becomes quite natural after this... Here it is: Code: mov ax, cs xor ebp, ebp call @@10 @@10: pop bp sub bp, @@10-tagStart mov bx, bp shr bx, 4 add bx, ax mov ds, bx In the original I forgot to add cs, however here it's added. |
|||
11 Sep 2006, 12:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.