Queatrix 0 Newbie Poster

Oh, I didn't see your post, Tight. I will look into that as well.

Queatrix 0 Newbie Poster

Okay, I will try to go about it a little differently, or do as you said.

Queatrix 0 Newbie Poster

Yes, in asm.

That's the problem, I'm making an OS, and I don't want it to depend on any other OSes. (except for DOS is fine)

I tried using INT 40h, but it doesn't seem to work. The code compiles and runs, but nothing happens on the interrupt.

Queatrix 0 Newbie Poster

How would I execute a C/C++ program without using a windows library? (Like ShellExecute)

Queatrix 0 Newbie Poster

I see, after really looking through it, I got rid of some errors, and it took care of the rest.

Queatrix 0 Newbie Poster

I have been a C/C++ programmer for 4 years now, and now that I'm actually reading a tut on it, I have to say, I am impressed! The whole concept of the DS really is cool; and it's flexability is the best I have seen.

While I was reading one of the lessons I noticed how they mentioned that the ESP changed according the data pushed.
So, would the following code be considered valid?

mov ebx, esp
push dword [first_var]
push dword [middle_var]
push dword [last_var]
call [my_function]
mov esp, ebx
Queatrix 0 Newbie Poster

I have tried to assemble the following code in TASM and Flat Assembler, but they both give an error for every line of code. What is going on? How can I get the assemblers to assemble the * code?? Thanks for any help you can provide.

[BITS 16]
[ORG 0]

jmp start

	bootdrv 	db 0
	bootmsg 	db 'Boot Sector Example',13,10,0

	rebootmsg    db 'Press any key to reboot',13,10,0

	processormsg	db 'Checking for 386+ processor: ',0
	need386 	db 'Sorry... 386+ required!',13,10,0
	found386	db 'Found!',13,10,0

	whatever	db 'Now we insert our code here to do something, and we have an OS!',13,10,0

	detect_cpu:
		mov si, processormsg
		call message

		pushf
		
		xor ah,ah
		push ax
		popf
		
		pushf
		pop ax	     
		and ah,0f0h
		cmp ah,0f0h
		je no386

		; check for a 286 (bits 12-15 are clear)
		mov ah,0f0h
		push ax
		popf
		
		pushf
		pop ax
		and ah,0f0h
		jz no386
		popf
		
		mov si, found386
		call message
		
		ret
	 no386:
		mov si,need386
		call message
		jmp reboot

	message:
		lodsb
		or al,al
		jz done
		mov ah,0eh
		mov bx,0007
		int 0x10
		jmp message
	done:
		ret

	getkey:
		mov ah, 0
		int 016h
		ret

	reboot:
		mov si, rebootmsg
		call message
		call getkey

		db 0EAh

		dw 0000h
		dw 0FFFFh
		
start:
	mov ax,0x7c0
	mov ds,ax
data

	mov [bootdrv], dl

	cli
	mov ax,0x9000
	mov ss,ax
	mov sp,0xffff
	sti
	
	mov si,bootmsg
	call message

	call detect_cpu

.386

	mov si,whatever
	call message
	call getkey
	
	call reboot

	times 510-($-$$) db 0
	dw 0xAA55
Queatrix 0 Newbie Poster

Why not?

Queatrix 0 Newbie Poster

Lerner, he may be asking how to validate it.
If so you somewhat like this

BOOL IsNumber(char szString[])
{
   for(i = 0; szString[i] != 0; i++)
   {
      if(szString[i] >= '0' && szString[i] <= '9')
      {
         // This carachter is number.
      }
      else
         return FALSE;
         // This one ain't, your outta here.
   }
   return TRUE;
}
Queatrix 0 Newbie Poster

modify the function prototype to

int countchar(const char[], char);
Queatrix 0 Newbie Poster

getchar() also.

Queatrix 0 Newbie Poster

Connection? Like so:?

DWORD dwVal;               
BOOL bInternetExists = InternetGetConnectedState(&dwVal, 0);     
while(bInternetExists != TRUE)
Sleep(100);
// Do upload!
Queatrix 0 Newbie Poster

jw is "just wandering" right?

Without system("pause");, your program will end right after printing your final text, so you won't have any time to read the text before is closes, if you where in DOS rather than in a consol, you wouldn't have to worry about this.

You can use getch() to do the same thing but without the anoying text. ;)

Q