Page 1 of 3

Problem with string output

Posted: Wed Aug 02, 2006 5:46 am
by origin of
hi, i've a big problem that i can't resolve....

this is my video.cpp

Code: Select all

//video.cpp
#include "../include/video.h"

Video::Video()
{
pos=0 ; off=0;
col = 0x0700;
videomem = (unsigned short*) 0xb8000 ;
}

void Video::clear()
{	
	pos=0;
	off=0;
	for (int i=0; i<2000; i++) put(' ');
	pos=0;
	off=0;
	return;
}

void Video::accapo(){
	off+=80;
	pos=0;
	return;
}

void Video::put(const char* c){
	const char *j = c, *pun;

	for (pun = j; *pun; pun++) put(*pun);
	return;
}

void Video::set(unsigned int kol) {
	col = kol;
	return;
}

void Video::put(const char c)
{	/*Da queste parti qualcosa un va*/
	videomem = (unsigned short*) 0xb8000 ;
	if(c == '\n') { accapo(); return;}
	if(c == '\t') { for(int i=0;i<8;i++) put(' '); return; }
	/*anke qua*/
	if(pos == 80) { accapo(); }
	videomem[pos + off] = (unsigned char) c | col;
	pos++;
	
}
when i try this

Code: Select all

write.clear();
write.set(0x0A00);
write << "\n\t\t\tOpen Source Operative System\n\n";
write << "Inizializzazione PIC      \t\t\t\t\t\t[ KO ]\n";
write.set(0x0F00);
write << "Inizializzazione PIC      \t\t\t\t\t\t[ KO ]\n";
this is the output...

Image

why it doesn't finish to write the string ?? :(

Posted: Wed Aug 02, 2006 8:19 am
by ComputerPsi
Hello. I cannot help you much because C is not my main language, but I have one question.. maybe this will help, I am not sure.
In "void Video::put(const char c)", "c" is a byte. So, how can you do an operation like "if(c == '\n')" if c can only be one byte? '\n' is two bytes...

Posted: Wed Aug 02, 2006 11:22 am
by carbonBased
\n is an escaped character in c. It's equal to the new line character.

As per the original question -- you're not showing us all the code. Where do you overload <<? I assume this calls put(const char *) ?

--Jeff

Posted: Wed Aug 02, 2006 11:37 am
by origin of
no, this isn't the problem...."\n" or "\t" are interpretated by the system as 1 byte....


excuse me for bad english.. :lol:

Anyone can help me ? :?:

Posted: Wed Aug 02, 2006 11:38 am
by origin of
carbonBased wrote:\n is an escaped character in c. It's equal to the new line character.

As per the original question -- you're not showing us all the code. Where do you overload <<? I assume this calls put(const char *) ?

--Jeff

Code: Select all

#include "../include/OStream.h"
#include "../include/string.h"

namespace std
{

	OStream write;
	OStream& OStream::operator << (const int num){
		char num_str[30];
		inttoa(num, num_str);
		put(num_str);
		return *this;
	}

	OStream& OStream::operator << (const unsigned int num){
		char num_str[30];
		unsignedtoa(num, num_str, 10);
		put(num_str);
		return *this;
	}

	OStream& OStream::operator << (const char* str){
		put(str);
		return *this;
	}

	OStream& OStream::operator << (const char ch){
		put(ch);
		return *this;
	}
}
here...but i think the problem is in video.cpp

Put Function

Posted: Wed Aug 02, 2006 2:22 pm
by dave
1. I would say it appears possibly one of your put functions is the cause, try writing a smaller string and see if it works.

2. Your mixing signed and unsigned values (specifically characters) which could cause problems depending on your compiler. Different conditional branches exist for each type and could make a difference. As an example

Code: Select all

void Video::put(const char* c){ 
   const char *j = c, *pun; 

   for (pun = j; *pun; pun++) put(*pun); 
   return; 
}
the for loop above from your code uses *pun as the conditional but because no condition is supplied and it is signed the compiler is left to interpret what you intended which may or may not be *pun = 0 as you intended. Assuming the compiler will get it right is not reliable.

dave

Re: Put Function

Posted: Thu Aug 03, 2006 8:33 am
by carbonBased
dave wrote: the for loop above from your code uses *pun as the conditional but because no condition is supplied and it is signed the compiler is left to interpret what you intended which may or may not be *pun = 0 as you intended. Assuming the compiler will get it right is not reliable.
You sure about that? Any variable, or expression, in C, can also be a boolean, where false is 0 and true is !0, of course.

Also, ascii is 7-bit, and therefore always positive. I agree that mixing signage is a bad idea, but I don't believe it's the culprit here.

I do suspect the for loop, though. What compiler are you using, by the way? If it can (and it probably can) have you output assembly and confirmed it's generating accurate code?

I've be inclined to rewrite your put as:
while(*pun) put(*pun++)

I've also be inclined to try renaming your various put's to putString and putChar temporary to ensure there's nothing especially strange going on with method overloading.

--Jeff

Posted: Thu Aug 03, 2006 10:52 pm
by dave
The compiler could careless that ASCII values are being stored in any data type. All data types simply specify a number of bits. If you apply other attributes such as signed or unsigned your telling the compiler what operands work properly and how to handle the data. So if additional attributes are not specified the compiler will try to make a descision as to what the coder intended which is not always what one would expect.

While C can treat expressions as boolean values an assumption is being made about how compiler will interpret the intentions of the programmer.


dave

Posted: Fri Aug 04, 2006 12:24 pm
by carbonBased
dave wrote:The compiler could careless that ASCII values are being stored in any data type. All data types simply specify a number of bits. If you apply other attributes such as signed or unsigned your telling the compiler what operands work properly and how to handle the data. So if additional attributes are not specified the compiler will try to make a descision as to what the coder intended which is not always what one would expect.
dave
Of course. I was speaking only to the value used in the condition. A jump based on signage will, of course, not be effected by a 7-bit value in an 8-bit 2's compliment system. It's positive, whether treated as signed or unsigned.

But anyway, I'm belabouring (and partially misinterpretting...) the issue. We haven't heard from the original poster for a while. "Origin of," have you been able to try out Dave's suggestions? I'd also be curious to see the assembly... this would be the ultimate source, as I don't see anything overtly wrong with the code. As Dave's mentioned, it's entirely possible the compiler has made a poor assumption to an undefined portion of the C spec.
dave wrote: While C can treat expressions as boolean values an assumption is being made about how compiler will interpret the intentions of the programmer.
Where undefined in the spec, yes. I'm fairly certain K&R defines this case (and, in fact, use it). I would, in turn, assume that ANSI C would also adopt the definition. I have neither in front of me, though... so... I can't say for sure. I'd be curious to know, as I use similar syntax such as while(*ptr++) in my own code.

