flat assembler
Message board for the users of flat assembler.
Index
> DOS > A20 line controlling |
Author |
|
zhak 12 Jul 2006, 08:16
I took a glance at your code... it's too complicated, I think.
And numerous calls and jumps make it much sloooowly I'm giving you my code. try to analize it and maybe you'll find your error. (i tested it only on my system, yet. tell me about any problems) Code: enable_a20: mov si, 0500h in al, 92h or al, 2 and al, 0FEh out 92h, al mov byte [si], 0 push ds mov ax, 0FFFFh mov ds, ax mov [si+10], al pop ds cmp byte [si], al jnz .ret @@: in al, 64h test al, 2 jnz @b mov al, 0D0h out 64h, al @@: in al, 64h test al, 1 jnz @b in al, 60h mov dl, al @@: in al, 64h test al, 2 jnz @b mov al, 0D1h out 64h, al @@: in al, 64h test al, 2 jnz @b mov al, dl or al, 2 out 60h, al @@: in al, 64h test al, 2 jnz @b mov byte [si], 0 push ds mov ax, 0FFFFh mov ds, ax mov [si+10], al pop ds cmp [si], al .ret: ret ; ZF = 0 if successful it writes to memory to check if Gate A20 was enabled successfully. |
|||
12 Jul 2006, 08:16 |
|
avcaballero 13 Jul 2006, 19:34
Hello, zhak
Thank you for your response, I'm sorry not to answer earlier... I took a glance at your code too and I believe that your code basically uses 92h port, I'm afraid that never uses 64h and 60h ports. As I've said, 92h port works fine, not as 64h and 60h. Afterwards I'll read more carefully your code. Cheers |
|||
13 Jul 2006, 19:34 |
|
avcaballero 14 Jul 2006, 20:25
Hi again
I've debugged your code and, effectively jumps in first "jnz .ret". Anyway, why not use next code? Code: FastGate EQU 92h Accion EQU 0DFh ; 0DFh to activate A20 line ; 0DDh to deactivate A20 line use16 ; usa codigo de 16 bits ORG 100h ; change A20 line status CLI MOV AL, Accion OUT FastGate, AL ; verify A20 line status IN AL, FastGate STI AND AL, 2 MOV DX, A20MSG1 ; Suppose A20 active JNZ $_Fin ; if it is, jump to print it MOV DX, A20MSG2 ; if it isn't, print no active $_Fin: MOV AH, 9 INT 21h MOV AX, 4C00h INT 21h A20MSG1 DB "A20 line active$" A20MSG2 DB "A20 line no active$" |
|||
14 Jul 2006, 20:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.