This message was edited by ajtr211 at 2002-10-10 8:18:58
This message was edited by ajtr211 at 2002-10-10 8:16:38
: This message was edited by kwdogg454 at 2002-10-10 2:46:55
: This message was edited by kwdogg454 at 2002-10-9 21:20:56
: hello fellow asm programers,
: i am beginning to learn asm and am working on a project that i found rather interesting. its a start of writing a basic OS on a floppy. i am hung up in this way: i need to find a way to write the flags register and the interrupt vector table to the 2nd and 3rd sectors on a floppy respectively. the code i am writing is stored on the 1rst sector of the floppy. upon boot up the disk will halt the boot up process before any OS is loaded ( this part is done)so i need to use BIOS interrupts not DOS to get the information from the register and IVT at this point and copy it back to the disk. im assuming i need to use int 13h but im lost at this point. if anyone has done this before and/or can help i would greatly appreciate it. thanks!!! i am using MASM by the way
:
************************************************************************
Hi, Greetings,
This is a register dumper procedure
.data
array DWORD 1,2,3,4,5,6,7,8,9,0Ah,0Bh
.code
main proc
mov esi,OFFSET array ;starting offset
mov ecx,Lengthof array ;number of units
mov ebx,Type array ;doubleword format
call DumpMemory
exit ;Invoke exit procedure [ do this yourself]
;mov ah,20h,int 21h or mov ax,4c00h,int 21h
main endp
DumpMemory proc
.data
flags WORD ?
saveIP WORD ?
saveSP WORD ?
.code pop saveIP
mov saveSP,sp
push saveIP
push eax
pushfd
pushf
pop flags
NewLine
ShowRegister EAX,EAX
ShowRegister EBX,EBX
ShowRegister ECX,ECX
ShowRegister EDX,EDX
NewLine
ShowRegister ESI,ESI
ShowRegister EDI,EDI
ShowRegister EBP,EBP
movzx eax,saveSP
ShowRegister ESP,EAX
NewLine
movzx eax,saveIP
ShowRegister EIP,EAX
movzx eax,flags
ShowRegister EFL,EAX
;Show the flags
ShowFlag CF,1
ShowFlag SF,8
ShowFlag ZF,7
ShowFlag OF,12
NewLine
NewLine
popfd
pop eax
ret
DumpMemory endp
END MAIN
OUTPUT:
00000001 00000002 00000003 00000004 00000005 00000006
00000007 00000008 00000009 0000000A 0000000B
WHEN YOU USE THE DUMPMEMORY IN OTHER CODE IT
WILL SHOW:EXAMPLE OF THE
OUTPUT:
EAX=00000613 EBX=00000000 ECX=000000FF EDX=00000065
ESI=00000001 EDI=00000054 EBP=0000065F ESP=00000076
EIP= 0041206 EFL-00000032 CF=0 SF=1 ZF=0 OF=0
Your own code will be different from this.
Regards AJTR211