--Jeff

Posted: Sat Aug 05, 2006 9:19 am
by origin of
i've try this solution
I've be inclined to rewrite your put as:
while(*pun) put(*pun++)
and this solution..
I've also be inclined to try renaming your various put's to putString and putChar temporary to ensure there's nothing especially strange going on with method overloading.
but nothing, the problem is the same...
this is the assembly of my "OS"
http://www.megaupload.com/?d=MP9THUC3

Posted: Sat Aug 05, 2006 10:55 am
by gaf
Hello
The assembler code you provided was obviously created by a 16bit disassembler. As your kernel is however written in 32 bits, the tool assumed the wrong instruction size, so that the output is actually broken. If you're using gcc/cygwin a tool named objdump should be included in your installation. It can be used to get the 32bit disassembly of your kernel: "objdump -d kernel.o > disasm.txt"

Maybe you could post the output ?

regards,
gaf

Posted: Sat Aug 05, 2006 11:12 am
by origin of
gaf wrote:Hello
The assembler code you provided was obviously created by a 16bit disassembler. As your kernel is however written in 32 bits, the tool assumed the wrong instruction size, so that the output is actually broken. If you're using gcc/cygwin a tool named objdump should be included in your installation. It can be used to get the 32bit disassembly of your kernel: "objdump -d kernel.o > disasm.txt"

Maybe you could post the output ?

regards,
gaf
the final output file is kernel.bin, and not kernel.o...objdump dosn't accept bin file....

Posted: Sat Aug 05, 2006 11:33 am
by gaf
The final output file is kernel.bin, and not kernel.o
But you probably do have some intermediate object files ? Actually video.o(bj) would already be sufficient..
objdump dosn't accept bin file
Are you sure about that ? At least my version also supports binary files, and I actually have some doubts that other versions really can't handle the most basic format. If you type "objdump --help" a list off all supported executable formats and traget architectures is printed at the end of the listing. If "binary" is included here, you can force objdump to disassemble the file by typing "objdump --target=binary --architecture=i386 -D kernel.bin".

Hope that works..

regards,
gaf

Posted: Sat Aug 05, 2006 3:16 pm
by origin of
ok :oops:

Code: Select all


kernel.bin:     file format binary

Disassembly of section .data:

0000000000000000 <.data>:
       0:	e8 41 00 00 00       	call   0x46
       5:	fa                   	cli    
       6:	f4                   	hlt    
       7:	90                   	nop    
       8:	55                   	push   %ebp
       9:	89 e5                	mov    %esp,%ebp
       b:	83 ec 18             	sub    $0x18,%esp
       e:	c7 45 f8 30 18 01 00 	movl   $0x11830,0xfffffff8(%ebp)
      15:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
      18:	8b 00                	mov    (%eax),%eax
      1a:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
      1d:	8d 45 f8             	lea    0xfffffff8(%ebp),%eax
      20:	83 00 04             	addl   $0x4,(%eax)
      23:	eb 0d                	jmp    0x32
      25:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
      28:	8b 00                	mov    (%eax),%eax
      2a:	ff d0                	call   *%eax
      2c:	8d 45 f8             	lea    0xfffffff8(%ebp),%eax
      2f:	83 00 04             	addl   $0x4,(%eax)
      32:	8d 45 fc             	lea    0xfffffffc(%ebp),%eax
      35:	83 28 01             	subl   $0x1,(%eax)
      38:	83 7d fc ff          	cmpl   $0xffffffff,0xfffffffc(%ebp)
      3c:	0f 95 c0             	setne  %al
      3f:	84 c0                	test   %al,%al
      41:	75 e2                	jne    0x25
      43:	c9                   	leave  
      44:	c3                   	ret    
      45:	90                   	nop    
      46:	55                   	push   %ebp
      47:	89 e5                	mov    %esp,%ebp
      49:	83 ec 18             	sub    $0x18,%esp
      4c:	83 e4 f0             	and    $0xfffffff0,%esp
      4f:	b8 00 00 00 00       	mov    $0x0,%eax
      54:	83 c0 0f             	add    $0xf,%eax
      57:	83 c0 0f             	add    $0xf,%eax
      5a:	c1 e8 04             	shr    $0x4,%eax
      5d:	c1 e0 04             	shl    $0x4,%eax
      60:	29 c4                	sub    %eax,%esp
      62:	e8 a1 ff ff ff       	call   0x8
      67:	fa                   	cli    
      68:	c7 04 24 48 18 01 00 	movl   $0x11848,(%esp)
      6f:	e8 a8 01 00 00       	call   0x21c
      74:	c7 44 24 04 00 0a 00 	movl   $0xa00,0x4(%esp)
      7b:	00 
      7c:	c7 04 24 48 18 01 00 	movl   $0x11848,(%esp)
      83:	e8 2e 02 00 00       	call   0x2b6
      88:	c7 44 24 04 b8 07 01 	movl   $0x107b8,0x4(%esp)
      8f:	00 
      90:	c7 04 24 48 18 01 00 	movl   $0x11848,(%esp)
      97:	e8 90 02 00 00       	call   0x32c
      9c:	c7 44 24 04 dc 07 01 	movl   $0x107dc,0x4(%esp)
      a3:	00 
      a4:	c7 04 24 48 18 01 00 	movl   $0x11848,(%esp)
      ab:	e8 7c 02 00 00       	call   0x32c
      b0:	fb                   	sti    
      b1:	8d 45 fe             	lea    0xfffffffe(%ebp),%eax
      b4:	89 04 24             	mov    %eax,(%esp)
      b7:	e8 36 05 00 00       	call   0x5f2
      bc:	fa                   	cli    
      bd:	c7 44 24 04 00 0f 00 	movl   $0xf00,0x4(%esp)
      c4:	00 
      c5:	c7 04 24 48 18 01 00 	movl   $0x11848,(%esp)
      cc:	e8 e5 01 00 00       	call   0x2b6
      d1:	c7 44 24 04 dc 07 01 	movl   $0x107dc,0x4(%esp)
      d8:	00 
      d9:	c7 04 24 48 18 01 00 	movl   $0x11848,(%esp)
      e0:	e8 47 02 00 00       	call   0x32c
      e5:	fb                   	sti    
      e6:	8d 45 fe             	lea    0xfffffffe(%ebp),%eax
      e9:	89 04 24             	mov    %eax,(%esp)
      ec:	e8 05 06 00 00       	call   0x6f6
      f1:	b8 00 00 00 00       	mov    $0x0,%eax
      f6:	c9                   	leave  
      f7:	c3                   	ret    
      f8:	55                   	push   %ebp
      f9:	89 e5                	mov    %esp,%ebp
      fb:	8b 45 08             	mov    0x8(%ebp),%eax
      fe:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
     105:	8b 45 08             	mov    0x8(%ebp),%eax
     108:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
     10f:	8b 45 08             	mov    0x8(%ebp),%eax
     112:	c7 00 00 07 00 00    	movl   $0x700,(%eax)
     118:	8b 45 08             	mov    0x8(%ebp),%eax
     11b:	c7 40 0c 00 80 0b 00 	movl   $0xb8000,0xc(%eax)
     122:	5d                   	pop    %ebp
     123:	c3                   	ret    
     124:	55                   	push   %ebp
     125:	89 e5                	mov    %esp,%ebp
     127:	8b 45 08             	mov    0x8(%ebp),%eax
     12a:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
     131:	8b 45 08             	mov    0x8(%ebp),%eax
     134:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
     13b:	8b 45 08             	mov    0x8(%ebp),%eax
     13e:	c7 00 00 07 00 00    	movl   $0x700,(%eax)
     144:	8b 45 08             	mov    0x8(%ebp),%eax
     147:	c7 40 0c 00 80 0b 00 	movl   $0xb8000,0xc(%eax)
     14e:	5d                   	pop    %ebp
     14f:	c3                   	ret    
     150:	55                   	push   %ebp
     151:	89 e5                	mov    %esp,%ebp
     153:	8b 45 08             	mov    0x8(%ebp),%eax
     156:	8b 40 08             	mov    0x8(%eax),%eax
     159:	8d 50 50             	lea    0x50(%eax),%edx
     15c:	8b 45 08             	mov    0x8(%ebp),%eax
     15f:	89 50 08             	mov    %edx,0x8(%eax)
     162:	8b 45 08             	mov    0x8(%ebp),%eax
     165:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
     16c:	5d                   	pop    %ebp
     16d:	c3                   	ret    
     16e:	55                   	push   %ebp
     16f:	89 e5                	mov    %esp,%ebp
     171:	83 ec 1c             	sub    $0x1c,%esp
     174:	8b 45 0c             	mov    0xc(%ebp),%eax
     177:	88 45 ec             	mov    %al,0xffffffec(%ebp)
     17a:	8b 45 08             	mov    0x8(%ebp),%eax
     17d:	c7 40 0c 00 80 0b 00 	movl   $0xb8000,0xc(%eax)
     184:	80 7d ec 0a          	cmpb   $0xa,0xffffffec(%ebp)
     188:	75 10                	jne    0x19a
     18a:	8b 45 08             	mov    0x8(%ebp),%eax
     18d:	89 04 24             	mov    %eax,(%esp)
     190:	e8 bb ff ff ff       	call   0x150
     195:	e9 80 00 00 00       	jmp    0x21a
     19a:	80 7d ec 09          	cmpb   $0x9,0xffffffec(%ebp)
     19e:	75 2a                	jne    0x1ca
     1a0:	c7 45 fc 00 00 00 00 	movl   $0x0,0xfffffffc(%ebp)
     1a7:	eb 19                	jmp    0x1c2
     1a9:	c7 44 24 04 20 00 00 	movl   $0x20,0x4(%esp)
     1b0:	00 
     1b1:	8b 45 08             	mov    0x8(%ebp),%eax
     1b4:	89 04 24             	mov    %eax,(%esp)
     1b7:	e8 b2 ff ff ff       	call   0x16e
     1bc:	8d 45 fc             	lea    0xfffffffc(%ebp),%eax
     1bf:	83 00 01             	addl   $0x1,(%eax)
     1c2:	83 7d fc 07          	cmpl   $0x7,0xfffffffc(%ebp)
     1c6:	7e e1                	jle    0x1a9
     1c8:	eb 50                	jmp    0x21a
     1ca:	8b 45 08             	mov    0x8(%ebp),%eax
     1cd:	8b 40 04             	mov    0x4(%eax),%eax
     1d0:	83 f8 50             	cmp    $0x50,%eax
     1d3:	75 0b                	jne    0x1e0
     1d5:	8b 45 08             	mov    0x8(%ebp),%eax
     1d8:	89 04 24             	mov    %eax,(%esp)
     1db:	e8 70 ff ff ff       	call   0x150
     1e0:	8b 45 08             	mov    0x8(%ebp),%eax
     1e3:	8b 48 0c             	mov    0xc(%eax),%ecx
     1e6:	8b 45 08             	mov    0x8(%ebp),%eax
     1e9:	8b 50 04             	mov    0x4(%eax),%edx
     1ec:	8b 45 08             	mov    0x8(%ebp),%eax
     1ef:	8b 40 08             	mov    0x8(%eax),%eax
     1f2:	8d 04 02             	lea    (%edx,%eax,1),%eax
     1f5:	01 c0                	add    %eax,%eax
     1f7:	01 c1                	add    %eax,%ecx
     1f9:	0f b6 45 ec          	movzbl 0xffffffec(%ebp),%eax
     1fd:	66 0f b6 d0          	movzbw %al,%dx
     201:	8b 45 08             	mov    0x8(%ebp),%eax
     204:	8b 00                	mov    (%eax),%eax
     206:	09 d0                	or     %edx,%eax
     208:	66 89 01             	mov    %ax,(%ecx)
     20b:	8b 45 08             	mov    0x8(%ebp),%eax
     20e:	8b 40 04             	mov    0x4(%eax),%eax
     211:	8d 50 01             	lea    0x1(%eax),%edx
     214:	8b 45 08             	mov    0x8(%ebp),%eax
     217:	89 50 04             	mov    %edx,0x4(%eax)
     21a:	c9                   	leave  
     21b:	c3                   	ret    
     21c:	55                   	push   %ebp
     21d:	89 e5                	mov    %esp,%ebp
     21f:	83 ec 18             	sub    $0x18,%esp
     222:	8b 45 08             	mov    0x8(%ebp),%eax
     225:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
     22c:	8b 45 08             	mov    0x8(%ebp),%eax
     22f:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
     236:	c7 45 fc 00 00 00 00 	movl   $0x0,0xfffffffc(%ebp)
     23d:	eb 19                	jmp    0x258
     23f:	c7 44 24 04 20 00 00 	movl   $0x20,0x4(%esp)
     246:	00 
     247:	8b 45 08             	mov    0x8(%ebp),%eax
     24a:	89 04 24             	mov    %eax,(%esp)
     24d:	e8 1c ff ff ff       	call   0x16e
     252:	8d 45 fc             	lea    0xfffffffc(%ebp),%eax
     255:	83 00 01             	addl   $0x1,(%eax)
     258:	81 7d fc cf 07 00 00 	cmpl   $0x7cf,0xfffffffc(%ebp)
     25f:	7e de                	jle    0x23f
     261:	8b 45 08             	mov    0x8(%ebp),%eax
     264:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
     26b:	8b 45 08             	mov    0x8(%ebp),%eax
     26e:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
     275:	c9                   	leave  
     276:	c3                   	ret    
     277:	90                   	nop    
     278:	55                   	push   %ebp
     279:	89 e5                	mov    %esp,%ebp
     27b:	83 ec 18             	sub    $0x18,%esp
     27e:	8b 45 0c             	mov    0xc(%ebp),%eax
     281:	89 45 f8             	mov    %eax,0xfffffff8(%ebp)
     284:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     287:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
     28a:	eb 1e                	jmp    0x2aa
     28c:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     28f:	0f b6 00             	movzbl (%eax),%eax
     292:	0f be d0             	movsbl %al,%edx
     295:	8d 45 fc             	lea    0xfffffffc(%ebp),%eax
     298:	83 00 01             	addl   $0x1,(%eax)
     29b:	89 54 24 04          	mov    %edx,0x4(%esp)
     29f:	8b 45 08             	mov    0x8(%ebp),%eax
     2a2:	89 04 24             	mov    %eax,(%esp)
     2a5:	e8 c4 fe ff ff       	call   0x16e
     2aa:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     2ad:	0f b6 00             	movzbl (%eax),%eax
     2b0:	84 c0                	test   %al,%al
     2b2:	75 d8                	jne    0x28c
     2b4:	c9                   	leave  
     2b5:	c3                   	ret    
     2b6:	55                   	push   %ebp
     2b7:	89 e5                	mov    %esp,%ebp
     2b9:	8b 55 08             	mov    0x8(%ebp),%edx
     2bc:	8b 45 0c             	mov    0xc(%ebp),%eax
     2bf:	89 02                	mov    %eax,(%edx)
     2c1:	5d                   	pop    %ebp
     2c2:	c3                   	ret    
     2c3:	00 55 89             	add    %dl,0xffffff89(%ebp)
     2c6:	e5 83                	in     $0x83,%eax
     2c8:	ec                   	in     (%dx),%al
     2c9:	28 8d 45 e2 89 44    	sub    %cl,0x4489e245(%ebp)
     2cf:	24 04                	and    $0x4,%al
     2d1:	8b 45 0c             	mov    0xc(%ebp),%eax
     2d4:	89 04 24             	mov    %eax,(%esp)
     2d7:	e8 26 02 00 00       	call   0x502
     2dc:	8b 55 08             	mov    0x8(%ebp),%edx
     2df:	8d 45 e2             	lea    0xffffffe2(%ebp),%eax
     2e2:	89 44 24 04          	mov    %eax,0x4(%esp)
     2e6:	89 14 24             	mov    %edx,(%esp)
     2e9:	e8 8a ff ff ff       	call   0x278
     2ee:	8b 45 08             	mov    0x8(%ebp),%eax
     2f1:	c9                   	leave  
     2f2:	c3                   	ret    
     2f3:	90                   	nop    
     2f4:	55                   	push   %ebp
     2f5:	89 e5                	mov    %esp,%ebp
     2f7:	83 ec 38             	sub    $0x38,%esp
     2fa:	c7 44 24 08 0a 00 00 	movl   $0xa,0x8(%esp)
     301:	00 
     302:	8d 45 e2             	lea    0xffffffe2(%ebp),%eax
     305:	89 44 24 04          	mov    %eax,0x4(%esp)
     309:	8b 45 0c             	mov    0xc(%ebp),%eax
     30c:	89 04 24             	mov    %eax,(%esp)
     30f:	e8 28 01 00 00       	call   0x43c
     314:	8b 55 08             	mov    0x8(%ebp),%edx
     317:	8d 45 e2             	lea    0xffffffe2(%ebp),%eax
     31a:	89 44 24 04          	mov    %eax,0x4(%esp)
     31e:	89 14 24             	mov    %edx,(%esp)
     321:	e8 52 ff ff ff       	call   0x278
     326:	8b 45 08             	mov    0x8(%ebp),%eax
     329:	c9                   	leave  
     32a:	c3                   	ret    
     32b:	90                   	nop    
     32c:	55                   	push   %ebp
     32d:	89 e5                	mov    %esp,%ebp
     32f:	83 ec 08             	sub    $0x8,%esp
     332:	8b 55 08             	mov    0x8(%ebp),%edx
     335:	8b 45 0c             	mov    0xc(%ebp),%eax
     338:	89 44 24 04          	mov    %eax,0x4(%esp)
     33c:	89 14 24             	mov    %edx,(%esp)
     33f:	e8 34 ff ff ff       	call   0x278
     344:	8b 45 08             	mov    0x8(%ebp),%eax
     347:	c9                   	leave  
     348:	c3                   	ret    
     349:	90                   	nop    
     34a:	55                   	push   %ebp
     34b:	89 e5                	mov    %esp,%ebp
     34d:	83 ec 18             	sub    $0x18,%esp
     350:	8b 45 0c             	mov    0xc(%ebp),%eax
     353:	88 45 fc             	mov    %al,0xfffffffc(%ebp)
     356:	0f be 45 fc          	movsbl 0xfffffffc(%ebp),%eax
     35a:	8b 55 08             	mov    0x8(%ebp),%edx
     35d:	89 44 24 04          	mov    %eax,0x4(%esp)
     361:	89 14 24             	mov    %edx,(%esp)
     364:	e8 05 fe ff ff       	call   0x16e
     369:	8b 45 08             	mov    0x8(%ebp),%eax
     36c:	c9                   	leave  
     36d:	c3                   	ret    
     36e:	55                   	push   %ebp
     36f:	89 e5                	mov    %esp,%ebp
     371:	83 ec 18             	sub    $0x18,%esp
     374:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
     377:	89 55 f8             	mov    %edx,0xfffffff8(%ebp)
     37a:	83 7d fc 01          	cmpl   $0x1,0xfffffffc(%ebp)
     37e:	75 15                	jne    0x395
     380:	81 7d f8 ff ff 00 00 	cmpl   $0xffff,0xfffffff8(%ebp)
     387:	75 0c                	jne    0x395
     389:	c7 04 24 48 18 01 00 	movl   $0x11848,(%esp)
     390:	e8 31 02 00 00       	call   0x5c6
     395:	c9                   	leave  
     396:	c3                   	ret    
     397:	90                   	nop    
     398:	55                   	push   %ebp
     399:	89 e5                	mov    %esp,%ebp
     39b:	83 ec 08             	sub    $0x8,%esp
     39e:	ba ff ff 00 00       	mov    $0xffff,%edx
     3a3:	b8 01 00 00 00       	mov    $0x1,%eax
     3a8:	e8 c1 ff ff ff       	call   0x36e
     3ad:	c9                   	leave  
     3ae:	c3                   	ret    
     3af:	00 55 89             	add    %dl,0xffffff89(%ebp)
     3b2:	e5 83                	in     $0x83,%eax
     3b4:	ec                   	in     (%dx),%al
     3b5:	04 c7                	add    $0xc7,%al
     3b7:	45                   	inc    %ebp
     3b8:	fc                   	cld    
     3b9:	00 00                	add    %al,(%eax)
     3bb:	00 00                	add    %al,(%eax)
     3bd:	eb 08                	jmp    0x3c7
     3bf:	83 45 08 01          	addl   $0x1,0x8(%ebp)
     3c3:	83 45 fc 01          	addl   $0x1,0xfffffffc(%ebp)
     3c7:	8b 45 08             	mov    0x8(%ebp),%eax
     3ca:	0f b6 00             	movzbl (%eax),%eax
     3cd:	84 c0                	test   %al,%al
     3cf:	75 ee                	jne    0x3bf
     3d1:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     3d4:	c9                   	leave  
     3d5:	c3                   	ret    
     3d6:	55                   	push   %ebp
     3d7:	89 e5                	mov    %esp,%ebp
     3d9:	83 ec 18             	sub    $0x18,%esp
     3dc:	c7 45 f8 00 00 00 00 	movl   $0x0,0xfffffff8(%ebp)
     3e3:	8b 45 08             	mov    0x8(%ebp),%eax
     3e6:	89 04 24             	mov    %eax,(%esp)
     3e9:	e8 c2 ff ff ff       	call   0x3b0
     3ee:	83 e8 01             	sub    $0x1,%eax
     3f1:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
     3f4:	eb 3b                	jmp    0x431
     3f6:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     3f9:	03 45 08             	add    0x8(%ebp),%eax
     3fc:	0f b6 00             	movzbl (%eax),%eax
     3ff:	0f be c0             	movsbl %al,%eax
     402:	89 45 f4             	mov    %eax,0xfffffff4(%ebp)
     405:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     408:	89 c2                	mov    %eax,%edx
     40a:	03 55 08             	add    0x8(%ebp),%edx
     40d:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     410:	03 45 08             	add    0x8(%ebp),%eax
     413:	0f b6 00             	movzbl (%eax),%eax
     416:	88 02                	mov    %al,(%edx)
     418:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     41b:	89 c2                	mov    %eax,%edx
     41d:	03 55 08             	add    0x8(%ebp),%edx
     420:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
     423:	88 02                	mov    %al,(%edx)
     425:	8d 45 f8             	lea    0xfffffff8(%ebp),%eax
     428:	83 00 01             	addl   $0x1,(%eax)
     42b:	8d 45 fc             	lea    0xfffffffc(%ebp),%eax
     42e:	83 28 01             	subl   $0x1,(%eax)
     431:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     434:	3b 45 fc             	cmp    0xfffffffc(%ebp),%eax
     437:	7c bd                	jl     0x3f6
     439:	c9                   	leave  
     43a:	c3                   	ret    
     43b:	00 55 89             	add    %dl,0xffffff89(%ebp)
     43e:	e5 83                	in     $0x83,%eax
     440:	ec                   	in     (%dx),%al
     441:	20 c7                	and    %al,%bh
     443:	45                   	inc    %ebp
     444:	f8                   	clc    
     445:	04 08                	add    $0x8,%al
     447:	01 00                	add    %eax,(%eax)
     449:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
     44d:	75 07                	jne    0x456
     44f:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)
     456:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
     45a:	74 0c                	je     0x468
     45c:	83 7d 10 01          	cmpl   $0x1,0x10(%ebp)
     460:	7e 06                	jle    0x468
     462:	83 7d 10 24          	cmpl   $0x24,0x10(%ebp)
     466:	7e 0c                	jle    0x474
     468:	c7 45 ec 00 00 00 00 	movl   $0x0,0xffffffec(%ebp)
     46f:	e9 88 00 00 00       	jmp    0x4fc
     474:	8b 45 10             	mov    0x10(%ebp),%eax
     477:	3b 45 08             	cmp    0x8(%ebp),%eax
     47a:	76 19                	jbe    0x495
     47c:	8b 45 08             	mov    0x8(%ebp),%eax
     47f:	03 45 f8             	add    0xfffffff8(%ebp),%eax
     482:	0f b6 10             	movzbl (%eax),%edx
     485:	8b 45 0c             	mov    0xc(%ebp),%eax
     488:	88 10                	mov    %dl,(%eax)
     48a:	8b 45 0c             	mov    0xc(%ebp),%eax
     48d:	83 c0 01             	add    $0x1,%eax
     490:	c6 00 00             	movb   $0x0,(%eax)
     493:	eb 61                	jmp    0x4f6
     495:	8b 55 10             	mov    0x10(%ebp),%edx
     498:	8b 45 08             	mov    0x8(%ebp),%eax
     49b:	89 d1                	mov    %edx,%ecx
     49d:	ba 00 00 00 00       	mov    $0x0,%edx
     4a2:	f7 f1                	div    %ecx
     4a4:	89 c2                	mov    %eax,%edx
     4a6:	8b 45 10             	mov    0x10(%ebp),%eax
     4a9:	89 44 24 08          	mov    %eax,0x8(%esp)
     4ad:	8b 45 0c             	mov    0xc(%ebp),%eax
     4b0:	89 44 24 04          	mov    %eax,0x4(%esp)
     4b4:	89 14 24             	mov    %edx,(%esp)
     4b7:	e8 80 ff ff ff       	call   0x43c
     4bc:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
     4bf:	eb 06                	jmp    0x4c7
     4c1:	8d 45 fc             	lea    0xfffffffc(%ebp),%eax
     4c4:	83 00 01             	addl   $0x1,(%eax)
     4c7:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     4ca:	0f b6 00             	movzbl (%eax),%eax
     4cd:	84 c0                	test   %al,%al
     4cf:	75 f0                	jne    0x4c1
     4d1:	8b 55 10             	mov    0x10(%ebp),%edx
     4d4:	8b 45 08             	mov    0x8(%ebp),%eax
     4d7:	89 d1                	mov    %edx,%ecx
     4d9:	ba 00 00 00 00       	mov    $0x0,%edx
     4de:	f7 f1                	div    %ecx
     4e0:	8b 45 10             	mov    0x10(%ebp),%eax
     4e3:	89 44 24 08          	mov    %eax,0x8(%esp)
     4e7:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     4ea:	89 44 24 04          	mov    %eax,0x4(%esp)
     4ee:	89 14 24             	mov    %edx,(%esp)
     4f1:	e8 46 ff ff ff       	call   0x43c
     4f6:	8b 45 0c             	mov    0xc(%ebp),%eax
     4f9:	89 45 ec             	mov    %eax,0xffffffec(%ebp)
     4fc:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
     4ff:	c9                   	leave  
     500:	c3                   	ret    
     501:	00 55 89             	add    %dl,0xffffff89(%ebp)
     504:	e5 56                	in     $0x56,%eax
     506:	53                   	push   %ebx
     507:	83 ec 20             	sub    $0x20,%esp
     50a:	8b 45 08             	mov    0x8(%ebp),%eax
     50d:	89 45 f4             	mov    %eax,0xfffffff4(%ebp)
     510:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
     513:	c1 e8 1f             	shr    $0x1f,%eax
     516:	84 c0                	test   %al,%al
     518:	74 03                	je     0x51d
     51a:	f7 5d 08             	negl   0x8(%ebp)
     51d:	c7 45 f0 00 00 00 00 	movl   $0x0,0xfffffff0(%ebp)
     524:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
     527:	89 c3                	mov    %eax,%ebx
     529:	03 5d 0c             	add    0xc(%ebp),%ebx
     52c:	8b 4d 08             	mov    0x8(%ebp),%ecx
     52f:	c7 45 e0 67 66 66 66 	movl   $0x66666667,0xffffffe0(%ebp)
     536:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
     539:	f7 e9                	imul   %ecx
     53b:	c1 fa 02             	sar    $0x2,%edx
     53e:	89 c8                	mov    %ecx,%eax
     540:	c1 f8 1f             	sar    $0x1f,%eax
     543:	89 d6                	mov    %edx,%esi
     545:	29 c6                	sub    %eax,%esi
     547:	89 75 e4             	mov    %esi,0xffffffe4(%ebp)
     54a:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
     54d:	01 c0                	add    %eax,%eax
     54f:	01 c0                	add    %eax,%eax
     551:	03 45 e4             	add    0xffffffe4(%ebp),%eax
     554:	01 c0                	add    %eax,%eax
     556:	89 ca                	mov    %ecx,%edx
     558:	29 c2                	sub    %eax,%edx
     55a:	89 55 e4             	mov    %edx,0xffffffe4(%ebp)
     55d:	0f b6 45 e4          	movzbl 0xffffffe4(%ebp),%eax
     561:	04 30                	add    $0x30,%al
     563:	88 03                	mov    %al,(%ebx)
     565:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
     568:	83 00 01             	addl   $0x1,(%eax)
     56b:	8b 4d 08             	mov    0x8(%ebp),%ecx
     56e:	c7 45 e0 67 66 66 66 	movl   $0x66666667,0xffffffe0(%ebp)
     575:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
     578:	f7 e9                	imul   %ecx
     57a:	c1 fa 02             	sar    $0x2,%edx
     57d:	89 c8                	mov    %ecx,%eax
     57f:	c1 f8 1f             	sar    $0x1f,%eax
     582:	89 d1                	mov    %edx,%ecx
     584:	29 c1                	sub    %eax,%ecx
     586:	89 c8                	mov    %ecx,%eax
     588:	89 45 08             	mov    %eax,0x8(%ebp)
     58b:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
     58f:	0f 9f c0             	setg   %al
     592:	84 c0                	test   %al,%al
     594:	75 8e                	jne    0x524
     596:	83 7d f4 00          	cmpl   $0x0,0xfffffff4(%ebp)
     59a:	79 0f                	jns    0x5ab
     59c:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
     59f:	03 45 0c             	add    0xc(%ebp),%eax
     5a2:	c6 00 2d             	movb   $0x2d,(%eax)
     5a5:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
     5a8:	83 00 01             	addl   $0x1,(%eax)
     5ab:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
     5ae:	03 45 0c             	add    0xc(%ebp),%eax
     5b1:	c6 00 00             	movb   $0x0,(%eax)
     5b4:	8b 45 0c             	mov    0xc(%ebp),%eax
     5b7:	89 04 24             	mov    %eax,(%esp)
     5ba:	e8 17 fe ff ff       	call   0x3d6
     5bf:	83 c4 20             	add    $0x20,%esp
     5c2:	5b                   	pop    %ebx
     5c3:	5e                   	pop    %esi
     5c4:	5d                   	pop    %ebp
     5c5:	c3                   	ret    
     5c6:	55                   	push   %ebp
     5c7:	89 e5                	mov    %esp,%ebp
     5c9:	83 ec 08             	sub    $0x8,%esp
     5cc:	8b 45 08             	mov    0x8(%ebp),%eax
     5cf:	89 04 24             	mov    %eax,(%esp)
     5d2:	e8 21 fb ff ff       	call   0xf8
     5d7:	c9                   	leave  
     5d8:	c3                   	ret    
     5d9:	00 00                	add    %al,(%eax)
     5db:	00 55 89             	add    %dl,0xffffff89(%ebp)
     5de:	e5 83                	in     $0x83,%eax
     5e0:	ec                   	in     (%dx),%al
     5e1:	08 89 45 fc 88 55    	or     %cl,0x5588fc45(%ecx)
     5e7:	f8                   	clc    
     5e8:	0f b6 45 f8          	movzbl 0xfffffff8(%ebp),%eax
     5ec:	8b 55 fc             	mov    0xfffffffc(%ebp),%edx
     5ef:	ee                   	out    %al,(%dx)
     5f0:	c9                   	leave  
     5f1:	c3                   	ret    
     5f2:	55                   	push   %ebp
     5f3:	89 e5                	mov    %esp,%ebp
     5f5:	ba 11 00 00 00       	mov    $0x11,%edx
     5fa:	b8 20 00 00 00       	mov    $0x20,%eax
     5ff:	e8 d8 ff ff ff       	call   0x5dc
     604:	ba 11 00 00 00       	mov    $0x11,%edx
     609:	b8 a0 00 00 00       	mov    $0xa0,%eax
     60e:	e8 c9 ff ff ff       	call   0x5dc
     613:	ba 20 00 00 00       	mov    $0x20,%edx
     618:	b8 21 00 00 00       	mov    $0x21,%eax
     61d:	e8 ba ff ff ff       	call   0x5dc
     622:	ba 28 00 00 00       	mov    $0x28,%edx
     627:	b8 a1 00 00 00       	mov    $0xa1,%eax
     62c:	e8 ab ff ff ff       	call   0x5dc
     631:	ba 04 00 00 00       	mov    $0x4,%edx
     636:	b8 21 00 00 00       	mov    $0x21,%eax
     63b:	e8 9c ff ff ff       	call   0x5dc
     640:	ba 03 00 00 00       	mov    $0x3,%edx
     645:	b8 a1 00 00 00       	mov    $0xa1,%eax
     64a:	e8 8d ff ff ff       	call   0x5dc
     64f:	ba 01 00 00 00       	mov    $0x1,%edx
     654:	b8 21 00 00 00       	mov    $0x21,%eax
     659:	e8 7e ff ff ff       	call   0x5dc
     65e:	ba 01 00 00 00       	mov    $0x1,%edx
     663:	b8 a1 00 00 00       	mov    $0xa1,%eax
     668:	e8 6f ff ff ff       	call   0x5dc
     66d:	5d                   	pop    %ebp
     66e:	c3                   	ret    
     66f:	90                   	nop    
     670:	55                   	push   %ebp
     671:	89 e5                	mov    %esp,%ebp
     673:	83 ec 08             	sub    $0x8,%esp
     676:	8b 45 0c             	mov    0xc(%ebp),%eax
     679:	66 89 45 fc          	mov    %ax,0xfffffffc(%ebp)
     67d:	66 83 7d fc 0f       	cmpw   $0xf,0xfffffffc(%ebp)
     682:	7f 66                	jg     0x6ea
     684:	8b 45 08             	mov    0x8(%ebp),%eax
     687:	0f b7 10             	movzwl (%eax),%edx
     68a:	0f bf 4d fc          	movswl 0xfffffffc(%ebp),%ecx
     68e:	b8 01 00 00 00       	mov    $0x1,%eax
     693:	d3 e0                	shl    %cl,%eax
     695:	f7 d0                	not    %eax
     697:	21 c2                	and    %eax,%edx
     699:	8b 45 08             	mov    0x8(%ebp),%eax
     69c:	66 89 10             	mov    %dx,(%eax)
     69f:	66 83 7d fc 07       	cmpw   $0x7,0xfffffffc(%ebp)
     6a4:	7e 11                	jle    0x6b7
     6a6:	8b 45 08             	mov    0x8(%ebp),%eax
     6a9:	0f b7 00             	movzwl (%eax),%eax
     6ac:	89 c2                	mov    %eax,%edx
     6ae:	83 e2 fb             	and    $0xfffffffb,%edx
     6b1:	8b 45 08             	mov    0x8(%ebp),%eax
     6b4:	66 89 10             	mov    %dx,(%eax)
     6b7:	8b 45 08             	mov    0x8(%ebp),%eax
     6ba:	0f b7 00             	movzwl (%eax),%eax
     6bd:	0f b6 d0             	movzbl %al,%edx
     6c0:	b8 21 00 00 00       	mov    $0x21,%eax
     6c5:	e8 12 ff ff ff       	call   0x5dc
     6ca:	8b 45 08             	mov    0x8(%ebp),%eax
     6cd:	0f b7 00             	movzwl (%eax),%eax
     6d0:	66 c1 f8 08          	sar    $0x8,%ax
     6d4:	0f b6 d0             	movzbl %al,%edx
     6d7:	b8 a1 00 00 00       	mov    $0xa1,%eax
     6dc:	e8 fb fe ff ff       	call   0x5dc
     6e1:	c7 45 f8 01 00 00 00 	movl   $0x1,0xfffffff8(%ebp)
     6e8:	eb 07                	jmp    0x6f1
     6ea:	c7 45 f8 00 00 00 00 	movl   $0x0,0xfffffff8(%ebp)
     6f1:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     6f4:	c9                   	leave  
     6f5:	c3                   	ret    
     6f6:	55                   	push   %ebp
     6f7:	89 e5                	mov    %esp,%ebp
     6f9:	83 ec 18             	sub    $0x18,%esp
     6fc:	c7 45 fc 00 00 00 00 	movl   $0x0,0xfffffffc(%ebp)
     703:	eb 19                	jmp    0x71e
     705:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
     708:	98                   	cwtl   
     709:	89 44 24 04          	mov    %eax,0x4(%esp)
     70d:	8b 45 08             	mov    0x8(%ebp),%eax
     710:	89 04 24             	mov    %eax,(%esp)
     713:	e8 58 ff ff ff       	call   0x670
     718:	8d 45 fc             	lea    0xfffffffc(%ebp),%eax
     71b:	83 00 01             	addl   $0x1,(%eax)
     71e:	83 7d fc 0f          	cmpl   $0xf,0xfffffffc(%ebp)
     722:	7e e1                	jle    0x705
     724:	c9                   	leave  
     725:	c3                   	ret    
     726:	55                   	push   %ebp
     727:	89 e5                	mov    %esp,%ebp
     729:	83 ec 08             	sub    $0x8,%esp
     72c:	8b 45 0c             	mov    0xc(%ebp),%eax
     72f:	66 89 45 fc          	mov    %ax,0xfffffffc(%ebp)
     733:	66 83 7d fc 0f       	cmpw   $0xf,0xfffffffc(%ebp)
     738:	7f 70                	jg     0x7aa
     73a:	8b 45 08             	mov    0x8(%ebp),%eax
     73d:	0f b7 10             	movzwl (%eax),%edx
     740:	0f bf 4d fc          	movswl 0xfffffffc(%ebp),%ecx
     744:	b8 01 00 00 00       	mov    $0x1,%eax
     749:	d3 e0                	shl    %cl,%eax
     74b:	09 c2                	or     %eax,%edx
     74d:	8b 45 08             	mov    0x8(%ebp),%eax
     750:	66 89 10             	mov    %dx,(%eax)
     753:	8b 45 08             	mov    0x8(%ebp),%eax
     756:	0f b7 00             	movzwl (%eax),%eax
     759:	98                   	cwtl   
     75a:	25 00 ff 00 00       	and    $0xff00,%eax
     75f:	3d 00 ff 00 00       	cmp    $0xff00,%eax
     764:	75 11                	jne    0x777
     766:	8b 45 08             	mov    0x8(%ebp),%eax
     769:	0f b7 00             	movzwl (%eax),%eax
     76c:	89 c2                	mov    %eax,%edx
     76e:	83 ca 04             	or     $0x4,%edx
     771:	8b 45 08             	mov    0x8(%ebp),%eax
     774:	66 89 10             	mov    %dx,(%eax)
     777:	8b 45 08             	mov    0x8(%ebp),%eax
     77a:	0f b7 00             	movzwl (%eax),%eax
     77d:	0f b6 d0             	movzbl %al,%edx
     780:	b8 21 00 00 00       	mov    $0x21,%eax
     785:	e8 52 fe ff ff       	call   0x5dc
     78a:	8b 45 08             	mov    0x8(%ebp),%eax
     78d:	0f b7 00             	movzwl (%eax),%eax
     790:	66 c1 f8 08          	sar    $0x8,%ax
     794:	0f b6 d0             	movzbl %al,%edx
     797:	b8 a1 00 00 00       	mov    $0xa1,%eax
     79c:	e8 3b fe ff ff       	call   0x5dc
     7a1:	c7 45 f8 01 00 00 00 	movl   $0x1,0xfffffff8(%ebp)
     7a8:	eb 07                	jmp    0x7b1
     7aa:	c7 45 f8 00 00 00 00 	movl   $0x0,0xfffffff8(%ebp)
     7b1:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
     7b4:	c9                   	leave  
     7b5:	c3                   	ret    
     7b6:	00 00                	add    %al,(%eax)
     7b8:	0a 09                	or     (%ecx),%cl
     7ba:	09 09                	or     %ecx,(%ecx)
     7bc:	4f                   	dec    %edi
     7bd:	70 65                	jo     0x824
     7bf:	6e                   	outsb  %ds:(%esi),(%dx)
     7c0:	20 53 6f             	and    %dl,0x6f(%ebx)
     7c3:	75 72                	jne    0x837
     7c5:	63 65 20             	arpl   %sp,0x20(%ebp)
     7c8:	4f                   	dec    %edi
     7c9:	70 65                	jo     0x830
     7cb:	72 61                	jb     0x82e
     7cd:	74 69                	je     0x838
     7cf:	76 65                	jbe    0x836
     7d1:	20 53 79             	and    %dl,0x79(%ebx)
     7d4:	73 74                	jae    0x84a
     7d6:	65                   	gs
     7d7:	6d                   	insl   (%dx),%es:(%edi)
     7d8:	0a 0a                	or     (%edx),%cl
     7da:	00 00                	add    %al,(%eax)
     7dc:	49                   	dec    %ecx
     7dd:	6e                   	outsb  %ds:(%esi),(%dx)
     7de:	69 7a 69 61 6c 69 7a 	imul   $0x7a696c61,0x69(%edx),%edi
     7e5:	7a 61                	jp     0x848
     7e7:	7a 69                	jp     0x852
     7e9:	6f                   	outsl  %ds:(%esi),(%dx)
     7ea:	6e                   	outsb  %ds:(%esi),(%dx)
     7eb:	65 20 50 49          	and    %dl,%gs:0x49(%eax)
     7ef:	43                   	inc    %ebx
     7f0:	20 20                	and    %ah,(%eax)
     7f2:	20 20                	and    %ah,(%eax)
     7f4:	20 20                	and    %ah,(%eax)
     7f6:	09 09                	or     %ecx,(%ecx)
     7f8:	09 09                	or     %ecx,(%ecx)
     7fa:	09 09                	or     %ecx,(%ecx)
     7fc:	5b                   	pop    %ebx
     7fd:	20 4b 4f             	and    %cl,0x4f(%ebx)
     800:	20 5d 0a             	and    %bl,0xa(%ebp)
     803:	00 30                	add    %dh,(%eax)
     805:	31 32                	xor    %esi,(%edx)
     807:	33 34 35 36 37 38 39 	xor    0x39383736(,%esi,1),%esi
     80e:	61                   	popa   
     80f:	62 63 64             	bound  %esp,0x64(%ebx)
     812:	65                   	gs
     813:	66 67 68 69 6a       	addr16 pushw $0x6a69
     818:	6b 6c 6d 6e 6f       	imul   $0x6f,0x6e(%ebp,%ebp,2),%ebp
     81d:	70 71                	jo     0x890
     81f:	72 73                	jb     0x894
     821:	74 75                	je     0x898
     823:	76 77                	jbe    0x89c
     825:	78 79                	js     0x8a0
     827:	7a 00                	jp     0x829
	...
    182d:	00 00                	add    %al,(%eax)
    182f:	00 01                	add    %al,(%ecx)
    1831:	00 00                	add    %al,(%eax)
    1833:	00 98 03 01 00 00    	add    %bl,0x103(%eax)
	...

Posted: Sun Aug 06, 2006 5:06 am
by SpooK
Your video writing code is not making past 78 characters, do some internal tests on the value of your pointers (i.e. hard write "pos + off" on screen somewhere for each character written).

I would also suggest changing "if(pos == 80)" to "if(pos > 79)"... never assume things will work perfectly... that is when really nasty and annoying bugs start to pop up.