<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DaniWeb IT Discussion Community - Assembly</title>
		<link>http://www.daniweb.com/forums/</link>
		<description><![CDATA[Our Assembly forum is the place for Q&A-style discussions related to machine language. Discuss all flavors including x86 assembly, MIPS assembly, RISC assembly, etc. Note that we also have a Computer Science forum within the Software Development category.]]></description>
		<language>en-US</language>
		<lastBuildDate>Sun, 08 Nov 2009 05:04:29 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.daniweb.com/alphaimages/misc/rss.jpg</url>
			<title>DaniWeb IT Discussion Community - Assembly</title>
			<link>http://www.daniweb.com/forums/</link>
		</image>
		<item>
			<title>Trying to analyse code</title>
			<link>http://www.daniweb.com/forums/thread236906.html</link>
			<pubDate>Sun, 08 Nov 2009 01:23:00 GMT</pubDate>
			<description><![CDATA[This is an example program that I am studying so that i can make my own mixed mode assembly/C program. 
 
I am having trouble understanding on the assembly code, why I have to push SI twice at different times and only pop it out once.  Also why push and pop DI when it's not used.  I am confused...]]></description>
			<content:encoded><![CDATA[<div>This is an example program that I am studying so that i can make my own mixed mode assembly/C program.<br />
<br />
I am having trouble understanding on the assembly code, why I have to push SI twice at different times and only pop it out once.  Also why push and pop DI when it's not used.  I am confused from when I have push SI the second time.<br />
<br />
/* An example to illustrate       C function  -&gt; assembly -&gt; a C function. <br />
     This program calls the assembly language procedure in file MARKS_A.ASM. <br />
     The program outputs min,  max, and rounded average of two marks. */    <br />
 <br />
  <pre style="margin:20px; line-height:13px"> #include &lt;stdio.h&gt;<br />
&nbsp;int main(void)<br />
&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  int mark1,mark2, min, max, av;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  int find_avg(int, int);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extern&nbsp; void stats(int, int, int*, int*, int*);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scanf(&quot;%d%d&quot;,&amp;mark1,&amp;mark2);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stats(mark1,mark2, &amp;min, &amp;max, &amp;av);<br />
&nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;Min = %d, Max = %d, Av = %d\n&quot;, min, max, av);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0;&nbsp;  }<br />
<br />
<br />
&nbsp; /*********************************************************<br />
&nbsp; &nbsp;  * Returns the rounded average required by the assembly <br />
&nbsp; &nbsp; * procedure STATS in file MARKS_A.ASM.*/<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; int find_avg(int total, int number)&nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return((int)((double)total/number + 0.5)); }</pre><br />
 <pre style="margin:20px; line-height:13px">;----------- --------- --------- --------- --------- --------- -­<br />
; Assembly program example to show call to a C function.<br />
; This procedure receives a marks array and class size<br />
; and returns minimum, maximum, and rounded average marks.<br />
;----------- --------- --------- --------- --------- --------- -­<br />
.MODEL SMALL<br />
EXTRN _find_avg:PROC<br />
.CODE<br />
PUBLIC _stats<br />
_stats PROC <br />
push BP<br />
mov BP,SP<br />
push SI<br />
push DI<br />
<br />
<br />
mov AX,[BP+4] ; AX := mark1<br />
mov DX,[BP+6] ; DX := mark2<br />
cmp AX,DX ; put min into AX and max into DX<br />
jl next<br />
xchg AX,DX<br />
next:<br />
: mov SI,AX ; SI gets sum<br />
add SI,DX<br />
<br />
mov BX,[BP+8] ; return minimum<br />
mov [BX],AX<br />
mov BX,[BP+10] ; return maximum<br />
mov [BX],DX <br />
<br />
; now call find_avg C function to compute average<br />
<br />
mov AX,2 ;push number of marks<br />
push AX<br />
push SI ;push sum of marks<br />
call _find_avg ; returns average in AX<br />
add SP,4 ; clear stack<br />
mov BX,[BP+12] ; return average<br />
mov [BX],AX <br />
pop DI<br />
pop SI<br />
pop BP<br />
ret ; NOTE calling program clears stack<br />
_stats ENDP<br />
END</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>bees1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236906.html</guid>
		</item>
		<item>
			<title>Need help in factorial code</title>
			<link>http://www.daniweb.com/forums/thread236763.html</link>
			<pubDate>Sat, 07 Nov 2009 10:53:33 GMT</pubDate>
			<description>; this code gereates maximum factorial of 8 decimal 
; since, A is a 16-bit register and can hold max value of ;65535 dec (255h). 
; 
 
MOV A,#8d     		; value for the factorial (1-8max) 
MOV B,A				; B=A 
MOV C,#1d			; C=1	 
here:				; LOOP 
	SUB B,C			; B-1 
	MUL AB			; AxB</description>
			<content:encoded><![CDATA[<div>; this code gereates maximum factorial of 8 decimal<br />
; since, A is a 16-bit register and can hold max value of ;65535 dec (255h).<br />
;<br />
<br />
MOV A,#8d     		; value for the factorial (1-8max)<br />
MOV B,A				; B=A<br />
MOV C,#1d			; C=1	<br />
here:				; LOOP<br />
	SUB B,C			; B-1<br />
	MUL AB			; AxB<br />
	CMP B,C 		;if B=1<br />
	JNE here		;jump back<br />
<br />
END<br />
<br />
this code not work .please help me in thi and this also not work for lager values.(i have to take factorial of numbers 1 to 12)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>surfer2009</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236763.html</guid>
		</item>
		<item>
			<title>x86 help with procedures</title>
			<link>http://www.daniweb.com/forums/thread236754.html</link>
			<pubDate>Sat, 07 Nov 2009 09:39:18 GMT</pubDate>
			<description>I am having a hard time getting my program to execute correctly. it is supposed to take two numbers entered by the user store them in an array, and reverse the array so when added they display correctly.  i am to get the numbers using a procedure two seperate times, and reverse the arrays three...</description>
			<content:encoded><![CDATA[<div>I am having a hard time getting my program to execute correctly. it is supposed to take two numbers entered by the user store them in an array, and reverse the array so when added they display correctly.  i am to get the numbers using a procedure two seperate times, and reverse the arrays three times (reverse each entered number, and the sum array). furthermore when the user has entered one more than the max number of keys a + or = sign is to be entered for them. eg. i have the computer program set to take 3 numbers for each array so when the user enters a fourth a + or = sign should automatically appear. I cannot get the program to do this, or go any farther. I was hoping someone could let me know where i am going wrong with my code.<br />
<br />
here it is:<br />
<br />
 <pre style="margin:20px; line-height:13px"><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  BOZOS_CODE SEGMENT&nbsp; &nbsp; ;The &quot;logical&quot; segment is named BOZOS_CODE<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ASSUME CS:BOZOS_CODE&nbsp;  ;The &quot;assume&quot; statement tells the assembler<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; that BOZOS_CODE is a code segment (CS)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ORG 100h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;In case we decide to convert the program<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; to a COM file (makes 256 &quot;empty&quot; locations)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  START: jmp begin&nbsp; &nbsp; &nbsp; ;Since this is a code segment the first non-<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; directive item must be an instruction. We<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; jump around our data area<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_of_bytes EQU 3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; first_num db num_of_bytes dup (0), '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; second_num db num_of_bytes dup (0), '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the_sum db num_of_bytes + 1 dup (0), '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message_1 db 'Enter the first multi-digit number (up to 12 digits in length) followed by a'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db '&quot;+&quot; symbol then enter a second multi-digit number (up to 12 digits in '<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db&nbsp; &nbsp; &nbsp; &nbsp; 'length) followed by a &quot;=&quot; symbol&nbsp; $'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; key_stroke db 'x$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; operand db 'x$'<br />
<br />
<br />
<br />
GET_NUM:&nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 00h&nbsp; &nbsp; ;Read keyboard function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  int 16h&nbsp; &nbsp; &nbsp; &nbsp; ;Call BIOS (return occurs when key is pressed)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;AL now contains the ASCII code of key pressed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov key_stroke, al<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 09h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Display string function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov dx, offset key_stroke&nbsp; ;Pass the starting address of string<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  int 21h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Call DOS<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov al, key_stroke<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  cmp al, cl&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  jne continue<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
<br />
continue:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  and al, 0fh<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov [BX], al<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  inc BX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  cmp [bx], ch<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  jbe get_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov operand, cl<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 09h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Display string function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov dx, offset operand&nbsp; &nbsp; &nbsp;  ;Pass the starting address of string<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  int 21h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Call DOS<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
<br />
REV_NUM:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov cl, [bx]<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ch, [di]<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov [di], cl<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov [bx], ch<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  dec BX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  inc di<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  cmp di, bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  jae rev_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ret<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
begin:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ax, cs&nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ds, ax&nbsp; &nbsp;  <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov cl, 0&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 06h&nbsp; &nbsp; ;Scroll-up window function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov al, 0&nbsp; &nbsp; &nbsp; ; Clear entire window<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov bh, 1ch&nbsp; &nbsp; ; Display &quot;attribute byte&quot; for cleared area<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; Blue background/Red characters<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; Bit definitions: Blink|Background R,G,B|<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Intensity|Character R,G,B<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ch, 0&nbsp; &nbsp; &nbsp; ; Y = 0&nbsp; &nbsp;  (Corner coordinates of window<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov cl, 0&nbsp; &nbsp; &nbsp; ; X = 0&nbsp; &nbsp; &nbsp; to clear)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dh, 24&nbsp; &nbsp;  ; Y = 24&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dl, 85&nbsp; &nbsp;  ; X = 79&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 10h&nbsp; &nbsp; &nbsp; &nbsp; ;Call BIOS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 02h&nbsp; &nbsp; ;Set cursor position function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov bh, 0&nbsp; &nbsp; &nbsp; ; Display page 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov dh, 0&nbsp; &nbsp; &nbsp; ; Y position&nbsp; 25 rows&nbsp; &nbsp; (Y: 0 -&gt; 24)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov dl, 0&nbsp; &nbsp; &nbsp; ; X position&nbsp; 80 columns (X: 0 -&gt; 79)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  int 10h&nbsp; &nbsp; &nbsp; &nbsp; ;Call BIOS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 09h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Display string function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov dx, offset message_1 ;Pass the starting offset of the<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; string to be displayed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; (the string to be displayed starts <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; at the label message (in the data<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; area) and ends with a '$')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;Note: DS must point to the beginning<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; of the segment containing the<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; string to be displayed, e.g.,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; mov ax, cs&nbsp; (usually done at<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; mov ds, ax&nbsp;  the beginning of<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  the program)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;Note: This display procedure updates<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; the cursor position as each<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; character is displayed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  int 21h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Call DOS<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov bx, offset first_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov cl, '+'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ch, num_of_bytes<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  call get_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov bx, offset second_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov cl, '='<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ch, num_of_bytes&nbsp; &nbsp; &nbsp;  ;do i need to do this again?<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  call get_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov di, offset first_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  call rev_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov di, offset second_num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  call rev_num<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov BX, 0&nbsp;  ;Index set to zero now<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 0&nbsp;  ;ah now used for carry, and is set to zero<br />
<br />
adder:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov al, first_num[BX]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  add al, second_num[BX]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  add al, ah<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  cmp al, 9<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  jbe no_carry<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 1 <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  sub al, 10<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  jmp make_ascii<br />
<br />
no_carry:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
make_ascii:&nbsp; &nbsp; &nbsp; &nbsp;  or al, 30h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov the_sum[BX], al<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  inc BX<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  cmp BX, num_of_bytes <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  je fix_carry&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; if array is full jump to fix carry character<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jmp adder<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
fix_carry:&nbsp; &nbsp; &nbsp; &nbsp;  or ah, 30h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov the_sum[BX], ah<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov bx, num_of_bytes - 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov di, offset the_sum<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  call rev_num <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;to display sum<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
display:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 09h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Display string function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov dx, offset the_sum&nbsp; &nbsp;  ;Pass the starting address of string<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  int 21h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Call DOS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;To exit to DOS<br />
<br />
exit:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  mov ah, 4ch&nbsp; &nbsp; ;Exit to DOS function<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov al, 0&nbsp; &nbsp; &nbsp; ;ERRORLEVEL = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h&nbsp; &nbsp; &nbsp; &nbsp; ;Call DOS<br />
<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  BOZOS_CODE ENDS<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  END START&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;You MUST have a carriage return after START</pre><br />
thank you</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>RobBrown</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236754.html</guid>
		</item>
		<item>
			<title>int 21h/ah=09h string output</title>
			<link>http://www.daniweb.com/forums/thread236650.html</link>
			<pubDate>Fri, 06 Nov 2009 22:50:10 GMT</pubDate>
			<description><![CDATA[im using fasm (flat assembler 1.68), and im trying to output a string with int21h/ah=09h 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with...]]></description>
			<content:encoded><![CDATA[<div>im using fasm (flat assembler 1.68), and im trying to output a string with int21h/ah=09h<br />
<br />
 <pre style="margin:20px; line-height:13px">jmp main<br />
msg db &quot;hello world$&quot;<br />
main:<br />
mov dx, msg<br />
mov ah, 09<br />
int 21h</pre><br />
this code outputs &quot;hello world&quot;, but it outputs some control characters before it ([SOME WEIRD CONTROL CHARACTERS]hello world)<br />
<br />
so how can i fix this?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>brando|away</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236650.html</guid>
		</item>
		<item>
			<title>Making a File Compressor. Need Help</title>
			<link>http://www.daniweb.com/forums/thread236499.html</link>
			<pubDate>Fri, 06 Nov 2009 07:03:58 GMT</pubDate>
			<description>Here is the deal. I am writing a program in assembly that compresses and decompresses text based files. The user should be able to input a text file, and declare the name of what that file should be name when turned into a .drl file (just a random extension for my prog). 
 
Right now I am working...</description>
			<content:encoded><![CDATA[<div>Here is the deal. I am writing a program in assembly that compresses and decompresses text based files. The user should be able to input a text file, and declare the name of what that file should be name when turned into a .drl file (just a random extension for my prog).<br />
<br />
Right now I am working on reading the file to be compressed. First off I am reading the file one byte at a time and looking for &quot; &quot;(the space character). I want to search the text files for &quot; word&quot; and replace each instance of that word preceded with a space with a &quot;key.&quot; This key will be designed using Huffman's Algorithm.<br />
<br />
Anyways I want to read the character and as long as its not null, append it to the end of a string. How do I do that?(might be simple, but I'm not seeing it)<br />
<br />
Next, how do I read from the file one byte prior to where I finished. Meaning: if I read a space and stop the read(because its the start of a new word) how do I re-read that space to add it to the word next time around?<br />
<br />
Those are all the questions I am at the point of asking right now, but as I have seen plenty of times before, you guys are pretty strict on not giving out help on homework without effort shown. So here is my incomplete code. Feel free to make any and all helpful criticism.<br />
<br />
Thank You. <br />
<br />
 <pre style="margin:20px; line-height:13px">Include Irvine32.inc&nbsp; ;includes Master Irvine's Library<br />
<br />
.data<br />
message1 BYTE &quot;Please type the file name of the file to be compressed&quot;,0&nbsp; &nbsp;  ;initiates the variable message1 and assigns it &quot;Please type the file name of the file to be compressed&quot;, 0<br />
message2 BYTE &quot;Please type the filename to save the compression to(must end in .drl):&quot;,0&nbsp; &nbsp; &nbsp;  ;initiates the variable message2 and assigns it &quot;Please type the filename to save the compression to:&quot;, 0<br />
message3 BYTE &quot;Cannot compress an empty file!&quot;,0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;initiates the variable message3 and assigns it &quot;Cannot compress and empty file&quot;, 0<br />
message4 BYTE &quot;Please select one of the options:&quot;,0dh, 0Ah,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;1. Compress a file&quot;,0dh,0ah,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;2. DeCompress a file&quot;,0dh,0ah,0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;initiates the variable message4 and assigns it &quot;PLease select one 1. Compress 2. DeCompress&quot;, 0<br />
message5 BYTE &quot;Please type the file name of the file to be DeCompressed(must be a .drl file):&quot;,0&nbsp; &nbsp;  ;initiates the variable message1 and assigns it &quot;Please type the file name of the file to be Decompressed&quot;, 0<br />
message6 BYTE &quot;Please type the filename to save the DeCompressed File to:&quot;,0&nbsp; &nbsp; &nbsp;  ;initiates the variable message2 and assigns it &quot;Please type the filename to save the DeCompression to:&quot;, 0<br />
handle1 DWORD ?&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Uninitialized variable for handle1<br />
handle2 DWORD ?&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Uninitialized variable for handle2<br />
BUFFER_SIZE = 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;sets buffer size to 1<br />
buffer BYTE BUFFER_SIZE DUP(0)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Duplicates buffer to buffer size and sets to 0<br />
bytesRead DWORD ?&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Unintialized variable for bytesread<br />
bytesWritten DWORD ?&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Unintialized variable for byteswritten<br />
sourceFile BYTE 20 DUP(0),0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;initiates the variable for the sourceFile<br />
destinationFile BYTE 20 DUP(0),0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;initiates the variable for the destinationFile<br />
<br />
.code<br />
main PROC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of main proc<br />
call ShowPrompt&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls showprompt proc<br />
call checkForEmptyFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls checkforemptyfile proc<br />
call getFileHandles&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls getfilehandles proc<br />
call ReadFromFile1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls read from file1 proc<br />
call closeFiles&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls the closeFiles proc<br />
exit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;properly exits<br />
main ENDP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;end of main proc<br />
<br />
;--------------------------------------------------------------------------------------------------------------;<br />
showPrompt PROC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of showPrompt proc<br />
L1:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;loop one<br />
mov edx, OFFSET message4&nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message 4 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;displays message4<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
call ReadChar&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;reads user input of a char<br />
cmp al, &quot;1&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;compares input to the char '1'<br />
je Compress&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;if equal then jump to Compress<br />
cmp al, &quot;2&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;compares user input to the char '2'<br />
je DeCompress&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;if equal then jump to DeCompress<br />
jmp L1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;start loop over again if neither '1' nor '2'<br />
<br />
Compress:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of Compress label<br />
mov edx, OFFSET message1&nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message1 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;displays message1<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
mov edx, OFFSET sourceFile&nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of sourceFile into edx<br />
mov ecx, SIZEOF sourceFile&nbsp; &nbsp; &nbsp; &nbsp; ;moves the sizeOf sourceFile into ecx<br />
call ReadString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;reads the user input of a string<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
Compressb:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;destination<br />
mov edx, OFFSET message2&nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message2 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;displays message2<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
mov edx, OFFSET destinationFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of destinationFile into edx<br />
mov ecx, SIZEOF destinationFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the sizeOf destinationFile into ecx<br />
call ReadString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;reads the user input of a string<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
<br />
mov edi, OFFSET destinationFile<br />
mov eax, &quot;.drl&quot;<br />
mov ecx, SIZEOF destinationFile<br />
cld<br />
repne scasb<br />
jnz Compressb<br />
dec edi<br />
ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
<br />
DeCompress:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of DeCompress Label<br />
mov edx, OFFSET message5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message5 into ex<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;displays message5<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
mov edx, OFFSET sourceFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of sourceFile into edx<br />
mov ecx, SIZEOF sourceFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the sizeOf sourceFile into ecx<br />
call ReadString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;reads the user input of a string<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
<br />
mov edi, OFFSET sourceFile<br />
mov eax, &quot;.drl&quot;<br />
mov ecx, SIZEOF sourceFile<br />
cld<br />
repne scasb<br />
jnz DeCompress<br />
dec edi<br />
<br />
mov edx, OFFSET message6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message6 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;displays message6<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
mov edx, OFFSET destinationFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of destinationFile into edx<br />
mov ecx, SIZEOF destinationFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the sizeOf destinationFile into ecx<br />
call ReadString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;reads the user input of a string<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
showPrompt ENDP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;end of ShowPrompt proc<br />
<br />
;--------------------------------------------------------------------------------------------------------------;<br />
checkForEmptyFile PROC<br />
mov edx, OFFSET sourceFIle&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; moves the offset of sourceFile into edx<br />
call OpenInputFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; calls openinputfile proc<br />
cmp eax, INVALID_HANDLE_VALUE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check validity of file handle<br />
je Quit2<br />
mov handle3, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;jumps to quit label if invalid<br />
mov edx, OFFSET buffer&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of buffer into edx<br />
mov ecx, BUFFER_SIZE<br />
mov eax, handle3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the buffer_Size into ecx<br />
call ReadFromFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls ReadFromFile<br />
mov bytesRead, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;move eax into bytesRead<br />
cmp eax, 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;compare eax to 0<br />
je QUIT&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;if eax=0 then jump to quit<br />
mov eax, handle3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
call Closefile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls closeFiles proc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
<br />
QUIT:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of QUIT label<br />
mov edx, OFFSET message9&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message9 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;displays message9&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
exit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;properly exits<br />
<br />
QUIT2:<br />
mov edx, OFFSET message6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message6 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls writestring<br />
exit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;exits<br />
checkForEmptyFile ENDP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;end of checkForEmptyFile proc<br />
<br />
;--------------------------------------------------------------------------------------------------------------;<br />
getFileHandles PROC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of getfilehandles proc<br />
mov edx, OFFSET sourceFIle&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; moves the offset of sourceFile into edx<br />
call OpenInputFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; calls openinputfile proc<br />
cmp eax, INVALID_HANDLE_VALUE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check validity of file handle<br />
je Quit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;jumps to quit label if invalid<br />
mov handle1, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves eax into handle1<br />
mov edx, OFFSET destinationFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of the destination file into edx<br />
call CreateOutputFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls the CreatOutputFile proc<br />
cmp eax, INVALID_HANDLE_VALUE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check validity of file handle<br />
je Quit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;jumps to quit label if invalid<br />
mov handle2, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves eax into handle2<br />
ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
<br />
QUIT:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of quit label<br />
mov edx, OFFSET message6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message6 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;writes edx<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
call main&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;calls main proc<br />
getFileHandles ENDP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;end of getFileHandles Proc<br />
<br />
;--------------------------------------------------------------------------------------------------------------;<br />
readFromFile1 PROC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;begining of readFromfile1 proc<br />
Read:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of read label<br />
mov eax, handle1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves handle1 into eax<br />
mov edx, OFFSET buffer&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; moves the offset of the buffer into edx<br />
mov ecx, BUFFER_SIZE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the buffer size into ecx<br />
First:<br />
call ReadFromFile<br />
cmp eax, 0<br />
je Quit2<br />
cmp eax, &quot; &quot;<br />
je Next<br />
<br />
<br />
jmp New<br />
NEXT:<br />
mov bytesread, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the data into bytesread<br />
New:<br />
call ReadFromFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;reads data from file<br />
cmp eax, 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;compares eax to 0<br />
je Quit2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;if eax = 0 then jump to Quit2<br />
cmp eax, &quot; &quot;<br />
jne NEXT<br />
push eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;push eax onto stack<br />
<br />
pop eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;pops eax off stack<br />
cmp eax, 5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;compares eax to 5<br />
jb Quit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;jump to quit if carry<br />
call clear&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
jmp Read&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;jump back to Read<br />
<br />
Quit:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of Quit label<br />
call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;new line<br />
mov edx, OFFSET message8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves the offset of message8 into edx<br />
call WriteString&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;displays message8<br />
ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
<br />
<br />
Quit2:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of Quit2 label<br />
ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
readFromFile1 ENDP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;end of readFromFile1 proc<br />
<br />
;--------------------------------------------------------------------------------------------------------------;<br />
closeFiles PROC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;beginning of closeFiles proc<br />
mov eax, handle1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves handle1 into eax<br />
call CloseFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;closes the file<br />
mov eax, handle2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves handle2 into eax<br />
call CloseFile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;close the file<br />
ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;return<br />
closeFiles ENDP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;end of the closeFiles proc</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>leftovas17</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236499.html</guid>
		</item>
		<item>
			<title>Noob looking for guidance</title>
			<link>http://www.daniweb.com/forums/thread236465.html</link>
			<pubDate>Fri, 06 Nov 2009 04:01:02 GMT</pubDate>
			<description><![CDATA[Hi, I was using C++ to try to write objects to the screen, and decided to try this in a lower level language. I have searched the web and found some sample code: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>Hi, I was using C++ to try to write objects to the screen, and decided to try this in a lower level language. I have searched the web and found some sample code:<br />
<br />
 <pre style="margin:20px; line-height:13px">name &quot;vga&quot;<br />
<br />
; this program draws a tiny rectangle in vga mode. <br />
<br />
org&nbsp; 100h<br />
<br />
jmp code<br />
<br />
; dimensions of the rectangle: <br />
; width: 10 pixels <br />
; height: 5 pixels <br />
<br />
w equ 10<br />
h equ 5<br />
<br />
<br />
; set video mode 13h - 320x200 <br />
<br />
code:&nbsp;  mov ah, 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov al, 13h<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 10h<br />
<br />
<br />
; draw upper line: <br />
<br />
&nbsp; &nbsp; mov cx, 100+w&nbsp; ; column <br />
&nbsp; &nbsp; mov dx, 20&nbsp; &nbsp;  ; row <br />
&nbsp; &nbsp; mov al, 15&nbsp; &nbsp;  ; white <br />
u1: mov ah, 0ch&nbsp; &nbsp; ; put pixel <br />
&nbsp; &nbsp; int 10h<br />
<br />
&nbsp; &nbsp; dec cx<br />
&nbsp; &nbsp; cmp cx, 100<br />
&nbsp; &nbsp; jae u1<br />
<br />
; draw bottom line: <br />
<br />
&nbsp; &nbsp; mov cx, 100+w&nbsp; ; column <br />
&nbsp; &nbsp; mov dx, 20+h&nbsp;  ; row <br />
&nbsp; &nbsp; mov al, 15&nbsp; &nbsp;  ; white <br />
u2: mov ah, 0ch&nbsp; &nbsp; ; put pixel <br />
&nbsp; &nbsp; int 10h<br />
<br />
&nbsp; &nbsp; dec cx<br />
&nbsp; &nbsp; cmp cx, 100<br />
&nbsp; &nbsp; ja u2<br />
<br />
; draw left line: <br />
<br />
&nbsp; &nbsp; mov cx, 100&nbsp; &nbsp; ; column <br />
&nbsp; &nbsp; mov dx, 20+h&nbsp;  ; row <br />
&nbsp; &nbsp; mov al, 15&nbsp; &nbsp;  ; white <br />
u3: mov ah, 0ch&nbsp; &nbsp; ; put pixel <br />
&nbsp; &nbsp; int 10h<br />
<br />
&nbsp; &nbsp; dec dx<br />
&nbsp; &nbsp; cmp dx, 20<br />
&nbsp; &nbsp; ja u3<br />
<br />
<br />
; draw right line: <br />
<br />
&nbsp; &nbsp; mov cx, 100+w&nbsp; ; column <br />
&nbsp; &nbsp; mov dx, 20+h&nbsp;  ; row <br />
&nbsp; &nbsp; mov al, 15&nbsp; &nbsp;  ; white <br />
u4: mov ah, 0ch&nbsp; &nbsp; ; put pixel <br />
&nbsp; &nbsp; int 10h<br />
<br />
&nbsp; &nbsp; dec dx<br />
&nbsp; &nbsp; cmp dx, 20<br />
&nbsp; &nbsp; ja u4<br />
<br />
<br />
; pause the screen for dos compatibility: <br />
<br />
;wait for keypress <br />
&nbsp; mov ah,00<br />
&nbsp; int 16h<br />
<br />
; return to text mode: <br />
&nbsp; mov ah,00<br />
&nbsp; mov al,03 ;text mode 3 <br />
&nbsp; int 10h<br />
<br />
ret</pre>Again, I did not write this, I found it at <a rel="nofollow" class="t" href="http://www.emu8086.com/dr/asm2html/assembler_source_code/0_sample_vga_graphics.asm.html" target="_blank">http://www.emu8086.com/dr/asm2html/a...phics.asm.html</a><br />
<br />
My question is how would I go about compiling said code?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>dylank</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236465.html</guid>
		</item>
		<item>
			<title>Use string to call variable</title>
			<link>http://www.daniweb.com/forums/thread236463.html</link>
			<pubDate>Fri, 06 Nov 2009 03:54:45 GMT</pubDate>
			<description><![CDATA[I am looking to use a string to call a variable in assembly 
 
I have the following: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code...]]></description>
			<content:encoded><![CDATA[<div>I am looking to use a string to call a variable in assembly<br />
<br />
I have the following:<br />
<br />
 <pre style="margin:20px; line-height:13px">msg_0&nbsp; &nbsp; &nbsp; db&nbsp;  &quot;Random phrase&quot;,10,0<br />
msg_1&nbsp; &nbsp; &nbsp; db&nbsp;  &quot;Another Random Phrase&quot;,10<br />
...(more messages)<br />
msg_11&nbsp; &nbsp; db&nbsp; &quot;Final Random Message&quot;,10,0 <br />
msgIndex db&nbsp; &quot;msg_%d&quot;,0</pre>then have the program push msgIndex and a random number to print one of the messages.<br />
<br />
Is there a way that I can do this?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>fitztho</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236463.html</guid>
		</item>
		<item>
			<title>C and Assembly Mixed-Mode Hex comparison program</title>
			<link>http://www.daniweb.com/forums/thread236336.html</link>
			<pubDate>Thu, 05 Nov 2009 18:02:20 GMT</pubDate>
			<description>Hi, I have an assignment where i have to write a C and assembly mixed-mode program.  
1. The c program takes in two characters which stand for two hex characters. 
2. The assembly procedure then passes each character in turn to a C function which determines if the character is a valid ASCII HEX...</description>
			<content:encoded><![CDATA[<div>Hi, I have an assignment where i have to write a C and assembly mixed-mode program. <ol style="list-style-type: decimal"><li>The c program takes in two characters which stand for two hex characters.</li>
<li>The assembly procedure then passes each character in turn to a C function which determines if the character is a valid ASCII HEX digit (namely 0-F).</li>
<li>If both characters are valid the assembly language procedure then compares the two HEX digits and returns the larger to the main program.</li>
<li>The main C program then prints out the larger digit.</li>
</ol><br />
I am unsure how to do no. 2, namely, how to determine if it's a valid ASCII HEX digit or just garbage. Suggestions?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>HypnotiqBIG</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236336.html</guid>
		</item>
		<item>
			<title>Detect Multicore processors</title>
			<link>http://www.daniweb.com/forums/thread236333.html</link>
			<pubDate>Thu, 05 Nov 2009 17:35:30 GMT</pubDate>
			<description><![CDATA[Hey everyone, 
 
For my project, I need to write an assembly/C code to detect multiprocessors. I really have no idea how as I have barely done assembly coding and I have no good reference or even idea how to start. Again, what I am going to do is, I'm trying to find how many processors on dual core...]]></description>
			<content:encoded><![CDATA[<div>Hey everyone,<br />
<br />
For my project, I need to write an assembly/C code to detect multiprocessors. I really have no idea how as I have barely done assembly coding and I have no good reference or even idea how to start. Again, what I am going to do is, I'm trying to find how many processors on dual core or quad core chips there are and detect them and later on use them. Please help me out here.<br />
<br />
Thanks a lot.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>group256</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236333.html</guid>
		</item>
		<item>
			<title>An os whith a menu.</title>
			<link>http://www.daniweb.com/forums/thread235873.html</link>
			<pubDate>Wed, 04 Nov 2009 06:52:25 GMT</pubDate>
			<description><![CDATA[hello people. I am doing an "os" (small) that's mainly a menu. It just prints some strings and highlights some words when you pres 1,2 or 3. And by pressing enter while a option is selected, it has to do something. 
The problem is that the program gets stuck in the beginning ... and i don't know...]]></description>
			<content:encoded><![CDATA[<div>hello people. I am doing an &quot;os&quot; (small) that's mainly a menu. It just prints some strings and highlights some words when you pres 1,2 or 3. And by pressing enter while a option is selected, it has to do something.<br />
The problem is that the program gets stuck in the beginning ... and i don't know where is the problem. Can't run a debug because it's a bootable bin file. Can some one please tell me where is the error?<br />
I'm using linux+ nasm<br />
 <pre style="margin:20px; line-height:13px">&#91;BITS 16&#93;&nbsp; &nbsp; &nbsp; <br />
jmp 07C0h:start<br />
&nbsp; &nbsp; &nbsp; &nbsp; snd&nbsp; &nbsp;  db&nbsp; 'Sound'<br />
&nbsp; &nbsp; &nbsp; &nbsp; lsnd&nbsp; &nbsp; &nbsp; &nbsp; equ&nbsp; &nbsp; &nbsp; &nbsp; $-snd<br />
&nbsp; &nbsp; &nbsp; &nbsp; abt&nbsp; &nbsp; &nbsp; &nbsp; db&nbsp; &nbsp; &nbsp; &nbsp; 'About'<br />
&nbsp; &nbsp; &nbsp; &nbsp; labt&nbsp; &nbsp; &nbsp; &nbsp; equ&nbsp; &nbsp; &nbsp; &nbsp; $-abt<br />
&nbsp; &nbsp; &nbsp; &nbsp; hlp&nbsp; &nbsp; &nbsp; &nbsp; db&nbsp; &nbsp; &nbsp; &nbsp; 'Help'<br />
&nbsp; &nbsp; &nbsp; &nbsp; lhlp&nbsp; &nbsp; &nbsp; &nbsp; equ&nbsp; &nbsp; &nbsp; &nbsp; $-hlp<br />
<br />
&nbsp; &nbsp; start:<br />
<br />
is1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; call init<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;print &quot;sound&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ax,1300h<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bh,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bl,2<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; cx,lsnd<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dx,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; push cs<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop es<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bp,snd<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 10h<br />
wait_:<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ah,00h<br />
&nbsp; &nbsp; &nbsp; &nbsp; int&nbsp; &nbsp; &nbsp; &nbsp; 16h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp&nbsp; &nbsp; &nbsp; &nbsp;  ah,13<br />
&nbsp; &nbsp; &nbsp; &nbsp; je&nbsp; &nbsp; &nbsp; &nbsp; make_sound<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp&nbsp; &nbsp; &nbsp; &nbsp; ah,49<br />
&nbsp; &nbsp; &nbsp; &nbsp; je&nbsp; &nbsp; &nbsp; &nbsp; is1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp&nbsp; &nbsp; &nbsp; &nbsp; ah,50<br />
&nbsp; &nbsp; &nbsp; &nbsp; je&nbsp; &nbsp; &nbsp; &nbsp; is2<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp&nbsp; &nbsp; &nbsp; &nbsp; ah,51<br />
&nbsp; &nbsp; &nbsp; &nbsp; je&nbsp; &nbsp; &nbsp; &nbsp; is3<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp&nbsp; &nbsp; &nbsp; &nbsp; wait_<br />
is2:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; call init<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;print &quot;About&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ax,1300h<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bh,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bl,2<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; cx,labt<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dl,5<br />
&nbsp; &nbsp; &nbsp; &nbsp; push cs<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop es<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bp,abt<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 10h<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp&nbsp; &nbsp; &nbsp; &nbsp; wait_<br />
<br />
is3:&nbsp; &nbsp; &nbsp; &nbsp; jmp&nbsp; &nbsp; &nbsp; &nbsp; wait_<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
make_sound:<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ax, 0E07h<br />
&nbsp; &nbsp; &nbsp; &nbsp; xor&nbsp; &nbsp; &nbsp; &nbsp; bx, bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; int&nbsp; &nbsp; &nbsp; &nbsp; 10h<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp&nbsp; &nbsp; &nbsp; &nbsp; wait_<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
init:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;print &quot;sound&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ax,1300h<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bh,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bl,5<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; cx,lsnd<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dx,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; push cs<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop es<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bp,snd<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 10h<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;print &quot;About&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ax,1300h<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bh,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; cx,labt<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dl,5<br />
&nbsp; &nbsp; &nbsp; &nbsp; push cs<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop es<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bp,abt<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 10h<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;print &quot;Help&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ax,1300h<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; bh,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; cx,lhlp<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dl,10<br />
&nbsp; &nbsp; &nbsp; &nbsp; push cs<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop es<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bp,hlp<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 10h<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<br />
<br />
<br />
&nbsp; &nbsp; times 510-($-$$) db 0<br />
&nbsp; &nbsp; dw 0AA55h</pre><br />
The attachment shows the result of the execution. To me, it looks like he executes <span style="font-style:italic">init</span> then <span style="font-style:italic">;print &quot;sound&quot;</span> then gets stuck. Maybe the function that i use to wait for a char isn't the right one?</div>  <br /> <div style="padding:5px">    <fieldset class="fieldset"> <legend>Attached Images</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/png.gif" alt="File Type: png" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=12447&amp;d=1257317869" target="_blank">Screenshot-1.png</a> (17.5 KB)</td> </tr> </table> </fieldset>   </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Alex_</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235873.html</guid>
		</item>
		<item>
			<title>Setting string colors in NASM</title>
			<link>http://www.daniweb.com/forums/thread235809.html</link>
			<pubDate>Wed, 04 Nov 2009 00:42:07 GMT</pubDate>
			<description><![CDATA[Hey all, I've been trying to get my int 10h to set the color for a STRING, not just a single character. 
 
Here's my code, i'm running windows XP and using NASM16 assembler. 
 
So, what I want it to do is display something like "Hello world", instead of just.. "a", etc. 
 
the macro:: 
 
  <div...]]></description>
			<content:encoded><![CDATA[<div>Hey all, I've been trying to get my int 10h to set the color for a STRING, not just a single character.<br />
<br />
Here's my code, i'm running windows XP and using NASM16 assembler.<br />
<br />
So, what I want it to do is display something like &quot;Hello world&quot;, instead of just.. &quot;a&quot;, etc.<br />
<br />
the macro::<br />
<br />
 <pre style="margin:20px; line-height:13px">%macro color 3<br />
mov cx,%1&nbsp; &nbsp; &nbsp; &nbsp;  ;CX value = amount of chars to print<br />
mov bl,%2&nbsp; &nbsp; &nbsp; &nbsp; ;BL value = HEXI color attr<br />
mov al,%3&nbsp; &nbsp; &nbsp; &nbsp; ;AL value = character to print<br />
mov ah,9&nbsp; &nbsp; &nbsp; &nbsp; ;Function 9, display char<br />
int 10h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Call the SCREEN vector<br />
<br />
%endmacro</pre><br />
<br />
the code::<br />
<br />
 <pre style="margin:20px; line-height:13px">[org 0100h]<br />
%include &quot;Library.asm&quot;<br />
<br />
[section .text]<br />
<br />
color 1,6ah,hello&nbsp; &nbsp;  ;Use library to attempt to display string<br />
string eol<br />
exit 0<br />
<br />
[section .data]<br />
hello db &quot;Hello, world.&quot;, 13, 10, &quot;$&quot;<br />
eol db 13, 10, &quot;$&quot;</pre><br />
Any help would be great, thanks.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Goalatio</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235809.html</guid>
		</item>
		<item>
			<title>Needing some guidance</title>
			<link>http://www.daniweb.com/forums/thread235715.html</link>
			<pubDate>Tue, 03 Nov 2009 18:06:28 GMT</pubDate>
			<description><![CDATA[To be upfront and all, this is indeed a homework assignment. But I'm not looking for anyone to write the code I need just help me with a few functions I'm needing to use (the book is VERY vague on how to use these instructions). 
 
Assignment is open an encrypted file, decrypt it and then send it...]]></description>
			<content:encoded><![CDATA[<div>To be upfront and all, this is indeed a homework assignment. But I'm not looking for anyone to write the code I need just help me with a few functions I'm needing to use (the book is VERY vague on how to use these instructions).<br />
<br />
Assignment is open an encrypted file, decrypt it and then send it to a new text file.<br />
<br />
Ok so far I have this<br />
<br />
 <pre style="margin:20px; line-height:13px">.data<br />
BUFFER_SIZE = 5000<br />
buffer BYTE BUFFER_SIZE DUP(?)<br />
filename BYTE &quot;myfile.txt&quot;,0 (this is coming from my book)<br />
<br />
.code<br />
mov edx,OFFSET filename<br />
call OpenInputFile<br />
mov edx,OFFSET buffer<br />
mov ecx,BUFFER_SIZE<br />
call ReadFromFile<br />
call WriteToFile</pre><br />
As I said the book is extremly vague on how these instructions truly work. My question is what is the normal procedure to open a file, read it and then output it to a new file?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>RayvenHawk</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235715.html</guid>
		</item>
		<item>
			<title>Define Type of Assembly</title>
			<link>http://www.daniweb.com/forums/thread235607.html</link>
			<pubDate>Tue, 03 Nov 2009 10:14:24 GMT</pubDate>
			<description>Can anyone tell me what the assembly type for bottom assembly program? 
 
#DEFINE PAGE0   BCF $03,5 
#DEFINE PAGE1   BSF $03,5 
 
INDF:    .EQU $00  ;page 0, 1, 2, 3 
TMR0:    .EQU $01  ;page 0, 2 
OPTION:  .EQU $01  ;page 1, 3 
PCL:     .EQU $02  ;page 0, 1, 2, 3 
STATUS:  .EQU $03  ;page 0, 1, 2,...</description>
			<content:encoded><![CDATA[<div>Can anyone tell me what the assembly type for bottom assembly program?<br />
<br />
#DEFINE PAGE0   BCF $03,5<br />
#DEFINE PAGE1   BSF $03,5<br />
<br />
INDF:    .EQU $00  ;page 0, 1, 2, 3<br />
TMR0:    .EQU $01  ;page 0, 2<br />
OPTION:  .EQU $01  ;page 1, 3<br />
PCL:     .EQU $02  ;page 0, 1, 2, 3<br />
STATUS:  .EQU $03  ;page 0, 1, 2, 3<br />
FSR:     .EQU $04  ;page 0, 1, 2, 3<br />
<br />
PORTA:   .EQU $05  ;page 0<br />
TRISA:   .EQU $05  ;page 1<br />
PORTB:   .EQU $06  ;page 0, 2<br />
TRISB:   .EQU $06  ;page 1, 3<br />
PORTC:   .EQU $07  ;page 0<br />
TRISC:   .EQU $07  ;page 1<br />
PORTD:   .EQU $08  ;page 0<br />
TRISD:   .EQU $08  ;page 1<br />
PORTE:   .EQU $09  ;page 0<br />
TRISE:   .EQU $09  ;page 1<br />
<br />
INTCON:  .EQU $0B  ;page 0, 1, 2, 3<br />
ADCON0:  .EQU $1F  ;page 0<br />
ADCON1:  .EQU $1F  ;page 1<br />
<br />
LOOPA:   .EQU $20       ;loop used by LCD send routine<br />
LOOPB:   .EQU $21       ;general loop<br />
STORE:   .EQU $22       ;general store<br />
STORE1:  .EQU $23       ;general store<br />
STORE2:  .EQU $24       ;general store<br />
STORE3:  .EQU $25       ;general store<br />
RSLINE:  .EQU $26       ;LCD function flag store<br />
SWITCH:  .EQU $27       ;switch status store<br />
MARK1:   .EQU $28       ;freq count polarity marker 1<br />
MARK2:   .EQU $29       ;freq count polarity marker 2<br />
<br />
DEC1:    .EQU $2A       ;decimalisation byte 1<br />
DEC2:    .EQU $2B       ; byte 2<br />
DEC3:    .EQU $2C       ; byte 3<br />
DEC4:    .EQU $2D       ; byte 4<br />
DEC5:    .EQU $2E       ; byte 5<br />
DEC6:    .EQU $2F       ; byte 6 (dummy)      <br />
<br />
ANSA1:   .EQU $30       ;decimalisation answer store 1<br />
ANSA2:   .EQU $31       ; answer 2<br />
ANSA3:   .EQU $32       ; answer 3<br />
ANSA4:   .EQU $33       ; answer 4<br />
ANSA5:   .EQU $34       ; answer 5<br />
<br />
FREQ0:   .EQU $35       ;frequency counter lsb<br />
FREQ1:   .EQU $36       ;frequency counter nsb<br />
FREQ2:   .EQU $37       ;frequency counter nsb<br />
FREQ3:   .EQU $38       ;frequency counter nsb<br />
FREQ4:   .EQU $39       ;frequency counter msb<br />
CLKCNT:  .EQU $3A       ;timing counter<br />
SLOWIT:  .EQU $3B       ;delay factor for PAUSE<br />
LOOPX:   .EQU $3C       ;delay loop for LCDOUT<br />
<br />
OUT7:    .EQU $3D       ;8 bytes for freq store and output to LCD<br />
OUT6:    .EQU $3E<br />
OUT5:    .EQU $3F<br />
OUT4:    .EQU $40<br />
OUT3:    .EQU $41<br />
OUT2:    .EQU $42<br />
OUT1:    .EQU $43<br />
OUT0:    .EQU $44<br />
LCDSTOR1: .EQU $45<br />
LCDSTOR2: .EQU $46<br />
STOREC:   .EQU $47<br />
STORED:   .EQU $48<br />
TENFLG:   .EQU $49<br />
TENCNT:   .EQU $4A<br />
RANGE:    .EQU $4B      ;frequency cap selection<br />
SHAPE:    .EQU $4C      ;waveform shape selection<br />
SAMPLE:   .EQU $4D      ;1sec/10sec flag<br />
CLKVAL1:  .EQU $4E<br />
CLKVAL2:  .EQU $4F<br />
<br />
                    ;extends to $7F (max limit)<br />
<br />
W:       .EQU 0<br />
F:       .EQU 1<br />
C:       .EQU 0<br />
DC:      .EQU 1<br />
Z:       .EQU 2<br />
<br />
RP0:     .EQU 5         ;STATUS reg<br />
RP1:     .EQU 6         ;STATUS reg<br />
GIE:     .EQU 7         ;INTCON reg<br />
<br />
<br />
        .ORG $0004      ;Interrupt vector address<br />
        GOTO START      ;Jump to interrupt routine on interrupt<br />
        .ORG $0005      ;Start of program memory<br />
<br />
        clrf INTCON<br />
<br />
GIEOFF: BCF INTCON,GIE  ;turn off global interrupts<br />
        BTFSC INTCON,GIE<br />
        goto GIEOFF<br />
<br />
        goto START<br />
<br />
TABLCD: addwf PCL,F     ;LCD initialisation table<br />
        retlw %00110011 ;initialise lcd - first byte<br />
        retlw %00110011 ;2nd byte (repeat of first)<br />
        retlw %00110010 ;set for 4-bit operation<br />
        retlw %00101100 ;set for 2 lines<br />
        retlw %00000110 ;set entry mode to increment each address<br />
        retlw %00001100 ;set display on, cursor off, blink off<br />
        retlw %00000001 ;clear display<br />
        retlw %00000010 ;return home, cursor &amp; RAM to zero<br />
                        ;end initialisation table<br />
<br />
TBDEC1:                 ;table for decimalisation lsb<br />
        addwf PCL,F     ;add program counter<br />
        retlw $10       ;lsb of 10000<br />
        retlw $E8       ;lsb of 1000<br />
        retlw $64       ;lsb of 100<br />
        retlw $0A       ;lsb of 10<br />
<br />
TBDEC2:                 ;table for decimalisation msb<br />
        addwf PCL,F     ;add program counter<br />
        retlw $27       ;msb of 10000<br />
        retlw $03       ;msb of 1000<br />
        retlw 0         ;msb of 100<br />
        retlw 0         ;msb of 10<br />
<br />
RANGIT: addwf PCL,F     ;range control vals<br />
        retlw %11111111<br />
        retlw %11111101<br />
        retlw %11111011<br />
        retlw %11110111<br />
        retlw %11101111<br />
        retlw %11011111<br />
        retlw %10111111<br />
        retlw %01111111<br />
<br />
WAVEIT: addwf PCL,F     ;waveform message routing<br />
        goto SQUARE<br />
        goto TRNGLE<br />
        goto SINE<br />
<br />
SINE:   movf LOOPA,W<br />
        addwf PCL,F     ;sine message route<br />
        retlw 'S'<br />
        retlw 'I'<br />
        retlw 'N'<br />
        retlw 'E'<br />
<br />
SQUARE: movf LOOPA,W<br />
        addwf PCL,F     ;square message route<br />
        retlw 'S'<br />
        retlw 'Q'<br />
        retlw 'R'<br />
        retlw ' '<br />
<br />
TRNGLE: movf LOOPA,W<br />
        addwf PCL,F     ;triangle message route<br />
        retlw 'T'<br />
        retlw 'R'<br />
        retlw 'I'<br />
        retlw ' '<br />
<br />
;..............<br />
<br />
START:  bcf STATUS,RP0<br />
        bcf STATUS,RP1<br />
        clrf PORTA<br />
        clrf PORTB<br />
        clrf PORTC<br />
        clrf PORTD<br />
        clrf PORTE<br />
        PAGE1<br />
        clrf TRISA          ;PORTA as output<br />
        movlw %00111111<br />
        movwf TRISB         ;PORTB as input<br />
        movlw 255<br />
        movwf TRISC         ;PORTC as input<br />
        movlw %11001111<br />
        movwf TRISD         ;RD0-RD3, RD6-RD7 as input, RD4-RD5 as output<br />
        movlw %00000111<br />
        movwf TRISE         ;PORTE as input<br />
        movlw %00000111     ;set LHS justify, RA0-RA3 as digital<br />
        movwf ADCON1<br />
        movlw %10000110     ;PORTB pullups off, timer 1:128 (1/25th sec)<br />
        movwf OPTION<br />
        PAGE0<br />
<br />
        call PAUSIT<br />
LCDSET: clrf LOOPB<br />
        clrf RSLINE<br />
LCDST2: movf LOOPB,W<br />
        call TABLCD<br />
        call LCDOUT<br />
        incf LOOPB,F<br />
        btfss LOOPB,3<br />
        goto LCDST2<br />
        call PAUSIT<br />
<br />
         clrf MARK2<br />
         clrf SWITCH<br />
         clrf FREQ0<br />
         clrf FREQ1<br />
         clrf FREQ2<br />
         clrf FREQ3<br />
         clrf FREQ4<br />
         clrf ANSA1<br />
         clrf ANSA2<br />
         clrf ANSA3<br />
         clrf ANSA4<br />
         clrf ANSA5<br />
         clrf DEC1<br />
         clrf DEC2<br />
         clrf DEC3<br />
         clrf DEC4<br />
         clrf DEC5<br />
         clrf DEC6<br />
         clrf TENFLG<br />
         clrf TENCNT<br />
         clrf MARK1<br />
         clrf MARK2<br />
         clrf RANGE<br />
         clrf SAMPLE<br />
         movlw 0               ;......2<br />
         movwf SHAPE<br />
         call WAVE1<br />
         movlw 25<br />
         movwf CLKVAL1<br />
         movlw 250<br />
         movwf CLKVAL2<br />
<br />
         movf CLKVAL1,W<br />
         movwf CLKCNT<br />
<br />
         bsf PORTD,4        ;reset counter IC6<br />
         bcf PORTD,4<br />
         bsf PORTD,5        ;enable clock input<br />
<br />
         movlw 4<br />
         movwf RANGE<br />
         bcf INTCON,2<br />
<br />
         goto SHWRNG<br />
<br />
;............................ END OF SETUP<br />
<br />
MAIN:    btfss INTCON,2<br />
         goto MF1<br />
         bcf INTCON,2<br />
<br />
         movf PORTE,W       ;is a range switch pressed?<br />
         btfss STATUS,Z<br />
         goto RANGESW       ;yes<br />
         btfsc PORTB,0      ;is waveshape switch pressed?<br />
         call WAVEFRM       ;yes<br />
         decfsz CLKCNT,F    ;dec timing counter, is it 0<br />
         goto MF1           ;no<br />
         goto GETFREQ       ;yes<br />
<br />
MF1:     call INCCNT<br />
         goto MAIN<br />
<br />
<br />
INCCNT:  btfss PORTC,0<br />
         goto MF2<br />
         bsf MARK2,0<br />
         return<br />
<br />
MF2:     btfss MARK2,0      ;is MARK2 = 1?<br />
         return             ;no<br />
         bcf MARK2,0<br />
         incfsz FREQ2,F     ;yes, inc counters accordingly<br />
         return             ;(responds to negative-going aspect of IC6 Q12)<br />
         incfsz FREQ3,F<br />
         return<br />
         incf FREQ4,F<br />
         return<br />
<br />
;............show freq routine<br />
<br />
GETFREQ: bcf PORTD,5        ;turn off clock input<br />
         nop<br />
         nop<br />
         call INCCNT        ;*****<br />
         movf PORTD,W       ;get pins which include Q0-Q3<br />
         movwf STORED<br />
         movf PORTC,W<br />
         movwf STOREC<br />
         bsf PORTD,5        ;turn on clock input<br />
<br />
         bcf STATUS,C       ;shift freq counters right by 4 places<br />
         rrf FREQ4,F<br />
         rrf FREQ3,F<br />
         rrf FREQ2,F<br />
         rrf FREQ1,F<br />
         bcf STATUS,C<br />
         rrf FREQ4,F<br />
         rrf FREQ3,F<br />
         rrf FREQ2,F<br />
         rrf FREQ1,F<br />
         bcf STATUS,C<br />
         rrf FREQ4,F<br />
         rrf FREQ3,F<br />
         rrf FREQ2,F<br />
         rrf FREQ1,F<br />
         bcf STATUS,C<br />
         rrf FREQ4,F<br />
         rrf FREQ3,F<br />
         rrf FREQ2,F<br />
         rrf FREQ1,F<br />
<br />
         btfsc STORED,1     ;Q1<br />
         bsf FREQ0,0<br />
         btfsc STORED,2     ;Q2<br />
         bsf FREQ0,1<br />
         btfsc STORED,3     ;Q3<br />
         bsf FREQ0,2<br />
         btfsc STOREC,4     ;Q4<br />
         bsf FREQ0,3<br />
         btfsc STOREC,6     ;Q5<br />
         bsf FREQ0,4<br />
         btfsc STOREC,7     ;Q6<br />
         bsf FREQ0,5<br />
         btfsc STOREC,5     ;Q7<br />
         bsf FREQ0,6<br />
         btfsc STOREC,3     ;Q8<br />
         bsf FREQ0,7<br />
<br />
         btfsc STORED,0     ;Q9<br />
         bsf FREQ1,0<br />
         btfsc STOREC,2     ;Q10<br />
         bsf FREQ1,1<br />
         btfsc STOREC,1     ;Q11<br />
         bsf FREQ1,2<br />
         btfsc STOREC,0     ;Q12<br />
         bsf FREQ1,3<br />
<br />
         movlw FREQ0<br />
         call DECIML        ;decimalise digits 1 to 4 <br />
         movf DEC1,W        ;copy answer into OUT-OUT3<br />
         movwf OUT0<br />
         movf ANSA1,W<br />
         movwf OUT1<br />
         movf ANSA2,W<br />
         movwf OUT2<br />
         movf ANSA3,W<br />
         movwf OUT3<br />
<br />
GF3:     movf ANSA4,W       ;copy overflow val into prev freq positions<br />
         movwf FREQ0<br />
         movf ANSA5,W<br />
         movwf FREQ1<br />
         clrf FREQ2<br />
         clrf FREQ3<br />
         clrf FREQ4<br />
         movlw FREQ0<br />
         call DECIML        ;now decimal digits 5 to 8<br />
<br />
         movf ANSA3,W       ;copy answer into OUT4 to OUT7<br />
         movwf OUT7<br />
         movf ANSA2,W<br />
         movwf OUT6<br />
         movf ANSA1,W<br />
         movwf OUT5<br />
         movf DEC1,W<br />
         movwf OUT4<br />
<br />
GF4:     call LCD5          ;output freq data to LCD<br />
         bsf RSLINE,4<br />
         clrf MARK1         ;clear leading zero flag<br />
<br />
         movlw OUT7<br />
         movwf FSR<br />
         movlw 8<br />
         movwf LOOPA<br />
MAINA:   movf INDF,W<br />
         btfss STATUS,Z     ;is val = 0?<br />
         goto MAINB         ;no<br />
         btfsc MARK1,0      ;has val &gt;0 been output?<br />
         goto MAINB         ;yes<br />
         movf LOOPA,W       ;is it the last byte of the loop?<br />
         xorlw 1<br />
         btfsc STATUS,Z<br />
         goto MAINB         ;yes<br />
         movlw ' '          ;clear leading zero<br />
         goto MAINC<br />
<br />
MAINB:   bsf MARK1,0        ;format as ASCII decimal val<br />
         andlw 15<br />
         iorlw 48<br />
<br />
MAINC:   call LCDOUT<br />
         incf FSR,F<br />
         decfsz LOOPA,F<br />
         goto MAINA<br />
         btfss SAMPLE,0<br />
         goto GF5<br />
         call LCD12<br />
         bsf RSLINE,4<br />
         movlw '.'<br />
         call LCDOUT<br />
<br />
         decf FSR,F<br />
         movf INDF,W<br />
         andlw 15<br />
         iorlw 48<br />
         call LCDOUT<br />
         goto GF6<br />
<br />
GF5:     movlw ' '<br />
         call LCDOUT<br />
<br />
GF6:     movlw 'H'<br />
         call LCDOUT<br />
         movlw 'z'<br />
         call LCDOUT<br />
<br />
MAINX:   clrf FREQ0         ;clear freq counters<br />
         clrf FREQ1<br />
         clrf FREQ2<br />
         clrf FREQ3<br />
         clrf FREQ4<br />
         clrf MARK2<br />
<br />
         movf CLKVAL1,W<br />
         btfsc SAMPLE,0     ;is 10sec rate on?<br />
         movf CLKVAL2,W<br />
         movwf CLKCNT<br />
         bsf PORTD,4        ;reset counter IC6<br />
         bcf PORTD,4<br />
         bsf PORTD,5        ;enable clock input<br />
<br />
         clrf TMR0<br />
         bcf INTCON,2       ;clear interrupt<br />
<br />
         goto MAIN          ;start sampling next batch<br />
<br />
;.............<br />
<br />
PAUSIT:  movlw 7<br />
         movwf SLOWIT<br />
         bcf INTCON,2<br />
PAUSE:   btfss INTCON,2<br />
         goto PAUSE<br />
         bcf INTCON,2<br />
         decfsz SLOWIT,F<br />
         goto PAUSE<br />
         return<br />
<br />
;................<br />
<br />
LCD1:    movlw %10000000     ;LCD cell position codes - not all used<br />
         goto LCDLIN<br />
LCD5:    movlw %10000101<br />
         goto LCDLIN<br />
LCD6:    movlw %10000110<br />
         goto LCDLIN<br />
LCD7:    movlw %10000111<br />
         goto LCDLIN<br />
<br />
LCD9:    movlw %10001001<br />
         goto LCDLIN<br />
LCD12:   movlw %10001100<br />
         goto LCDLIN<br />
<br />
LCD21:   movlw %11000000<br />
         goto LCDLIN<br />
LCD24:   movlw %11000100<br />
         goto LCDLIN<br />
LCD25:   movlw %11000101<br />
         goto LCDLIN<br />
LCD26:   movlw %11000110<br />
         goto LCDLIN<br />
LCD27:   movlw %11000111<br />
         goto LCDLIN<br />
<br />
LCD28:   movlw %11001000<br />
         goto LCDLIN<br />
LCD29:   movlw %11001001<br />
         goto LCDLIN<br />
<br />
LCDLIN:  BCF RSLINE,4<br />
<br />
LCDOUT:  movwf STORE<br />
         movlw 50<br />
         movwf LOOPX<br />
DELAY:   decfsz LOOPX,F<br />
         goto DELAY<br />
         call SENDIT<br />
SENDIT:  swapf STORE,F<br />
         movf STORE,W<br />
         andlw 15<br />
         iorwf RSLINE,W<br />
         movwf LCDSTOR1<br />
         clrf LCDSTOR2<br />
         movlw 6<br />
         movwf LOOPX<br />
<br />
SHIFT:   bcf STATUS,C      ;rearrange bits to suit PORTA pin order<br />
         rrf LCDSTOR1,F<br />
         rlf LCDSTOR2,F<br />
         decfsz LOOPX,F<br />
         goto SHIFT<br />
         movf LCDSTOR2,W<br />
         movwf PORTA<br />
         bsf PORTA,0       ;toggle LCD line E<br />
         bcf PORTA,0<br />
         bsf PORTA,5       ;turn on IC2 sync output line<br />
         return<br />
<br />
;..............convert binary to hex - not used in final model<br />
<br />
LCDHEX: movwf STORE2    ;split &amp; format decimal byte as HEX for LCD<br />
        swapf STORE2,W  ;get tens nibble<br />
        andlw 15<br />
        movwf STORE1<br />
        addlw 6<br />
        btfss STATUS,DC<br />
        goto HEX2<br />
        movf STORE1,W<br />
        addlw 55        ;set as alpha<br />
        goto HEX3<br />
HEX2:   movf STORE1,W<br />
        iorlw 48        ;set as numeral<br />
HEX3:   call LCDOUT     ;send it<br />
        movf STORE2,W   ;get units<br />
        andlw 15<br />
        movwf STORE1<br />
        addlw 6<br />
        btfss STATUS,DC<br />
        goto HEX4<br />
        movf STORE1,W<br />
        addlw 55        ;set as alpha<br />
        goto HEX5<br />
HEX4:   movf STORE1,W<br />
        iorlw 48        ;set as numeral<br />
HEX5:   call LCDOUT<br />
        return<br />
<br />
;........... used to convert binary bytes to decimal for LCD<br />
<br />
DECIML:                 ;decimalise binary number<br />
                        ;copy source into working area at DEC<br />
                        ;source address is brought in on W<br />
                        ;DEC1-5 becomes source<br />
                        ;answer goes into ANSA<br />
        call COPYFD     ;copy data at FSR into DEC<br />
        clrf STORE1<br />
        clrf STORE3<br />
        clrf ANSA5<br />
        movlw ANSA4     ;set answer store address<br />
        movwf FSR<br />
        clrf LOOPA<br />
<br />
DCML0:  movf LOOPA,W<br />
        call TBDEC1     ;subtract lsb from source value<br />
        subwf DEC1,F<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML1      ;no, so sub msb<br />
        movlw 1<br />
        subwf DEC2,F    ;yes so decrement next byte<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML1      ;no, so sub msb<br />
        movlw 1         ;yes<br />
        subwf DEC3,F<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML1      ;no, so sub msb<br />
        movlw 1         ;yes<br />
        subwf DEC4,F<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML1      ;no, so sub msb<br />
        movlw 1         ;yes<br />
        subwf DEC5,F<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML1      ;no, so sub msb<br />
<br />
DCML3:  movf LOOPA,W    ;yes, so re-add last table values lsb<br />
        call TBDEC1<br />
        addwf DEC1,F<br />
        btfss STATUS,C  ;is there a carry?<br />
        goto DCML5      ;no so exit loop<br />
        incf DEC2,F     ;yes so inc next byte<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML5      ;no so exit loop<br />
        incf DEC3,F     ;yes<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML5      ;no so exit loop<br />
        incf DEC4,F     ;yes<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML5      ;no so exit loop<br />
        incf DEC5,F     ;yes<br />
        goto DCML5      ;exit loop<br />
<br />
DCML1:  movf LOOPA,W<br />
        call TBDEC2     ;subtract msb from source value<br />
        subwf DEC2,F<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML2      ;no<br />
        movlw 1<br />
        subwf DEC3,F    ;yes so decrement next byte<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML2      ;no<br />
        movlw 1<br />
        subwf DEC4,F    ;yes so decrement next byte<br />
        btfsc STATUS,C  ;is there a borrow?<br />
        goto DCML2      ;no<br />
        movlw 1<br />
        subwf DEC5,F    ;yes so decrement next byte<br />
        btfss STATUS,C  ;is there a borrow?<br />
        goto DCML4      ;yes<br />
<br />
DCML2:  incfsz STORE1,F ;inc counter &amp; continue looping till zero<br />
        goto DCML0<br />
        incf STORE3,F<br />
        goto DCML0<br />
<br />
DCML4:  movf LOOPA,W    ;re-add last table values lsb<br />
        call TBDEC1<br />
        addwf DEC1,F<br />
        btfss STATUS,C  ;is there a carry?<br />
        goto DCML4A     ;no so add msb<br />
        incf DEC2,F     ;yes so inc next byte<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML4A     ;no so add msb<br />
        incf DEC3,F     ;yes, so inc next byte<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML4A     ;no so add msb<br />
        incf DEC4,F     ;yes, so inc next byte<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML4A     ;no so add msb<br />
        incf DEC5,F     ;yes, so inc next byte<br />
<br />
DCML4A: movf LOOPA,W    ;re-add last table values msb<br />
        call TBDEC2<br />
        addwf DEC2,F<br />
        btfss STATUS,C  ;is there a carry?<br />
        goto DCML5      ;no<br />
        incf DEC3,F     ;yes, so inc next byte<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML5      ;no<br />
        incf DEC4,F     ;yes, so inc next byte<br />
        btfss STATUS,Z  ;is there a carry? (is it zero)<br />
        goto DCML5      ;no<br />
        incf DEC5,F     ;yes, so inc next byte<br />
<br />
DCML5:  movf STORE3,W<br />
        btfss STATUS,Z<br />
        movwf ANSA5<br />
        movf STORE1,W   ;store counter and loop for next values<br />
        movwf INDF      ;INDF here is ANSA group<br />
<br />
        clrf STORE1<br />
        clrf STORE3<br />
        decf FSR,F<br />
<br />
        incf LOOPA,F<br />
        btfss LOOPA,2   ;is it = 4?<br />
        goto DCML0      ;no<br />
<br />
DCML6:  return<br />
<br />
COPYFD: movwf FSR       ;copy data at FSR to DEC<br />
        movf INDF,W<br />
        movwf DEC1<br />
        incf FSR,F<br />
        movf INDF,W<br />
        movwf DEC2<br />
        incf FSR,F<br />
        movf INDF,W<br />
        movwf DEC3<br />
        incf FSR,F<br />
        movf INDF,W<br />
        movwf DEC4<br />
        incf FSR,F<br />
        movf INDF,W<br />
        movwf DEC5<br />
        clrf DEC6<br />
        return<br />
<br />
;...........range switch<br />
<br />
RANGESW:  btfsc PORTE,2<br />
          goto SAMRATE<br />
          call OK<br />
<br />
          btfsc PORTE,1<br />
          goto DECRNG<br />
<br />
INCRNG:   incf RANGE,W<br />
          goto SHWRNG<br />
DECRNG:   decf RANGE,W<br />
<br />
SHWRNG:   andlw 7<br />
          movwf RANGE<br />
          call LCD21<br />
          bsf RSLINE,4<br />
          movlw 'R'<br />
          call LCDOUT<br />
          movlw 'a'<br />
          call LCDOUT<br />
          movlw 'n'<br />
          call LCDOUT<br />
          movlw 'g'<br />
          call LCDOUT<br />
          movlw 'e'<br />
          call LCDOUT<br />
<br />
          movf RANGE,W<br />
          sublw 7<br />
<br />
          iorlw 48<br />
          call LCDOUT<br />
          movf PORTB,W<br />
          andlw %11000000<br />
          movwf PORTB<br />
<br />
          bcf PORTD,6<br />
          bcf PORTD,7<br />
<br />
          movf RANGE,W<br />
          call RANGIT<br />
          andlw %00111111<br />
          PAGE1<br />
          movwf TRISB<br />
          PAGE0<br />
          movf RANGE,W<br />
          call RANGIT<br />
          andlw %11000000<br />
          iorlw %00001111<br />
          PAGE1<br />
          movwf TRISD<br />
          PAGE0<br />
          call PAUSIT<br />
          call PAUSIT<br />
          movf PORTE,W<br />
          andlw 3<br />
          btfss STATUS,Z<br />
          goto RANGESW<br />
          goto SAM1<br />
<br />
;...........set sample rate 1sec/10sec<br />
<br />
SAMRATE: incf SAMPLE,F<br />
         bcf SAMPLE,1<br />
         call OK<br />
<br />
SAM1:    clrf FREQ0         ;clear freq counters<br />
         clrf FREQ1<br />
         clrf FREQ2<br />
         clrf FREQ3<br />
         clrf FREQ4<br />
         clrf MARK2<br />
<br />
          call LCD27<br />
          bsf RSLINE,4<br />
          movlw 'T'<br />
          call LCDOUT<br />
          movlw 'i'<br />
          call LCDOUT<br />
          movlw 'm'<br />
          call LCDOUT<br />
          movlw 'e'<br />
          call LCDOUT<br />
          movlw '1'<br />
          call LCDOUT<br />
          movlw ' '<br />
          btfsc SAMPLE,0<br />
          movlw '0'<br />
          call LCDOUT<br />
          movlw 's'<br />
          call LCDOUT<br />
          movlw 'e'<br />
          call LCDOUT<br />
          movlw 'c'<br />
          call LCDOUT<br />
<br />
SAM3:    movf PORTE,W<br />
         andlw 7<br />
         btfss STATUS,Z<br />
         goto SAM3<br />
<br />
         call LCD5          ;output freq data to LCD<br />
         bsf RSLINE,4<br />
          movlw ' '<br />
          call LCDOUT<br />
          movlw ' '<br />
          call LCDOUT<br />
          movlw 'C'<br />
          call LCDOUT<br />
          movlw 'O'<br />
          call LCDOUT<br />
          movlw 'U'<br />
          call LCDOUT<br />
          movlw 'N'<br />
          call LCDOUT<br />
          movlw 'T'<br />
          call LCDOUT<br />
          movlw 'I'<br />
          call LCDOUT<br />
          movlw 'N'<br />
          call LCDOUT<br />
          movlw 'G'<br />
          call LCDOUT<br />
          movlw ' '<br />
          call LCDOUT<br />
<br />
         movf CLKVAL1,W<br />
         btfsc SAMPLE,0<br />
         movf CLKVAL2,W<br />
         movwf CLKCNT<br />
 <br />
         bsf PORTD,4        ;reset counter IC6<br />
         bcf PORTD,4<br />
<br />
         goto MAIN<br />
<br />
OK:      call LCD5          ;output freq data to LCD<br />
         bsf RSLINE,4<br />
         movlw ' '<br />
         call LCDOUT<br />
         movlw ' '<br />
         call LCDOUT<br />
         movlw 'O'<br />
         call LCDOUT<br />
         movlw 'K'<br />
         call LCDOUT<br />
<br />
         movlw 7<br />
         movwf LOOPA<br />
OK2:     movlw ' '<br />
         call LCDOUT<br />
         decfsz LOOPA,F<br />
         goto OK2<br />
         movlw '0'<br />
         call LCDOUT<br />
         return<br />
<br />
;........<br />
<br />
WAVEFRM: incf SHAPE,F<br />
         movf SHAPE,W<br />
         xorlw %00000011<br />
         btfsc STATUS,Z<br />
         clrf SHAPE<br />
<br />
WAVE1:   call LCD1          ;output freq data to LCD<br />
         bsf RSLINE,4<br />
         clrf LOOPA<br />
WAVE2:   movf SHAPE,W<br />
         call WAVEIT<br />
         call LCDOUT<br />
         incf LOOPA,F<br />
         btfss LOOPA,2<br />
         goto WAVE2<br />
<br />
         swapf SHAPE,W<br />
         movwf STORE<br />
         rlf STORE,F<br />
         rlf STORE,W<br />
         andlw %11000000<br />
         movwf STORE<br />
         movf PORTB,W<br />
         andlw %00111111<br />
         iorwf STORE,W<br />
         movwf PORTB<br />
<br />
WAVE3:   btfsc PORTB,0<br />
         goto WAVE3<br />
         call PAUSIT<br />
         return<br />
<br />
         .END</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Fong~</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235607.html</guid>
		</item>
		<item>
			<title>Need someone to run my mips code please</title>
			<link>http://www.daniweb.com/forums/thread235495.html</link>
			<pubDate>Mon, 02 Nov 2009 22:45:21 GMT</pubDate>
			<description><![CDATA[Can someone run my mips code?  I'm using pcSpim as my simulator 
 
The issue I'm having is that it doesn't correctly output the number of othercharacters.   
 
Other characters would be like !@#$%^&*()_+-=.,<>?/ \ 
 
The other problem I'm having is that it doesn't output the number of characters...]]></description>
			<content:encoded><![CDATA[<div>Can someone run my mips code?  I'm using pcSpim as my simulator<br />
<br />
The issue I'm having is that it doesn't correctly output the number of othercharacters.  <br />
<br />
Other characters would be like !@#$%^&amp;*()_+-=.,&lt;&gt;?/ \<br />
<br />
The other problem I'm having is that it doesn't output the number of characters there are in the string inputted.  If I get rid of the othercharacters loop then it will output or display the number of characters or the length of the string inputted.<br />
<br />
Thank you to anyone who can help me!<br />
<br />
 <pre style="margin:20px; line-height:13px">## This program prints out the length of characters, digits, upper and lower case characters that are inputted through the user<br />
## t0 holds each byte from input<br />
## t1 contains the count of characteters<br />
## t2 points to the input of characters<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; .data<br />
<br />
input:&nbsp; &nbsp; &nbsp; &nbsp; .asciiz &quot;Please enter up to eighty characters &quot;<br />
<br />
ans:&nbsp; &nbsp; &nbsp; &nbsp; .asciiz &quot;\nThis is how many characters your input has &quot;<br />
<br />
anstwo:&nbsp; &nbsp; &nbsp; &nbsp; .asciiz &quot;\nThis is how many uppercase characters your input has &quot;<br />
<br />
ansthree: .asciiz &quot;\nThis is how many lowercase characters your input has &quot;<br />
<br />
ansfour: .asciiz &quot;\nThis is how many digits your input has &quot;<br />
<br />
ansfive: .asciiz &quot;\nThis is how many spaces your input has &quot;<br />
<br />
anssix: .asciiz &quot;\nThis is how many othercharacters your input has &quot;<br />
<br />
<br />
<br />
<br />
<br />
buffer: .space 80<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; .text<br />
&nbsp; &nbsp; &nbsp; &nbsp; .globl main<br />
main:<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; # system call code for print_str<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, input&nbsp; &nbsp; &nbsp; &nbsp; # address of string to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # print the input<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 8&nbsp; &nbsp; &nbsp; &nbsp; # code for syscall read_string<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, buffer&nbsp; &nbsp; &nbsp; &nbsp; # tell syscall where the buffer is<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $a1, 80&nbsp; &nbsp; &nbsp; &nbsp; # tell syscall how big the buffer is<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t2, buffer&nbsp; &nbsp; &nbsp; &nbsp; # t2 points to the input<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t1, 0&nbsp; &nbsp; &nbsp; &nbsp;  # t1 holds the count<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal&nbsp; &nbsp; &nbsp; &nbsp;  uppercasecount&nbsp; &nbsp; &nbsp; &nbsp; # call uppercasecount<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t2, buffer&nbsp; &nbsp; &nbsp; &nbsp; # t2 points to the input<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t3, 0&nbsp; &nbsp; &nbsp; &nbsp; # t3 holds the count for how many uppercase<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal&nbsp; &nbsp; &nbsp; &nbsp;  lowercasecount&nbsp; &nbsp; &nbsp; &nbsp; # call lowercasecount<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t2, buffer&nbsp; &nbsp; &nbsp; &nbsp; # t2 points to the input<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t4, 0&nbsp; &nbsp; &nbsp; &nbsp; # t4 holds the count for how many lowercase<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t2, buffer&nbsp; &nbsp; &nbsp; &nbsp; # t2 points to the input<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t5, 0&nbsp; &nbsp; &nbsp; &nbsp; # t5 holds the count for how many digits<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; jal&nbsp; &nbsp; &nbsp; &nbsp;  digitcount&nbsp; &nbsp; &nbsp; &nbsp; # call digitcount<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t2, buffer&nbsp; &nbsp; &nbsp; &nbsp; # t2 points to the input<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t6, 0&nbsp; &nbsp; &nbsp; &nbsp; # t6 holds the count for how many spaces<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal&nbsp; &nbsp; &nbsp; &nbsp;  spacecount&nbsp; &nbsp; &nbsp; &nbsp; # call spacecount<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t2, buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; #li $t7, 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal&nbsp; &nbsp; &nbsp; &nbsp;  Othercharacters<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
nextcharacter:<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; lb $t0,($t2)&nbsp; &nbsp; &nbsp; &nbsp; # get a byte from the input<br />
&nbsp; &nbsp; &nbsp; &nbsp; beqz $t0, characterend&nbsp; &nbsp; &nbsp; &nbsp; # zero means it is the end of the input<br />
&nbsp; &nbsp; &nbsp; &nbsp; addi $t1, $t1, 1&nbsp; &nbsp; &nbsp; &nbsp; # increment the count<br />
&nbsp; &nbsp; &nbsp; &nbsp; addi $t2,1&nbsp; &nbsp; &nbsp; &nbsp; # move the pointer to the next character<br />
&nbsp; &nbsp; &nbsp; &nbsp; j nextcharacter&nbsp; &nbsp; &nbsp; &nbsp; # go through the next character loop again<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
characterend:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, ans&nbsp; &nbsp; &nbsp; &nbsp; # system call to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; # out a message<br />
&nbsp; &nbsp; &nbsp; &nbsp; sub $t1, $t1, 1&nbsp; &nbsp; &nbsp; &nbsp; # subtract 1 from count of characters to get correct number<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $a0, $t1&nbsp; &nbsp; &nbsp; &nbsp; # system call to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 1&nbsp; &nbsp; &nbsp; &nbsp; # out the length worked out<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0,10&nbsp; &nbsp; &nbsp; &nbsp; # exit<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
#<br />
#------------------------------------------------<br />
# uppercase - takes a single character as a<br />
# parameter and returns 1 if the character <br />
# is a uppercase otherwise return 0.<br />
#&nbsp; &nbsp; &nbsp; &nbsp; a0 - holds character<br />
#&nbsp; &nbsp; &nbsp; &nbsp; v0 - returns 0 or 1<br />
#------------------------------------------------<br />
uppercase:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 0&nbsp; &nbsp; &nbsp; &nbsp; #<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'A',ucyes&nbsp; &nbsp; &nbsp; &nbsp; #beq means branch is equal to<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'B',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'C',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'D',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'E',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'F',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'G',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'H',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'I',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'J',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'K',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'L',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'M',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'N',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'O',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'P',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'Q',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'R',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'S',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'T',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'U',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'V',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'W',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'X',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'Y',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'Z',ucyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp;  # return (to the operating system)<br />
<br />
ucyes:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0,1&nbsp; &nbsp; &nbsp; &nbsp; # this is the code perform print_int<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp; # return (to the operating system)<br />
<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra<br />
<br />
#------------------------------------------------<br />
# uppercasecount - use vowelp to count the vowels in a<br />
# string.<br />
#&nbsp; &nbsp; &nbsp; &nbsp; a0 - holds buffer address<br />
#&nbsp; &nbsp; &nbsp; &nbsp; t3 - holds number of uppercasecharacters<br />
#&nbsp; &nbsp; &nbsp; &nbsp; v0 - returns number of uppercasecharacters<br />
#------------------------------------------------<br />
<br />
uppercasecount:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; sub $sp,$sp,16&nbsp; &nbsp; &nbsp; &nbsp;  # save registers on stack<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $a0,0($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $t3,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $s1,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $ra,12($sp)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t3,0&nbsp; &nbsp; &nbsp; &nbsp; # count of vowels<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $s1,$a0&nbsp; &nbsp; &nbsp; &nbsp; # address of string<br />
<br />
<br />
nextcharacter2:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; lb $a0,($s1)&nbsp; &nbsp; &nbsp; &nbsp; # get each character<br />
&nbsp; &nbsp; &nbsp; &nbsp; beqz $a0,uppercasedone&nbsp; &nbsp; &nbsp; &nbsp; # zero marks end<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal uppercase&nbsp; &nbsp; &nbsp; &nbsp; # call uppercase <br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t3,$t3,$v0&nbsp; &nbsp; &nbsp; &nbsp; # add 0 or 1 to count<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $s1,$s1,1&nbsp; &nbsp; &nbsp; &nbsp; # move along string<br />
&nbsp; &nbsp; &nbsp; &nbsp; j nextcharacter2<br />
<br />
<br />
uppercasedone:&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, anstwo<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $a0, $t3&nbsp; &nbsp; &nbsp; &nbsp; # system call to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 1&nbsp; &nbsp; &nbsp; &nbsp; # out the length worked out<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $a0,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  # restore registers<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $s0,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $t3,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $ra,12($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $sp,$sp,16<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra<br />
<br />
<br />
#<br />
#------------------------------------------------<br />
# lowercase - takes a single character as a<br />
# parameter and returns 1 if the character <br />
# is a uppercase otherwise return 0.<br />
#&nbsp; &nbsp; &nbsp; &nbsp; a0 - holds character<br />
#&nbsp; &nbsp; &nbsp; &nbsp; v0 - returns 0 or 1<br />
#------------------------------------------------<br />
lowercase:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 0&nbsp; &nbsp; &nbsp; &nbsp; #<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'a',lcyes&nbsp; &nbsp; &nbsp; &nbsp; #beq means branch is equal to<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'b',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'c',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'d',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'e',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'f',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'g',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'h',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'i',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'j',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'k',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'l',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'m',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'n',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'o',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'p',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'q',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'r',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'s',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'t',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'u',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'v',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'w',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'x',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'y',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'z',lcyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp;  # return (to the operating system)<br />
<br />
lcyes:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0,1&nbsp; &nbsp; &nbsp; &nbsp; # this is the code perform print_int<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp; # return (to the operating system)<br />
<br />
<br />
<br />
<br />
#------------------------------------------------<br />
# lowercasecount - use lowercase to count the lowercase characters in a<br />
# string.<br />
#&nbsp; &nbsp; &nbsp; &nbsp; a0 - holds buffer address<br />
#&nbsp; &nbsp; &nbsp; &nbsp; t4 - holds number of lowercasecharacters<br />
#&nbsp; &nbsp; &nbsp; &nbsp; v0 - returns number of lowercasecharacters<br />
#------------------------------------------------<br />
<br />
lowercasecount:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; sub $sp,$sp,16&nbsp; &nbsp; &nbsp; &nbsp;  # save registers on stack<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $a0,0($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $t4,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $s1,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $ra,12($sp)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t4,0&nbsp; &nbsp; &nbsp; &nbsp; # count of lowercase<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $s1,$a0&nbsp; &nbsp; &nbsp; &nbsp; # address of string<br />
<br />
nextcharacter3:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; lb $a0,($s1)&nbsp; &nbsp; &nbsp; &nbsp; # get each character<br />
&nbsp; &nbsp; &nbsp; &nbsp; beqz $a0,lowercasedone&nbsp; &nbsp; &nbsp; &nbsp; # zero marks end<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal lowercase&nbsp; &nbsp; &nbsp; &nbsp; # call lowercase <br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t4,$t4,$v0&nbsp; &nbsp; &nbsp; &nbsp; # add 0 or 1 to count<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $s1,$s1,1&nbsp; &nbsp; &nbsp; &nbsp; # move along string<br />
&nbsp; &nbsp; &nbsp; &nbsp; j nextcharacter3<br />
<br />
<br />
lowercasedone:&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, ansthree<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $a0, $t4&nbsp; &nbsp; &nbsp; &nbsp; # system call to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 1&nbsp; &nbsp; &nbsp; &nbsp; # out the length worked out<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $a0,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  # restore registers<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $t4,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $s1,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $ra,12($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $sp,$sp,16<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp;  # return (to the operating system)<br />
<br />
<br />
<br />
<br />
<br />
digit:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'1',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'2',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'3',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'4',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'5',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'6',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'7',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'8',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'9',dyes<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,'0',dyes<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp;  # return (to the operating system)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
dyes:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0,1<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra<br />
<br />
digitcount:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; sub $sp, $sp, 16<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $a0,0($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $t5,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $s1,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $ra,12($sp)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t5,0&nbsp; &nbsp; &nbsp; &nbsp; # count of digits<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $s1,$a0&nbsp; &nbsp; &nbsp; &nbsp; # address of string<br />
<br />
nextdigit:<br />
&nbsp; &nbsp; &nbsp; &nbsp; lb $a0,($s1)&nbsp; &nbsp; &nbsp; &nbsp; # get each character<br />
&nbsp; &nbsp; &nbsp; &nbsp; beqz $a0,digitdone&nbsp; &nbsp; &nbsp; &nbsp; # zero marks end<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal digit&nbsp; &nbsp; &nbsp; &nbsp; # call digit <br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t5,$t5,$v0&nbsp; &nbsp; &nbsp; &nbsp; # add 0 or 1 to count<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $s1,$s1,1&nbsp; &nbsp; &nbsp; &nbsp; # move along string<br />
&nbsp; &nbsp; &nbsp; &nbsp; j nextdigit<br />
<br />
digitdone:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, ansfour<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $a0, $t5&nbsp; &nbsp; &nbsp; &nbsp; # system call to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 1&nbsp; &nbsp; &nbsp; &nbsp; # out the length worked out<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $a0,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  # restore registers<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $t5,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $s1,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $ra,12($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $sp,$sp,16<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra<br />
<br />
space:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; $a0,' ',syes<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp;  # return (to the operating system)<br />
<br />
syes:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0,1<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra<br />
<br />
spacecount:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; sub $sp, $sp, 16<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $a0,0($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $t6,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $s1,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sw $ra,12($sp)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $t6,0&nbsp; &nbsp; &nbsp; &nbsp; # count of space<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $s1,$a0&nbsp; &nbsp; &nbsp; &nbsp; # address of string<br />
<br />
nextspace:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; lb $a0,($s1)&nbsp; &nbsp; &nbsp; &nbsp; # get each character<br />
&nbsp; &nbsp; &nbsp; &nbsp; beqz $a0,spacedone&nbsp; &nbsp; &nbsp; &nbsp; # zero marks end<br />
&nbsp; &nbsp; &nbsp; &nbsp; jal space&nbsp; &nbsp; &nbsp; &nbsp; # call space <br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t6,$t6,$v0&nbsp; &nbsp; &nbsp; &nbsp; # add 0 or 1 to count<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $s1,$s1,1&nbsp; &nbsp; &nbsp; &nbsp; # move along string<br />
&nbsp; &nbsp; &nbsp; &nbsp; j nextspace<br />
<br />
spacedone:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, ansfive&nbsp; &nbsp; &nbsp; &nbsp; # how many spaces are in the characters<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $a0, $t6&nbsp; &nbsp; &nbsp; &nbsp; # system call to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 1&nbsp; &nbsp; &nbsp; &nbsp; # out the length worked out<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $a0,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  # restore registers<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $t6,4($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $s1,8($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $ra,12($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $sp,$sp,16<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra<br />
<br />
Othercharacters:<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t7, $t3, $t4<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t8, $t5, $t6<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t9, $t8, $t7<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; sub $t9, $t2, $t9<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, anssix<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $a0, $t9<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Noliving</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235495.html</guid>
		</item>
		<item>
			<title>Help in using LDR and ADC in 8051</title>
			<link>http://www.daniweb.com/forums/thread235395.html</link>
			<pubDate>Mon, 02 Nov 2009 15:49:51 GMT</pubDate>
			<description>Hi I need help on how to use LDR and ADC0804 in 8051 microcontroller. 
So far I have this in my project but I want to replace the switch with LDR (dark activated).  
 
What happens here (attached file)is that I use the switch to decrement/increment the number of cars and when it reaches to 0(no...</description>
			<content:encoded><![CDATA[<div>Hi I need help on how to use LDR and ADC0804 in 8051 microcontroller.<br />
So far I have this in my project but I want to replace the switch with LDR (dark activated). <br />
<br />
What happens here (attached file)is that I use the switch to decrement/increment the number of cars and when it reaches to 0(no available space) the LCD will prompt that it is full.<br />
<br />
What I want is using a sensor(ldr) and a laser light so that when a car passes (the light will be broken) the ldr will send signal and decrement the number of spaces and vice versa( i'll be using two ldr one for exit the other for entrance).<br />
<br />
attached is my design. Im using Isis Proteus 7.4 and the code below<br />
<br />
 <pre style="margin:20px; line-height:13px">DB0 EQU P1.0<br />
<br />
DB1 EQU P1.1<br />
<br />
DB2 EQU P1.2<br />
<br />
DB3 EQU P1.3<br />
<br />
DB4 EQU P1.4<br />
<br />
DB5 EQU P1.5<br />
<br />
DB6 EQU P1.6<br />
<br />
DB7 EQU P1.7<br />
<br />
<br />
<br />
EN EQU P3.7<br />
<br />
RS EQU P3.6<br />
<br />
RW EQU P3.5<br />
<br />
DATA EQU P1<br />
<br />
<br />
<br />
;7-Segment Display<br />
<br />
enableDIGIT3 EQU P3.2<br />
<br />
enableDIGIT4 EQU P3.3<br />
<br />
<br />
<br />
ZERO&nbsp; &nbsp; EQU&nbsp;  10001000b<br />
<br />
ONE&nbsp; &nbsp;  EQU&nbsp;  10111110b<br />
<br />
TWO&nbsp; &nbsp;  EQU&nbsp;  11000100b<br />
<br />
THREE&nbsp;  EQU&nbsp;  10010100b<br />
<br />
FOUR&nbsp; &nbsp; EQU&nbsp;  10110010b<br />
<br />
FIVE&nbsp; &nbsp; EQU&nbsp;  10010001b<br />
<br />
SIX&nbsp; &nbsp;  EQU&nbsp;  10000001b<br />
<br />
SEVEN&nbsp;  EQU&nbsp;  10111100b<br />
<br />
EIGHT&nbsp;  EQU&nbsp;  10000000b<br />
<br />
NINE&nbsp; &nbsp; EQU&nbsp;  10010000b<br />
<br />
DOT&nbsp; &nbsp;  EQU&nbsp;  01111111b<br />
<br />
<br />
<br />
MOV 20h,#ZERO<br />
<br />
MOV 21h,#ONE<br />
<br />
MOV 22h,#TWO<br />
<br />
MOV 23h,#THREE<br />
<br />
MOV 24h,#FOUR<br />
<br />
MOV 25h,#FIVE<br />
<br />
MOV 26h,#SIX<br />
<br />
MOV 27h,#SEVEN<br />
<br />
MOV 28h,#EIGHT<br />
<br />
MOV 29h,#NINE<br />
<br />
<br />
<br />
MOV R0, #20h<br />
<br />
MOV R1, #22h<br />
<br />
<br />
<br />
PDATA EQU P2 ; Connect 8 pins here<br />
<br />
<br />
<br />
CLR 51h&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
LCALL LCD_WELCOME<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
Start:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; JB P3.1, check1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SETB 50h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; check1:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; JB P3.0, check2<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SETB 52h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; check2:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JNB P3.1, cont1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JNB 50h, cont1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLR 50h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LCALL INC_7SEGMENT&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; cont1:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JNB P3.0, cont2<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JNB 52h, cont2<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLR 52h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LCALL DEC_7SEGMENT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; cont2:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LCALL SHOW_7SEGMENT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LCALL SHOW_LCD<br />
<br />
SJMP Start&nbsp; <br />
<br />
<br />
<br />
SHOW_LCD:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CJNE @R0, #ZERO, welcome<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CJNE @R1, #ZERO, welcome<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JB 51h, done_showlcd<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LCALL LCD_FULL<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; sjmp done_showlcd<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; welcome: <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JNB 51h, done_showlcd<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LCALL LCD_WELCOME<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; done_showlcd:<br />
<br />
RET<br />
<br />
LCD_FULL:&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL CLEAR_LCD&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL INIT_LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,#086H<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WAIT_LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'F'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'U'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'L'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'L'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'!'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'!'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB 51h<br />
<br />
RET<br />
<br />
<br />
<br />
LCD_WELCOME:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL CLEAR_LCD&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL INIT_LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,#081h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WAIT_LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'P'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'A'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'R'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'K'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'I'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'N'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'G'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#' '<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'S'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'P'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'A'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'C'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'E'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,#0C3h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WAIT_LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'A'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'V'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'A'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'I'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'L'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'A'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'B'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'L'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,#'E'<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WRITE_TEXT<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR 51h<br />
<br />
RET<br />
<br />
<br />
<br />
INC_7SEGMENT:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CJNE @R1, #TWO, increment<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; sjmp doneinc<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; increment:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CJNE @R0, #NINE, incr0<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV R0, #20h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INC R1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SJMP doneinc<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; incr0:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INC R0<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; doneinc:<br />
<br />
RET<br />
<br />
<br />
<br />
DEC_7SEGMENT:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CJNE @R0, #ZERO, dec0<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CJNE @R1, #ZERO, dec1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; sjmp donedec<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; dec1:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV R0, #29h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DEC R1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SJMP donedec<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; dec0:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DEC R0<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; donedec:<br />
<br />
RET<br />
<br />
<br />
<br />
SHOW_7SEGMENT:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV PDATA,#00h<br />
<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  setb enableDIGIT3<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  MOV&nbsp; &nbsp;  A,@R1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  MOV PDATA,A<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  LCALL smallDelay<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; clr enableDIGIT3<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  setb enableDIGIT4<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  MOV&nbsp; &nbsp;  A,@R0<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  MOV PDATA,A<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  LCALL smallDelay&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; clr enableDIGIT4<br />
<br />
RET&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
<br />
<br />
INIT_LCD:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,#38h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WAIT_LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,#0Ch<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WAIT_LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
RET<br />
<br />
<br />
<br />
CLEAR_LCD:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,#01h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WAIT_LCD<br />
<br />
RET<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
WRITE_TEXT:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB RS<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,A<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL WAIT_LCD<br />
<br />
RET<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
WAIT_LCD:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN ;Start LCD command<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RS ;It's a command<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB RW ;It's a read command<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV DATA,#0FFh ;Set all pins to FF initially<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB EN ;Clock out command to LCD<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; LCALL smallDelay<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV A,DATA ;Read the return value<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; JB ACC.7,WAIT_LCD ;If bit 7 high, LCD still busy<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR EN ;Finish the command<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR RW ;Turn off RW for future commands<br />
<br />
RET&nbsp; <br />
<br />
<br />
<br />
smallDelay:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLR TF1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CLR TR1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV TH1,#76<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV TL1,#01<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV TMOD,#01<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SETB TR1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JNB TF1,$<br />
<br />
RET</pre></div>  <br /> <div style="padding:5px">    <fieldset class="fieldset"> <legend>Attached Images</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/jpeg.gif" alt="File Type: jpeg" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=12429&amp;d=1257176585" target="_blank">design.jpeg</a> (170.7 KB)</td> </tr> </table> </fieldset>   </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>jazz_vill</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235395.html</guid>
		</item>
		<item>
			<title>Max min from array</title>
			<link>http://www.daniweb.com/forums/thread235323.html</link>
			<pubDate>Mon, 02 Nov 2009 11:17:29 GMT</pubDate>
			<description><![CDATA[Write a program in Assembly Language to find the maximum number and the minimum number from an array of ten positive numbers. Store the minimum number in AX and maximum number in DX. 
 
[Hint: Use the conditional jumps] 
 
PLEASE HELP ME!]]></description>
			<content:encoded><![CDATA[<div>Write a program in Assembly Language to find the maximum number and the minimum number from an array of ten positive numbers. Store the minimum number in AX and maximum number in DX.<br />
<br />
[Hint: Use the conditional jumps]<br />
<br />
PLEASE HELP ME!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Koala269</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235323.html</guid>
		</item>
		<item>
			<title>Need help with a mips program</title>
			<link>http://www.daniweb.com/forums/thread234972.html</link>
			<pubDate>Sat, 31 Oct 2009 20:55:10 GMT</pubDate>
			<description><![CDATA[Hello everyone, I'm trying to create a program that will accept a string and output how many characters are in that string.  The input can be a mixture of upper/lowercase letters, digits, spaces, and other cases such as .%^& etc. 
 
This is my first time use any type of assembly language so please...]]></description>
			<content:encoded><![CDATA[<div>Hello everyone, I'm trying to create a program that will accept a string and output how many characters are in that string.  The input can be a mixture of upper/lowercase letters, digits, spaces, and other cases such as .%^&amp; etc.<br />
<br />
This is my first time use any type of assembly language so please understand if I have trouble<br />
<br />
This is what I have so far, the only thing it does right now is just output what I input, so if I input '&quot;hello&quot; the output will be &quot;hello&quot;.  Thanks for your help.<br />
<br />
 <pre style="margin:20px; line-height:13px">&nbsp; &nbsp; &nbsp; &nbsp; .data<br />
<br />
Q1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .asciiz &quot;Please enter a string that is up to eighty characters: &quot;<br />
<br />
ans1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .asciiz &quot;\nThe length of the string you entered contains this many characters: &quot;<br />
<br />
<br />
<br />
buffer:&nbsp; &nbsp; &nbsp; &nbsp; .space 80&nbsp; &nbsp; &nbsp; &nbsp; # create space for string input<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; .text<br />
&nbsp; &nbsp; &nbsp; &nbsp; .globl main&nbsp; &nbsp; &nbsp; &nbsp; #must be global<br />
<br />
main:<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; # system call code for print_str<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, Q1&nbsp; &nbsp; &nbsp; &nbsp; # address of string to print<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # print the Q1<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 8&nbsp; &nbsp; &nbsp; &nbsp; # code for syscall read_string<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, buffer&nbsp; &nbsp; &nbsp; &nbsp; # tell syscall where the buffer is<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $a1, 80&nbsp; &nbsp; &nbsp; &nbsp; # tell syscall how big the buffer is<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 8&nbsp; &nbsp; &nbsp; &nbsp; # code for syscall read_string<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t0, buffer&nbsp; &nbsp; &nbsp; &nbsp; # place address of buffer in $t0<br />
&nbsp; &nbsp; &nbsp; &nbsp; lb $t1, 0($t0)&nbsp; &nbsp; &nbsp; &nbsp; # read byte located at address in $t0<br />
&nbsp; &nbsp; &nbsp; &nbsp; addi $t0, $t0, 0&nbsp; &nbsp; &nbsp; &nbsp; # increment address in $t0<br />
&nbsp; &nbsp; &nbsp; &nbsp; #sbrk $a0, 9&nbsp; &nbsp; &nbsp; &nbsp; # the amount of how long the string is from the address<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, ans1<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; move $a0, $t0<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra&nbsp; &nbsp; &nbsp; &nbsp; # return to system</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Noliving</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234972.html</guid>
		</item>
		<item>
			<title><![CDATA[add [bx+si],al means what?]]></title>
			<link>http://www.daniweb.com/forums/thread234967.html</link>
			<pubDate>Sat, 31 Oct 2009 20:09:06 GMT</pubDate>
			<description><![CDATA[Hi fellas, 
I have a question about disassembled code. I have a very simple assembly code that prints "Hello world" to screen. When I disassembled it by using nasm(ndisasm), I got a text file. After that I opened it and started to analyze it. However, in a section that comes after " int 0x80" there...]]></description>
			<content:encoded><![CDATA[<div>Hi fellas,<br />
I have a question about disassembled code. I have a very simple assembly code that prints &quot;Hello world&quot; to screen. When I disassembled it by using nasm(ndisasm), I got a text file. After that I opened it and started to analyze it. However, in a section that comes after &quot; int 0x80&quot; there are a lot of  &quot;add [bx+si],al&quot; statement. What does it means? Can you explain me?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>kemaletikan</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234967.html</guid>
		</item>
		<item>
			<title>Storing multiple things in a variable?</title>
			<link>http://www.daniweb.com/forums/thread234593.html</link>
			<pubDate>Fri, 30 Oct 2009 04:47:53 GMT</pubDate>
			<description><![CDATA[So, I was trying to re-create the CMD command "set /p", where it prompts the user to type text, and is ended by a carriage return. 
 
Upon trying this, however, I found that a word (dw) will only hold the last thing passed to it.  You can type "abcdefg", but the word will only hold the value "g". 
...]]></description>
			<content:encoded><![CDATA[<div>So, I was trying to re-create the CMD command &quot;set /p&quot;, where it prompts the user to type text, and is ended by a carriage return.<br />
<br />
Upon trying this, however, I found that a word (dw) will only hold the last thing passed to it.  You can type &quot;abcdefg&quot;, but the word will only hold the value &quot;g&quot;.<br />
<br />
What I'm trying to ask is, would there be a way to make it store everything typed, like.. create a string out of a series of characters?<br />
<br />
I'm using NASM16 under a windows operating system.<br />
<br />
<br />
<br />
 <pre style="margin:20px; line-height:13px">[org 0100h]<br />
%include &quot;Library.asm&quot;<br />
<br />
[section .text]<br />
<br />
START:<br />
input 16&nbsp; &nbsp; &nbsp; &nbsp; ;Check if it's enter<br />
je ENDLINE&nbsp; &nbsp; &nbsp; &nbsp; ;If equal, end the line<br />
mov [store],al&nbsp; &nbsp; &nbsp; &nbsp; ;Mov AL's value into a variable<br />
string store&nbsp; &nbsp; &nbsp; &nbsp; ;Display the variable<br />
jmp START<br />
<br />
ENDLINE:<br />
string eol&nbsp; &nbsp; &nbsp; &nbsp; ;End the line<br />
jmp START<br />
<br />
<br />
<br />
<br />
[section .data]<br />
<br />
store dw 0, &quot;$&quot;<br />
eol db &quot; &quot;, 13, 10, &quot;$&quot;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Goalatio</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234593.html</guid>
		</item>
		<item>
			<title>Help with End of Line character</title>
			<link>http://www.daniweb.com/forums/thread234511.html</link>
			<pubDate>Thu, 29 Oct 2009 19:27:23 GMT</pubDate>
			<description><![CDATA[Hey all, I've been working on this little program in NASM 16 bit assembly, under a windows operating system. 
 
It works, I just have a problem. If you don't pass it any arguments, it fails to see that there is an end of line character.  
 
You pass arguments as.. 
INKEY a 
and it responds "Press a...]]></description>
			<content:encoded><![CDATA[<div>Hey all, I've been working on this little program in NASM 16 bit assembly, under a windows operating system.<br />
<br />
It works, I just have a problem. If you don't pass it any arguments, it fails to see that there is an end of line character. <br />
<br />
You pass arguments as..<br />
INKEY a<br />
and it responds &quot;Press a to continue . . .&quot;<br />
<br />
If you don't pass anything, by just saying<br />
INKEY<br />
then it responds &quot;Press  to continue . . .&quot; and will not exit unless I &quot;End now&quot;<br />
<br />
Here's my code, any nudge in the right direction would be appreciated.<br />
<br />
<br />
NOTE:  I am using my own library for this, so if you do not recognize some commands, that is why.. Hopefuly you can see the basic idea of what's happening though, I always try to comment on every line.<br />
<br />
<br />
<br />
 <pre style="margin:20px; line-height:13px">[org 0100h]<br />
%include &quot;Library.asm&quot;<br />
<br />
[section .text]<br />
<br />
string msg1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Display &quot;Press&quot;<br />
arg&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Grab the arguments off the stack<br />
mov si,bx&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;LODSB!<br />
jmp GRABKEY&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Get the FIRST argument<br />
<br />
GRABKEY:<br />
lodsb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Advance ONE character in SI<br />
cmp al,0d&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Check if End of Line<br />
je INVALID&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;If it is, exit with ERRORLEVEL 0<br />
mov [character],al&nbsp; &nbsp; &nbsp; &nbsp; ;Store this character in a word<br />
string character&nbsp; &nbsp; &nbsp; &nbsp; ;Display the character<br />
string msg2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Display &quot;to continue. . .&quot;<br />
jmp INPUTKEY&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Start asking for the key<br />
<br />
INPUTKEY:<br />
input [character]&nbsp; &nbsp; &nbsp; &nbsp; ;Use library procedure to check\compare AL<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;For the key passed as an argument<br />
je VALIDPRESS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;If it's equal, we can leave!<br />
jmp INPUTKEY&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Loop if it's not equal<br />
<br />
INVALID:<br />
exit 0<br />
<br />
VALIDPRESS:<br />
exit 1<br />
<br />
[section .data]<br />
<br />
character dw 0, &quot;$&quot;<br />
msg1 db &quot;Press &quot;, &quot;$&quot;<br />
msg2 db &quot;to continue . . .&quot;, 13, 10, &quot;$&quot;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Goalatio</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234511.html</guid>
		</item>
		<item>
			<title>What does a C++ function header looks like in assembly?</title>
			<link>http://www.daniweb.com/forums/thread234356.html</link>
			<pubDate>Thu, 29 Oct 2009 08:19:01 GMT</pubDate>
			<description>Hi, 
 
Can anyone please tell me how will a C++ function will start in assembly? What will the header look like? is there a conventional first few rows? 
 
What about the end of a C++ function? 
 
I am very curious about how C++ code really looks like (for example what would a class look like, what...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
Can anyone please tell me how will a C++ function will start in assembly? What will the header look like? is there a conventional first few rows?<br />
<br />
What about the end of a C++ function?<br />
<br />
I am very curious about how C++ code really looks like (for example what would a class look like, what would inheritance look like) as I'm trying to understand the &quot;under the hood&quot; issues in c++ opbject oriented code so any referral to a book or an article will be much appreciated.<br />
<br />
Thanks!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>pagis</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234356.html</guid>
		</item>
		<item>
			<title>passing command line parameters mips</title>
			<link>http://www.daniweb.com/forums/thread234247.html</link>
			<pubDate>Thu, 29 Oct 2009 01:14:49 GMT</pubDate>
			<description><![CDATA[I have written a program that multiplies 2 decimals. My multiplication output is fine. 
 
However I would like to do multiplication by passing in two parameters via command line. So far e.g. lets say if I just put '3 4' in the command line without the quotes.. nothing happens... 
 
however if I put...]]></description>
			<content:encoded><![CDATA[<div>I have written a program that multiplies 2 decimals. My multiplication output is fine.<br />
<br />
However I would like to do multiplication by passing in two parameters via command line. So far e.g. lets say if I just put '3 4' in the command line without the quotes.. nothing happens...<br />
<br />
however if I put the numbers like this 'mult 3 4'  -- of course without quote.. its works.. I see 12 on the console... is there anyway where I dont have to type in mult and just type '3 '4' ???<br />
<br />
ideas???</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234247.html</guid>
		</item>
		<item>
			<title>Flags used to test conditional jumps...</title>
			<link>http://www.daniweb.com/forums/thread234028.html</link>
			<pubDate>Wed, 28 Oct 2009 03:18:21 GMT</pubDate>
			<description>Hi, I do not understand how the x86 processor chooses whether to not to jump for a conditional jump. My professor told me that conditional jumps are based on the OF, ZF, SF, and CF flags, but I do not understand which flags are checked under a given jump instruction... 
 
For example, what flags...</description>
			<content:encoded><![CDATA[<div>Hi, I do not understand how the x86 processor chooses whether to not to jump for a conditional jump. My professor told me that conditional jumps are based on the OF, ZF, SF, and CF flags, but I do not understand which flags are checked under a given jump instruction...<br />
<br />
For example, what flags are checked for a unsigned greater-than jump?<br />
<br />
Thanks,<br />
Tyler<br />
<br />
(In other words, how do I determine the flags in the right column of this website?)<br />
<a rel="nofollow" class="t" href="http://siyobik.info/index.php?module=x86&amp;id=146" target="_blank">http://siyobik.info/index.php?module=x86&amp;id=146</a></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>runtogetdone</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234028.html</guid>
		</item>
		<item>
			<title>x86 32-bit registers</title>
			<link>http://www.daniweb.com/forums/thread233987.html</link>
			<pubDate>Wed, 28 Oct 2009 00:03:00 GMT</pubDate>
			<description><![CDATA[yeah i can't find this on google but 
 
i understand how to output data using 16bit (with int 21h/ah=02) 
 
say im doing some math calculations, how can i output something in a 32bit register (eax, edx...)?]]></description>
			<content:encoded><![CDATA[<div>yeah i can't find this on google but<br />
<br />
i understand how to output data using 16bit (with int 21h/ah=02)<br />
<br />
say im doing some math calculations, how can i output something in a 32bit register (eax, edx...)?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>brando|away</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233987.html</guid>
		</item>
		<item>
			<title>help with (i think its) floating point arithmetic on 8051</title>
			<link>http://www.daniweb.com/forums/thread233924.html</link>
			<pubDate>Tue, 27 Oct 2009 17:21:04 GMT</pubDate>
			<description><![CDATA[<div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code Tags</a> </div> <div> <strong>Assembly Syntax</strong>...]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">; For:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  AT89C4051 @ 11.0592MHz<br />
; Hardware:&nbsp; &nbsp; &nbsp; &nbsp; INTERFACED WITH ADC0831<br />
; Program goal:&nbsp; &nbsp; &nbsp; &nbsp; CREATE A DIGITAL VOLTAGE METER<br />
; Assembler:&nbsp; &nbsp; &nbsp; &nbsp; M-IDE Studio for MCS-51<br />
<br />
<br />
;place all the usual pre code items here (INTERRUPT VECTORS, ETC)<br />
<br />
<br />
CS&nbsp; &nbsp; &nbsp; &nbsp; EQU P3.1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;CONNECTED TO CS ON ADC0831<br />
CLK&nbsp; &nbsp; &nbsp; &nbsp; EQU P3.0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;CON TO CLK ON ADC0831<br />
D0&nbsp; &nbsp; &nbsp; &nbsp; EQU P3.7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;CON TO DO ON ADC0831<br />
;THIS MEANS WE STILL HAVE 1 AVAILABLE PIN LEFT (EXTERNAL INTERRUPT 0, P3.2)<br />
<br />
;main<br />
MAIN:&nbsp; &nbsp; &nbsp; &nbsp; ;INITIALIZE<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;INITIALIZE<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;INITIALIZE<br />
&nbsp; &nbsp; &nbsp; &nbsp; ACALL&nbsp; &nbsp; &nbsp; &nbsp; ADC0_L<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
;THESE SUBS ARE GOING TO ACTIVATE CHIP, TOGGLE CLOCK, AND GET DIGITAL VALUES STARTED.<br />
ADC0_L:&nbsp; &nbsp; &nbsp; &nbsp; CLR&nbsp; &nbsp; &nbsp; &nbsp; CS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;ACTIVATE CHIP<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV&nbsp; &nbsp; &nbsp; &nbsp; R0,#7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8 BIT COUNTER<br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB&nbsp; &nbsp; &nbsp; &nbsp; CLK<br />
&nbsp; &nbsp; &nbsp; &nbsp; ACALL&nbsp; &nbsp; &nbsp; &nbsp; GET_D0BYTE<br />
<br />
GET_D0BYTE:<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR&nbsp; &nbsp; &nbsp; &nbsp; CLK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;SET LOW<br />
REPEAT:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; SETB&nbsp; &nbsp; &nbsp; &nbsp; CLK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;SET HIGH<br />
&nbsp; &nbsp; &nbsp; &nbsp; CLR&nbsp; &nbsp; &nbsp; &nbsp; CLK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;TOGGLE LOW<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV&nbsp; &nbsp; &nbsp; &nbsp; C,D0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;MOV TO CARRY<br />
&nbsp; &nbsp; &nbsp; &nbsp; RRC&nbsp; &nbsp; &nbsp; &nbsp; A<br />
&nbsp; &nbsp; &nbsp; &nbsp; DJNZ&nbsp; &nbsp; &nbsp; &nbsp; R0,REPEAT<br />
&nbsp; &nbsp; &nbsp; &nbsp; JMP&nbsp; &nbsp; &nbsp; &nbsp; CALCULATE&nbsp; &nbsp; &nbsp; &nbsp; ;GO, CALCULATE VALUE<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
CALCULATE:<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV&nbsp; &nbsp; &nbsp; &nbsp; B,0C4H&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;C4 IS 196, WE WANT .0196 BUT THIS WILL DO<br />
&nbsp; &nbsp; &nbsp; &nbsp; MUL&nbsp; &nbsp; &nbsp; &nbsp; AB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;STEP VALUE TIMES WHATEVER OUR CHIP STORED IN ACCUMULATOR<br />
&nbsp; &nbsp; &nbsp; &nbsp; MOV&nbsp; &nbsp; &nbsp; &nbsp; R1,B&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;STORE B FOR A FEW<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ; unfinished<br />
END</pre><br />
Hello, This is my first time posting here, I hope I posted this right.  Thanks for taking the time to check this out and potentially help me out.  <br />
<br />
My goal of this program is to use the Atmel AT89C4051 paired with 7 segment led's (connected to port 1, digit selection for digits 0-4 tied to p1.7/p3.5/p3.4/p3.3 respectively), and help from a ADC0831 chip to create a digital volt meter.  <br />
<br />
I am only looking for 5 volt max reading with thousandths place accuracy (0.000) to be output to the led display.  My led code and wiring is fine (not displayed in code), my only issues are with the math and calculations in order to attain the proper voltage values.<br />
<br />
From my understanding of this chip I will activate the ADC0831 chip via chip select (active low) and then toggle the clock while reading pin d0.  d0 starts after the second clock low, and continues output on each successive low.  I handle this by storing the d0 value each time into carry, rotate carry into the accumulator a total of 8 times.  Now the value that d0 gives out is essentially the number that should be multiplied by the count, which from the chip will be 5/255, or a step count of 19.6 mV steps.<br />
<br />
******<br />
Lets say the value of d0 is 0A8Hex (168decimal).  In assembly Im assuming I want to make the step count value 196 or 0C4Hex and multiply the numbers together to get my voltage value (off by a factor of 4).  The true value should be .0196*168decimal=3.292Volts and should be displayed on the LED<br />
<br />
now here is my problem.  I dont quite understand how to multiply by 196 and get my factor of 4 decimal place error to the true value.  I have been stuck on this issue for a while and cannot find any help in my 8051 book.  Can anyone please show me or lead me in the right direction for this.  If you would like to email me feel free, its just my user name at gmail.  Thanks for your time.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>reedpride</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233924.html</guid>
		</item>
		<item>
			<title>Translating into MIPS from C</title>
			<link>http://www.daniweb.com/forums/thread233899.html</link>
			<pubDate>Tue, 27 Oct 2009 15:20:24 GMT</pubDate>
			<description><![CDATA[I cant figure out how to translate this code into MIPS. Any help or tips would be helpful. 
 
 int findMax (int numbers [ ], int count) 
{ 
int currentMax = -1; 
 
if (count > 0) 
{ 
currentMax= 0; 
int i = 1;]]></description>
			<content:encoded><![CDATA[<div>I cant figure out how to translate this code into MIPS. Any help or tips would be helpful.<br />
<br />
 int findMax (int numbers [ ], int count)<br />
{<br />
int currentMax = -1;<br />
<br />
if (count &gt; 0)<br />
{<br />
currentMax= 0;<br />
int i = 1;<br />
while (i &lt; count)<br />
{<br />
if (numbers[i] &gt; numbers [currentMax])<br />
currentMax = i;<br />
i = i + 1;<br />
}<br />
}<br />
return currentMax;<br />
}<br />
<br />
use $s1 for &quot;currentMax&quot; and $s2 for &quot;i&quot;</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Woady</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233899.html</guid>
		</item>
		<item>
			<title>Is there a good IDE for TASM?</title>
			<link>http://www.daniweb.com/forums/thread233554.html</link>
			<pubDate>Mon, 26 Oct 2009 18:54:27 GMT</pubDate>
			<description>Hello everyone. 
I was wondering if anyone could recomend me a good(and bugless) IDE or text editor I could use with TASM(notepad is not very comfortable for code writting)? 
 
Thank you. 
P.S. I use TASM 5</description>
			<content:encoded><![CDATA[<div>Hello everyone.<br />
I was wondering if anyone could recomend me a good(and bugless) IDE or text editor I could use with TASM(notepad is not very comfortable for code writting)?<br />
<br />
Thank you.<br />
P.S. I use TASM 5</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Arctic wolf</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233554.html</guid>
		</item>
		<item>
			<title>TSR Help...</title>
			<link>http://www.daniweb.com/forums/thread233279.html</link>
			<pubDate>Mon, 26 Oct 2009 00:37:01 GMT</pubDate>
			<description><![CDATA[I am trying to create an active TSR which prints an 'A' 
when the ESC key is pressed, it doesn't work. 
Can anyone tell me what's wrong? 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>I am trying to create an active TSR which prints an 'A'<br />
when the ESC key is pressed, it doesn't work.<br />
Can anyone tell me what's wrong?<br />
<br />
 <pre style="margin:20px; line-height:13px">bits 16<br />
org 100h<br />
<br />
jmp init.tsr<br />
<br />
int1c:<br />
push ds<br />
push ax<br />
push cs<br />
pop ds<br />
call checkdos2<br />
jc int1c_e<br />
cmp byte [hotkey_found], 1<br />
jnz int1c_e<br />
call tsrapp<br />
int1c_e:<br />
pop ax<br />
pop ds<br />
iret<br />
<br />
int28:<br />
push ds<br />
push ax<br />
push cs<br />
pop ds<br />
call checkdos<br />
jc int28_e<br />
cmp byte [hotkey_found], 1<br />
jnz int28_e<br />
call tsrapp<br />
int28_e:<br />
pop ax<br />
pop ds<br />
iret<br />
<br />
checkdos2:<br />
push bx<br />
push es<br />
les bx, [InDOS]<br />
mov al, 0<br />
cmp al, byte [es:bx]<br />
jb checkdos2_e<br />
cmp al, byte [es:bx-1]<br />
checkdos2_e:<br />
pop es<br />
pop bx<br />
ret<br />
<br />
checkdos:<br />
push bx<br />
push es<br />
les bx, [InDOS]<br />
mov al, 1<br />
cmp al, byte [es:bx]<br />
jb checkdos_e<br />
xor al, al<br />
cmp al, byte [es:bx-1]<br />
checkdos_e:<br />
pop es<br />
pop bx<br />
ret<br />
<br />
InDOS&nbsp; &nbsp; &nbsp; dd 0<br />
Orig_isr9&nbsp; dd 0<br />
in_isr9&nbsp; &nbsp; db 0<br />
hotkey_found db 0<br />
hotkey_idx dw 0<br />
hotseq&nbsp; &nbsp;  db 0x1b<br />
<br />
isr9:<br />
push ds<br />
push bx<br />
push ax<br />
push cs<br />
pop ds<br />
in al, 0x60<br />
pushf<br />
cli<br />
call word far [Orig_isr9]<br />
mov ah, [in_isr9]<br />
or ah, [hotkey_found]<br />
jnz isr9_e<br />
inc byte [in_isr9]<br />
cmp al, byte [hotseq]<br />
jz isr9_foundkey<br />
jmp isr9_exit<br />
isr9_foundkey:<br />
mov byte [hotkey_found], 1<br />
isr9_exit:<br />
dec byte [in_isr9]<br />
isr9_e:<br />
pop ax<br />
pop bx<br />
pop ds<br />
iret<br />
<br />
tsrapp:<br />
push dx<br />
mov ah, 0x2<br />
mov dl, 0x41<br />
int 0x21<br />
pop dx<br />
ret<br />
<br />
pre equ $<br />
<br />
init.tsr:<br />
mov ax, 0x3509<br />
int 0x21<br />
mov [Orig_isr9], bx<br />
mov [Orig_isr9+2], es<br />
mov dx, isr9<br />
mov ax, 0x2509<br />
int 0x21<br />
mov dx, int28<br />
mov ax, 0x2528<br />
int 0x21<br />
mov dx, int1c<br />
mov ax, 0x251c<br />
int 0x21<br />
mov ax, 0x3400<br />
int 0x21<br />
mov [InDOS], bx<br />
mov [InDOS+2], es<br />
mov dx, pre<br />
add dx, 0xf<br />
shr dx, 4<br />
mov ax, 0x3100<br />
int 0x21</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>NotNull</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233279.html</guid>
		</item>
		<item>
			<title>Pep</title>
			<link>http://www.daniweb.com/forums/thread233217.html</link>
			<pubDate>Sun, 25 Oct 2009 18:11:36 GMT</pubDate>
			<description><![CDATA[This is my first time looking at anything in Pep 8 machine language and i was wondering if someone could help me understand how to do these problems . I am supposed to find the output for each program. I know the answer for the first one but I don't know how to get that answer and on the second one...]]></description>
			<content:encoded><![CDATA[<div>This is my first time looking at anything in Pep 8 machine language and i was wondering if someone could help me understand how to do these problems . I am supposed to find the output for each program. I know the answer for the first one but I don't know how to get that answer and on the second one i am completely lost. <br />
I've seen 91 is Bitwise AND instruction and as a convert decimal instruction<br />
<br />
first problem<br />
 <pre style="margin:20px; line-height:13px">0000 C1000E; A: = first number<br />
0003 910010; ?<br />
0006 F1000D; Store the character<br />
0009 51000D; Char output<br />
000C 00; Stop <br />
000D 00; Character to output<br />
000E A94F; ?<br />
0010 FFFD; ?<br />
<br />
Output:<br />
M</pre><br />
<br />
Second problem<br />
 <pre style="margin:20px; line-height:13px">0000 C1000C; A: = first number<br />
0003 18; ?<br />
0004 F1000B; store the character<br />
0007 51000B; chararacter output<br />
000A 00; Stop<br />
000B 00; Character to outpute<br />
0010 F0D4; ?</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>G_buchCSC</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233217.html</guid>
		</item>
		<item>
			<title>Which method is the Correct one , got confused (8085)</title>
			<link>http://www.daniweb.com/forums/thread233190.html</link>
			<pubDate>Sun, 25 Oct 2009 16:02:41 GMT</pubDate>
			<description><![CDATA[hello sorry which method is the correct one we solved a question me and my friend in different methods and we went to our prof he said his method is the correct one and i  couldn't get his idea so this one the first one is my way of solution  
oh first of all the question :P  is to write a FUNCTION...]]></description>
			<content:encoded><![CDATA[<div>hello sorry which method is the correct one we solved a question me and my friend in different methods and we went to our prof he said his method is the correct one and i  couldn't get his idea so this one the first one is my way of solution <br />
oh first of all the question :P  is to write a FUNCTION ((xvy)^z)*2 and where x y and z are memory locations a000h,a001h,a0002h and store the result in a003 and a004 ( 8085)<br />
MY SOLUTION <br />
<span style="font-weight:bold">LXI H, A000H<br />
MOV A,M<br />
INX H<br />
ORA M <br />
INX H <br />
ANA M <br />
MVI B,02H<br />
MOV A,B<br />
LOOP : ADD B<br />
DCR B<br />
JNZ LOOP<br />
STA A003<br />
STA A004<br />
HLT </span><br />
. THAT WAS MY WAY AND PLZ IF THERE IS A MISTAKE JUST SHOW ME WHERE IS IT AND MY FRIEND SOLUTION WHICH IS THE CORRECT ONE :(<br />
<br />
<span style="font-weight:bold">MVI D,00H<br />
LXI H,A00H<br />
<span style="font-weight:bold">MOV A,M<br />
INX H<br />
ORA M<br />
INX H<br />
ANA M<br />
ADD A<br />
JNC LP<br />
INR D<br />
LP : INX H<br />
</span><br />
MOV M,A<br />
INX H<br />
MOV M,D<br />
HLT</span><br />
<br />
<br />
THNX IN ADVANCE GUYS</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>namour84</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233190.html</guid>
		</item>
		<item>
			<title>8051 codings for Controlling Movement of the Wheelchair using joystck</title>
			<link>http://www.daniweb.com/forums/thread232556.html</link>
			<pubDate>Fri, 23 Oct 2009 10:04:57 GMT</pubDate>
			<description>The wheelchair has four wheels, which consist 
of two rear wheels and two front wheels. The 
two front wheels are pivot wheel which are 
set free. There is no actuator which drives 
both front wheels. Thus, the front wheels can 
move freely in rotation and straight direction. 
Therefore, movement...</description>
			<content:encoded><![CDATA[<div>The wheelchair has four wheels, which consist<br />
of two rear wheels and two front wheels. The<br />
two front wheels are pivot wheel which are<br />
set free. There is no actuator which drives<br />
both front wheels. Thus, the front wheels can<br />
move freely in rotation and straight direction.<br />
Therefore, movement of the wheelchair can<br />
only be performed by driving the rear wheels.<br />
Diameter of the front wheel is 10 cm and<br />
diameter of the rear wheel is 22 cm. Two DC<br />
motor are used as the actuator of the<br />
wheelchair. One DC motor drives one rear<br />
wheel.<br />
Specifications of the DC motors are 20 V, 2 A,<br />
and 200 rpm. The DC motor that is used to<br />
actuate rear wheel, has its own gearbox to<br />
reduce the speed of the motor in the ratio of<br />
1:15. Then, speed of the motors is reduced again by using gears and chain system with ratio<br />
1:5. Thus, speed of the motor is totally reduced with ratio 1:75. On the contrary, the torque<br />
of the motor totally increases with ratio 1:75. Because the maximum gear box output speed<br />
of the DC motor is 200 rpm<br />
Joy stick controls the moving direction of the wheelchair (i.e. move forwards or backwards<br />
and turn left or right). Maximum carrying weight of automated wheelchair is 100kg. Once<br />
the weight limit is reached, alarm should be activated and blink a red bulb. Path should be<br />
recorded and store in memory.<br />
There should be a method to recall the path information and come back to the started<br />
location. There should be means to stop the wheelchair whenever an emergency situation is<br />
occurred. Wheelchair should stop if there are any obstacles. Speed of the motors can be<br />
controlled by varying the duty cycle of the PWM (Pulse Width Modulation) signals</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shihara</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232556.html</guid>
		</item>
		<item>
			<title>code for fan timer</title>
			<link>http://www.daniweb.com/forums/thread232530.html</link>
			<pubDate>Fri, 23 Oct 2009 07:37:42 GMT</pubDate>
			<description>hi.is there anyone can help me create a program using esa 8086 trainer kits..??the program need me to turn on the fan@LED for 10seconds and turn off it for 5 seconds..</description>
			<content:encoded><![CDATA[<div>hi.is there anyone can help me create a program using esa 8086 trainer kits..??the program need me to turn on the fan@LED for 10seconds and turn off it for 5 seconds..</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>amirnova</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232530.html</guid>
		</item>
		<item>
			<title>80x86 Word Memory Access</title>
			<link>http://www.daniweb.com/forums/thread232493.html</link>
			<pubDate>Fri, 23 Oct 2009 03:34:17 GMT</pubDate>
			<description>80X86 Speeding up word memory access. 
When the address of the first byte of a word lies 
at an odd address the processor must make two memory 
fetches for each byte of the word. 
But if the address of the first byte of the word lies 
at an even address the processor can pull in both bytes 
of the...</description>
			<content:encoded><![CDATA[<div>80X86 Speeding up word memory access.<br />
When the address of the first byte of a word lies<br />
at an odd address the processor must make two memory<br />
fetches for each byte of the word.<br />
But if the address of the first byte of the word lies<br />
at an even address the processor can pull in both bytes<br />
of the word in one memory fetch.<br />
<br />
If the first word of an array of words lies at an even<br />
address so will every other word in the array.<br />
1st Word__2nd Word__3rd Word<br />
|0100|0101|0102|0103|0104|0105<br />
 ^________^________^_______<br />
This speeds up performance when accessing an array<br />
of words.<br />
<br />
Assemblers usually provide an ALIGN directive to align<br />
a word at an even address.<br />
<br />
I was looking through the i386 arch manual on this, and<br />
it mentioned that there could be a slight increase in speed<br />
when the target address of control transfer instructions<br />
were evenly divisible by four, does this apply to the 8086/real-mode?<br />
<br />
<br />
Good day.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>NotNull</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232493.html</guid>
		</item>
		<item>
			<title>Changing current directory. Help.</title>
			<link>http://www.daniweb.com/forums/thread232368.html</link>
			<pubDate>Thu, 22 Oct 2009 17:08:13 GMT</pubDate>
			<description><![CDATA[Hello everybody. I'm trying to get the current directory, save it, changing the current dir, then coming back to the previous one. 
 
My code so far 
 
TITLE ep1_7 
	.MODEL    SMALL 
        .STACK    10h 
        .DATA 
        	msg	DB 'Current directory:',0h 
		msg_l	equ	$-msg]]></description>
			<content:encoded><![CDATA[<div>Hello everybody. I'm trying to get the current directory, save it, changing the current dir, then coming back to the previous one.<br />
<br />
My code so far<br />
 <pre style="margin:20px; line-height:13px">TITLE ep1_7<br />
&nbsp; &nbsp; &nbsp; &nbsp; .MODEL&nbsp; &nbsp; SMALL<br />
&nbsp; &nbsp; &nbsp; &nbsp; .STACK&nbsp; &nbsp; 10h<br />
&nbsp; &nbsp; &nbsp; &nbsp; .DATA<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg&nbsp; &nbsp; &nbsp; &nbsp; DB 'Current directory:',0h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg_l&nbsp; &nbsp; &nbsp; &nbsp; equ&nbsp; &nbsp; &nbsp; &nbsp; $-msg<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db&nbsp; 64 dup('$')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;f_handle&nbsp; &nbsp; &nbsp; &nbsp; dw&nbsp; 1 dup(?)<br />
&nbsp; &nbsp; &nbsp; &nbsp; .CODE<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin:&nbsp;  mov&nbsp; &nbsp; &nbsp; &nbsp; ax,@DATA<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ds,ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Getting current directory<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ah,47h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dl,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ds,buff<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;showing the returned pathname<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; dx,OFFSET buff<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; ah,09h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int&nbsp; 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;bail out<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; ax,4c00h&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int&nbsp; &nbsp; &nbsp; &nbsp; 21h&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; END&nbsp; &nbsp; &nbsp; &nbsp; begin</pre><br />
My problem is that i have an error at line 15. I don't know how to put the buffer's adress into ds. Can some one help me? <br />
<br />
Btw , please tell me what is the function that waits for a key to be pressed and/or the one that waits a certain given time to pass.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Alex_</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232368.html</guid>
		</item>
		<item>
			<title>Question regarding output</title>
			<link>http://www.daniweb.com/forums/thread232355.html</link>
			<pubDate>Thu, 22 Oct 2009 16:33:46 GMT</pubDate>
			<description>I have an assignment due for my Assembly class and I have a quick couple of questions regarding it. 
 
The requirement is initialize 3 variables as 16bit words with values (10, -60, 30) add those values as the following equation y = var1 + var2 + var3, use no more than 3 lines of code to produce...</description>
			<content:encoded><![CDATA[<div>I have an assignment due for my Assembly class and I have a quick couple of questions regarding it.<br />
<br />
The requirement is initialize 3 variables as 16bit words with values (10, -60, 30) add those values as the following equation y = var1 + var2 + var3, use no more than 3 lines of code to produce results. Show results in EAX register.<br />
<br />
Question #1: The professor gave us nothing to go off of to ensure we have our code done correctly, so can someone give me the display of the EAX register as it should display if I accomplish the above correctly? (no code, just a screen shot of the output).<br />
<br />
Here is the code I have so far:<br />
<br />
 <pre style="margin:20px; line-height:13px">.data<br />
arrayD WORD 10, -60, 30<br />
<br />
.code<br />
mov esi, OFFSET arrayD<br />
add eax, [esi]<br />
add eax, [esi]<br />
add eax, [esi]<br />
<br />
call DumpRegs<br />
call WaitMsg<br />
<br />
exit</pre>As you can see I have 4 lines of code to produce the results (at least I'm assuming the output is correct). What am I missing that would allow me to drop 1 line of code?<br />
<br />
Thanks.<br />
<br />
Oh and I realize there is lines missing from the above code, I left them out intentionally since they weren't relevant to my questions.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>RayvenHawk</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232355.html</guid>
		</item>
		<item>
			<title>Beginner SPIM Array help</title>
			<link>http://www.daniweb.com/forums/thread232122.html</link>
			<pubDate>Thu, 22 Oct 2009 01:15:26 GMT</pubDate>
			<description><![CDATA[I have an array a: .word 0:1000 and I don't understand how I can store/read values from it.  
 
For example if I do sw $v0, a($s1) where $s1 is 0 it goes through fine but when I increment $s1 to supposedly access the next space in the array it gives me these errors. 
 
  Exception 5  [Address error...]]></description>
			<content:encoded><![CDATA[<div>I have an array  <pre style="margin:20px; line-height:13px">a: .word 0:1000</pre> and I don't understand how I can store/read values from it. <br />
<br />
For example if I do  <pre style="margin:20px; line-height:13px">sw $v0, a($s1)</pre> where $s1 is 0 it goes through fine but when I increment $s1 to supposedly access the next space in the array it gives me these errors.<br />
<br />
  Exception 5  [Address error in store]  occurred and ignored<br />
  Exception 4  [Address error in inst/data fetch]  occurred and ignored<br />
<br />
edit: nvm I got it now :P</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>hwaforum</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232122.html</guid>
		</item>
		<item>
			<title>convert C to Mips</title>
			<link>http://www.daniweb.com/forums/thread232115.html</link>
			<pubDate>Thu, 22 Oct 2009 00:46:39 GMT</pubDate>
			<description>I am trying to convert some instruction to MIPS code. But have no idea how to do that.. i know c language so i can decode it to C but dont know how to convert it to MIPS.  
1.I need to write a main 
2. create an array of 10 integers 
3.Declare a variable 
4.make a loop to check if it is odd or even...</description>
			<content:encoded><![CDATA[<div>I am trying to convert some instruction to MIPS code. But have no idea how to do that.. i know c language so i can decode it to C but dont know how to convert it to MIPS. <br />
1.I need to write a main<br />
2. create an array of 10 integers<br />
3.Declare a variable<br />
4.make a loop to check if it is odd or even<br />
5. print a string saying &quot;it is odd or it is even creating if else statement<br />
6.and increment the variable.<br />
I can write C program for these. But what would it be in MIPS?<br />
<br />
 <pre style="margin:20px; line-height:13px">int main()<br />
{<br />
int array[10]={1,2,3,4,5,6,7,8,9,10};<br />
int i=0;<br />
while(i&lt;10){<br />
if(i%2==0)<br />
printf(&quot;It is even\n&quot;);<br />
else <br />
printf(&quot;it is odd\n&quot;);<br />
i=i+1;<br />
}<br />
return 0;<br />
}</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shopnobhumi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232115.html</guid>
		</item>
		<item>
			<title>help with assembly assignment</title>
			<link>http://www.daniweb.com/forums/thread232048.html</link>
			<pubDate>Wed, 21 Oct 2009 18:06:29 GMT</pubDate>
			<description><![CDATA[so I am working on an assignment in class, and I've hit a road block. the assignment is to replace certain letters (b, c) with others, (x, y). Right now, my program is not recognizing 'b' in ebx, and the second letter in the array, 'b', (stored in eax) as being the same, so it is not changing them....]]></description>
			<content:encoded><![CDATA[<div>so I am working on an assignment in class, and I've hit a road block. the assignment is to replace certain letters (b, c) with others, (x, y). Right now, my program is not recognizing 'b' in ebx, and the second letter in the array, 'b', (stored in eax) as being the same, so it is not changing them. I know im doing something wrong, but I can't figure out what. Any hints would be much appreciated, meanwhile i will keep plugging away at it. Also, I cannot get the new array in edx to show up without subtracting sixteen, and im not sure how to fix that so that is not necessary. Thanks so much. <br />
<br />
 <pre style="margin:20px; line-height:13px"><br />
INCLUDE Irvine32.inc<br />
.data<br />
&nbsp; &nbsp;  array byte 'a', 'b', 'c', 'd', 'e', 'f', 'a', 'b', 'c',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'd', 'e', 'f', 'a', 'b', 'c'<br />
&nbsp; &nbsp;  letter byte ?<br />
&nbsp; &nbsp;  newArray byte 15 dup (?)<br />
.code<br />
main PROC<br />
&nbsp; &nbsp;  mov ecx, lengthof array&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;moves ecx to beginning of array as a counter<br />
&nbsp; &nbsp;  mov esi, offset array&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;moves esi to the beginning of array to obtain letters<br />
&nbsp; &nbsp;  mov eax, &#91;esi&#93;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;moves first position of array into eax<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp;  doLoop:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;starts a loop<br />
&nbsp; &nbsp;  mov ebx, 'b'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;moves first letter comparison (b) into ebx<br />
&nbsp; &nbsp;  cmp ebx, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;compares letters<br />
&nbsp; &nbsp;  je check4C&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;if it is b, then jump to check for c<br />
&nbsp; &nbsp;  add edx, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;if not b, store first letter of newArray in edx<br />
&nbsp; &nbsp;  add esi, type array&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; increment esi to next letter in array<br />
<br />
&nbsp; &nbsp;  loop doLoop&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;loop back to the beginning<br />
&nbsp;  <br />
&nbsp; &nbsp;  mov edx, offset newArray<br />
&nbsp; &nbsp;  sub edx, 16<br />
<br />
&nbsp; &nbsp;  call writestring&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;print newArray string with new letters<br />
&nbsp; &nbsp;  call crlf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;enters a blank line<br />
&nbsp; &nbsp;  call waitmsg&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;waits til user closes screen<br />
&nbsp;  <br />
&nbsp; &nbsp;  exit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;exit<br />
&nbsp;  <br />
&nbsp; &nbsp;  check4C:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check for c<br />
&nbsp; &nbsp;  add edx, 'x'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;adds x for b into new array<br />
&nbsp; &nbsp;  add esi, type array&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;move esi down the array<br />
&nbsp; &nbsp;  mov eax, &#91;esi&#93;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;move esi into eax for next comparison<br />
&nbsp; &nbsp;  mov ebx, 'c'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;move c into ebx for comparison<br />
&nbsp; &nbsp;  cmp ebx, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;compare registers<br />
&nbsp; &nbsp;  je replace&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;if the letter is matches c go to replace<br />
&nbsp; &nbsp;  add edx, eax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;store next letter of newArray in edx<br />
&nbsp; &nbsp;  add esi, type array&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;move esi down the array<br />
&nbsp; &nbsp;  jmp doLoop&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;go to the top of the loop<br />
&nbsp;  <br />
&nbsp; &nbsp;  replace:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;replaces y for c<br />
&nbsp; &nbsp;  add edx, 'y'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;moves y into array instead of c<br />
&nbsp; &nbsp;  add esi, type array&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;move esi down the array<br />
&nbsp; &nbsp;  jmp doLoop&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;go to the top of the loop<br />
<br />
main ENDP&nbsp; <br />
<br />
END main</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>amw2326</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232048.html</guid>
		</item>
		<item>
			<title>add</title>
			<link>http://www.daniweb.com/forums/thread231985.html</link>
			<pubDate>Wed, 21 Oct 2009 14:12:32 GMT</pubDate>
			<description><![CDATA[I need to write a MIPS program will let the user to enter strings one per line representing valid decimal integers in the range 0 to 999999999999. I need to use 64 bits for each integer. and use some method to convert ascii to integer. here is an example that apparently does it.. but I don't...]]></description>
			<content:encoded><![CDATA[<div>I need to write a MIPS program will let the user to enter strings one per line representing valid decimal integers in the range 0 to 999999999999. I need to use 64 bits for each integer. and use some method to convert ascii to integer. here is an example that apparently does it.. but I don't understand it <br />
<br />
 <pre style="margin:20px; line-height:13px">&nbsp; &nbsp; &nbsp; &nbsp; addi&nbsp; &nbsp; &nbsp; &nbsp; $t3, $t1, -48&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Convert from ascii to integer<br />
&nbsp; &nbsp; &nbsp; &nbsp; mul&nbsp; &nbsp; &nbsp; &nbsp; $t2, $t2, $t4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Multiply to put integer in <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # right place</pre><br />
also I am not sure what is meant by using 64 bit integers?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231985.html</guid>
		</item>
		<item>
			<title>Machine relative offsets</title>
			<link>http://www.daniweb.com/forums/thread231897.html</link>
			<pubDate>Wed, 21 Oct 2009 07:57:05 GMT</pubDate>
			<description><![CDATA[I am trying to understand how assembly is translated into machine language. I understand how to get the machine coding formats but I'm not sure how to calculate 'rr' in all cases. For the example example bra is 20 rr or 20 03, I know that the relative offset is 03 to get to the iny instruction. But...]]></description>
			<content:encoded><![CDATA[<div>I am trying to understand how assembly is translated into machine language. I understand how to get the machine coding formats but I'm not sure how to calculate 'rr' in all cases. For the example example bra is 20 rr or 20 03, I know that the relative offset is 03 to get to the iny instruction. But I'm not sure why the rr = F3 for the dbne instruction, how does that relative offset get me to Again? A quick answer would be appreciated, I have a test tomorrow.<br />
<br />
Solution to sample problem:<br />
 <pre style="margin:20px; line-height:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; org $600&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ldy&nbsp; #Array&nbsp; &nbsp; &nbsp; &nbsp; ;CD B6 15<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ldaa&nbsp; #N&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;86 07<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clr&nbsp; &nbsp; &nbsp; 7,y&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;69 47<br />
Again&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  brclr&nbsp;  0,y %11110000, Not_gtr&nbsp; ;0F 40 F0 02<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bra&nbsp; &nbsp; Update&nbsp; &nbsp;  ;20 03<br />
Not_gtr&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inc&nbsp; &nbsp;  Count&nbsp; &nbsp; &nbsp;  ;72 B6 1C<br />
Update&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iny&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;02<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dbne&nbsp; a,Again&nbsp; &nbsp; ;04 30 F3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; swi&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
Array&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  fdb&nbsp;  8,7,2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
N&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  equ&nbsp;  7<br />
Count&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rmb&nbsp;  1</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>laguna92651</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231897.html</guid>
		</item>
		<item>
			<title><![CDATA[Counting 1's in 16 bit word]]></title>
			<link>http://www.daniweb.com/forums/thread231786.html</link>
			<pubDate>Tue, 20 Oct 2009 22:43:15 GMT</pubDate>
			<description><![CDATA[I am trying to count the number of 1's in a sixteen bit word for MC68HC12. The only way I can think of is to use 16 BITA instructions, one for each bit location, then increment a counter. I suspect there is a more elegant way to do this. Could someone share their ideas with me.]]></description>
			<content:encoded><![CDATA[<div>I am trying to count the number of 1's in a sixteen bit word for MC68HC12. The only way I can think of is to use 16 BITA instructions, one for each bit location, then increment a counter. I suspect there is a more elegant way to do this. Could someone share their ideas with me.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>laguna92651</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231786.html</guid>
		</item>
		<item>
			<title>convert number to ascii in mips?</title>
			<link>http://www.daniweb.com/forums/thread231765.html</link>
			<pubDate>Tue, 20 Oct 2009 20:50:37 GMT</pubDate>
			<description><![CDATA[I'm writing a function write_unsigned_int to convert a number to its ascii to write to a string buffer. So far I can only get it to write to the string buffer backwards. Should I create a new buffer and then reverse it after, or is there a simpler way to just write to the buffer in the right order?...]]></description>
			<content:encoded><![CDATA[<div>I'm writing a function write_unsigned_int to convert a number to its ascii to write to a string buffer. So far I can only get it to write to the string buffer backwards. Should I create a new buffer and then reverse it after, or is there a simpler way to just write to the buffer in the right order?<br />
<br />
 <pre style="margin:20px; line-height:13px">.data<br />
<br />
buffer: .space&nbsp; 200 <br />
.text<br />
<br />
main:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a1,&nbsp; &nbsp; &nbsp; &nbsp; buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a2, 231<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a0, 6<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jal&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write_unsigned_int<br />
exit:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addiu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $v0, $0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a0, buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addiu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $v0, $0, 10&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; syscall&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
<br />
write_unsigned_int:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # maxlength in $a0, buffer location in $a1, and number to be printed in $a2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addiu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $sp, $sp, -8<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sw&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $ra,0($sp)&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $s0, $0, $0 # t0 is the counter<br />
write_loop:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $t2, $0, $a2&nbsp; &nbsp; &nbsp; &nbsp; # load contents of number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $t3, $s0, $a1&nbsp; &nbsp; &nbsp; &nbsp; # load buffer<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addiu&nbsp; &nbsp; &nbsp; &nbsp; $t0, $0, 10<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; divu&nbsp; &nbsp; &nbsp; &nbsp; $a2, $t0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mfhi&nbsp; &nbsp; &nbsp; &nbsp; $t0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addi&nbsp; &nbsp; &nbsp; &nbsp; $t0, $t0, '0'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mflo&nbsp; &nbsp; &nbsp; &nbsp; $a2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $t0, 0($t3)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beq&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a2, $0, write_unsigned_int_done<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addi&nbsp; &nbsp; &nbsp; &nbsp; $s0, $s0, 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write_loop<br />
<br />
write_unsigned_int_done:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #sb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $a2, 0($t3)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lw&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ra,0($sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addiu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sp, $sp, 8<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $v0, $a0, $0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jr&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ra</pre><br />
thanks in advance!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>coni113</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231765.html</guid>
		</item>
		<item>
			<title>LOOPZ vs LOOPNZ</title>
			<link>http://www.daniweb.com/forums/thread231762.html</link>
			<pubDate>Tue, 20 Oct 2009 20:30:37 GMT</pubDate>
			<description>I am trying to get this program to use LOOPZ instead of LOOPNZ to find the first positive value in an array but I am not sure how to go about it.  Any hints or ideas behind doing it would be much appreciated.  This is the code below: 
 
.data 
array SWORD -3,-6,-1,-10,10,30,40,4 
sentinel SWORD 0 
...</description>
			<content:encoded><![CDATA[<div>I am trying to get this program to use LOOPZ instead of LOOPNZ to find the first positive value in an array but I am not sure how to go about it.  Any hints or ideas behind doing it would be much appreciated.  This is the code below:<br />
<br />
.data<br />
array SWORD -3,-6,-1,-10,10,30,40,4<br />
sentinel SWORD 0<br />
<br />
.code<br />
main PROC<br />
    mov esi,OFFSET array<br />
    mov ecx,LENGTHOF array<br />
next:<br />
	test WORD PTR [esi],8000h	; test sign bit<br />
	pushfd	; push flags on stack<br />
	add esi,TYPE array<br />
	popfd	; pop flags from stack<br />
	loopnz next	; continue loop<br />
	jnz quit	; none found<br />
	sub esi,TYPE array	; ESI points to value<br />
quit:</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>assembly101</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231762.html</guid>
		</item>
		<item>
			<title>hlt Instruction</title>
			<link>http://www.daniweb.com/forums/thread231489.html</link>
			<pubDate>Mon, 19 Oct 2009 21:24:24 GMT</pubDate>
			<description><![CDATA[Hello, 
I was just wondering if the hlt instruction would produce a blinking cursor at the command line until enter is pressed or if its use is not noticeable to the user. Google wasn't too helpful for the specifics of the instruction. Thanks!]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
I was just wondering if the hlt instruction would produce a blinking cursor at the command line until enter is pressed or if its use is not noticeable to the user. Google wasn't too helpful for the specifics of the instruction. Thanks!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>dmanw100</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231489.html</guid>
		</item>
		<item>
			<title>Question about arrays</title>
			<link>http://www.daniweb.com/forums/thread231266.html</link>
			<pubDate>Sun, 18 Oct 2009 23:51:51 GMT</pubDate>
			<description><![CDATA[I'm writing a program that takes input for an an array. It then uses a loop to replace the values in another array that has preset values with the values from the array that received input. 
 
When I try to move the values though...well let's say arrayA is the one with the preset values and arrayB...]]></description>
			<content:encoded><![CDATA[<div>I'm writing a program that takes input for an an array. It then uses a loop to replace the values in another array that has preset values with the values from the array that received input.<br />
<br />
When I try to move the values though...well let's say arrayA is the one with the preset values and arrayB is the one that has the inputted values. lw 	$t3, arrayB($t0) - yields an error, but lw $t3, arrayA($0) works. Is there another command that needs to be used when getting the value from an array that doesn't have preset content?<br />
<br />
 <pre style="margin:20px; line-height:13px">.data<br />
strOutput: .asciiz &quot;Input: &quot;<br />
arrayA: .word 1,2,3,4<br />
arrayB: .space 16<br />
.text&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; .globl main<br />
main:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp; $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp; $a0, strOutput<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp;  $t1,arrayB<br />
&nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp; $v0, 8<br />
&nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp; $a0, 0($t1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp; $v0, 8<br />
&nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp; $a0, 4($t1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp; $v0, 8<br />
&nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp; $a0, 8($t1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp; $v0, 8<br />
&nbsp; &nbsp; &nbsp; &nbsp; la&nbsp; &nbsp; &nbsp; &nbsp; $a0, 12($t1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; li&nbsp; &nbsp; &nbsp; &nbsp;  $t0, 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw&nbsp; &nbsp; &nbsp; &nbsp;  $t3, arrayB($t0)</pre><br />
I know it's very basic, but I don't know if I'm missing a command or something. Using PCSpim.<br />
<br />
And also the number replacement will be done with a loop hence why I'm using arrayB($t0) instead of something else...if that makes any sense at all.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>zmwg</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231266.html</guid>
		</item>
		<item>
			<title>EMU8086 OS Command Comparison</title>
			<link>http://www.daniweb.com/forums/thread231238.html</link>
			<pubDate>Sun, 18 Oct 2009 19:50:23 GMT</pubDate>
			<description><![CDATA[Okay, this is an annoying problem i'm making a command line operating system bootable from a floppy disk and the way i'm testing it atm is by inputting a command and outputting it. 
 
The reason for this is that i want to know EXACTLY what its doing with the string and how it is being referenced...]]></description>
			<content:encoded><![CDATA[<div>Okay, this is an annoying problem i'm making a command line operating system bootable from a floppy disk and the way i'm testing it atm is by inputting a command and outputting it.<br />
<br />
The reason for this is that i want to know EXACTLY what its doing with the string and how it is being referenced etc so that i can compare it with a list of commands. The code function 'check' doesnt work at the moment and is very messy what with me playing around with it alot.<br />
<br />
Code that would compare the inputted string with a command would be very helpful along with a thorough description OR a description of how i would go about it. <br />
<br />
Currently the code is:<br />
 <pre style="margin:20px; line-height:13px">;boot code<br />
;==========================================<br />
;Load boot directive<br />
#MAKE_BOOT#<br />
<br />
;Set boot memory address<br />
org 7c00h<br />
<br />
push cs ;cs = ds<br />
pop ds&nbsp; &nbsp; <br />
;==========================================<br />
;print welcome<br />
;==========================================&nbsp; &nbsp; &nbsp; <br />
&nbsp; <br />
begin:<br />
lea si,welcomeMessage<br />
call print&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
;==========================================<br />
;gets command<br />
;==========================================<br />
mov bh,0<br />
getCommand: <br />
&nbsp;lea si,message<br />
&nbsp;call print<br />
&nbsp;mov dx,offset buffer<br />
&nbsp;mov ah,0ah&nbsp; &nbsp; &nbsp; &nbsp;  ;read string subroutine<br />
&nbsp;int 21h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;get string<br />
&nbsp;call check<br />
&nbsp;jmp getCommand<br />
&nbsp;<br />
;==========================================<br />
;reboot<br />
;========================================== <br />
;store 'magic' number at 0040h:0072h<br />
; 0000h = cold reboot<br />
; 1234h = warm reboot<br />
mov ax, 0040h<br />
mov ds,ax<br />
mov w.[0072h],0000h<br />
jmp 0FFFFh:0000h ;reboot!<br />
<br />
;==========================================<br />
;procedures<br />
;==========================================<br />
<br />
print proc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;arguments: string is in SI<br />
&nbsp;nextChar:<br />
&nbsp; cmp b.[si],0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;check for null termination<br />
&nbsp; jz stop<br />
&nbsp; <br />
&nbsp; mov al,[si]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;get next char<br />
&nbsp; mov ah,0eh&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;teletype subroutine<br />
&nbsp; int 10h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;print<br />
&nbsp; inc si&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;next lesson<br />
&nbsp; jmp nextChar&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;type next char<br />
&nbsp;<br />
&nbsp;stop:&nbsp;  <br />
&nbsp; ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;return to caller<br />
print endp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
check proc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;arguments: string must be in SI<br />
&nbsp;getNo:<br />
&nbsp; lea di,help<br />
<br />
checkCom:<br />
&nbsp;xor bx,bx<br />
&nbsp;lea si,help<br />
&nbsp;mov bx,offset buffer - 1<br />
&nbsp;mov ah, 09<br />
temp:<br />
&nbsp;inc bx<br />
&nbsp;mov dx,[bx]<br />
&nbsp;int 21h<br />
&nbsp;cmp dx,0<br />
&nbsp;jnz temp<br />
&nbsp;ret&nbsp; &nbsp; <br />
check endp<br />
;==========================================<br />
;vars<br />
;==========================================<br />
lfcr equ 13,10,0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
<br />
welcomeMessage db &quot;Welcome to MYCROS!&quot;<br />
db 13,10, &quot;For a list of commands type 'help'&quot;<br />
db lfcr<br />
<br />
message db 13,10, &quot;Command: &quot;,0<br />
<br />
buffer db 50,50 dup &quot; &quot;<br />
<br />
help db &quot;help&quot;,0</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>jhouns</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231238.html</guid>
		</item>
		<item>
			<title>help with MIPS snprintf function?</title>
			<link>http://www.daniweb.com/forums/thread231222.html</link>
			<pubDate>Sun, 18 Oct 2009 18:12:00 GMT</pubDate>
			<description><![CDATA[I'm writing a project that's described here: 
http://inst.eecs.berkeley.edu/~cs61cl/fa09/projects/proj2.html 
 
Basically I parse through the *format string and when I see format specifiers like "%x" I insert the correct value that's part of the argument. I'm not sure how to start on this. More...]]></description>
			<content:encoded><![CDATA[<div>I'm writing a project that's described here:<br />
<a rel="nofollow" class="t" href="http://inst.eecs.berkeley.edu/~cs61cl/fa09/projects/proj2.html" target="_blank">http://inst.eecs.berkeley.edu/~cs61c...cts/proj2.html</a><br />
<br />
Basically I parse through the *format string and when I see format specifiers like &quot;%x&quot; I insert the correct value that's part of the argument. I'm not sure how to start on this. More specifically, I don't understand how to write to a string buffer. <br />
<br />
In the snprintf.s file they provide, they give me a line<br />
 <pre style="margin:20px; line-height:13px">buffer: .space&nbsp; 200</pre>so I understand to load the address in say a register $a0, but then what do I do after? Is it a syscall? how would I keep track of where I'm supposed to write to, since I'm passing a string buffer pointer to smaller functions to write the values in. <br />
<br />
Also I'm wondering if anyone has ideas on how to parse through the string, would I be reading character by character? (byte by byte) If so, how would I recognize the format specifiers? (%x)<br />
<br />
Thanks in advance!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>coni113</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231222.html</guid>
		</item>
		<item>
			<title>Assembly programming motorola 6800 ebook_example codes please...</title>
			<link>http://www.daniweb.com/forums/thread231200.html</link>
			<pubDate>Sun, 18 Oct 2009 15:50:49 GMT</pubDate>
			<description>could you help me to find example codes,online adresses,e-books etc.  about assembly language for motorola 6800 please.... 
 
 
thank for your helps....</description>
			<content:encoded><![CDATA[<div>could you help me to find example codes,online adresses,e-books etc.  about assembly language for <span style="color:Red">motorola 6800</span> please....<br />
<br />
<br />
thank for your helps....</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>assembly</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231200.html</guid>
		</item>
		<item>
			<title>divide overflow problem</title>
			<link>http://www.daniweb.com/forums/thread231199.html</link>
			<pubDate>Sun, 18 Oct 2009 15:48:46 GMT</pubDate>
			<description><![CDATA[<div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code Tags</a> </div> <div> <strong>Assembly Syntax</strong>...]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">MOV AH,DAY<br />
DIV DIVISOR<br />
CMP Al,'0'<br />
JE WEEK_<br />
JMP NOT_WEEK_</pre><br />
that is my code that tries to find out if the &quot;DAY&quot; is divisible by &quot;7&quot;, which is the DIVISOR..<br />
<br />
i initialized them as..<br />
 <pre style="margin:20px; line-height:13px">DAY&nbsp; &nbsp; &nbsp; &nbsp;  DB 1<br />
DIVISOR&nbsp; DB 7</pre><br />
when the &quot;day&quot; is divisible by 7, a 'divide oveflow' occurs..<br />
how do i get this right? thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>urbancalli</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231199.html</guid>
		</item>
		<item>
			<title>Displaying contents of registers..?</title>
			<link>http://www.daniweb.com/forums/thread231029.html</link>
			<pubDate>Sat, 17 Oct 2009 20:12:25 GMT</pubDate>
			<description><![CDATA[Hello, I'm having this little problem, and I will thank you if you help me with it. 
 
What I'm trying to do is to display the contents of various 16-bit registers (e.g. AX, BX, CX, DX), however without success; 
 
Well, what I tried to do is to check the total clusters and total free clusters on...]]></description>
			<content:encoded><![CDATA[<div>Hello, I'm having this little problem, and I will thank you if you help me with it.<br />
<br />
What I'm trying to do is to display the contents of various 16-bit registers (e.g. AX, BX, CX, DX), however without success;<br />
<br />
Well, what I tried to do is to check the total clusters and total free clusters on the hard-drive using DOS interrupt 21h and function 36h. It returns the number of total clusters into DX.<br />
<br />
I tried to print the DX using the function 09h of the same interrupt, however I'm getting gibberish whenever i'm trying to do so.<br />
<br />
In short - How can I convert number from registers such as AX or DX into strings, so I can print them to the screen?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Ronen444</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231029.html</guid>
		</item>
		<item>
			<title>why there is ascii code infront?</title>
			<link>http://www.daniweb.com/forums/thread230893.html</link>
			<pubDate>Sat, 17 Oct 2009 09:31:22 GMT</pubDate>
			<description><![CDATA[i am writing a assembly code to count the number of words in a sentence. 
below is my coding: 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with...]]></description>
			<content:encoded><![CDATA[<div>i am writing a assembly code to count the number of words in a sentence.<br />
below is my coding:<br />
 <pre style="margin:20px; line-height:13px">.model small<br />
.stack 200h<br />
.386<br />
.data<br />
<br />
message1 db 10,13, 'Word counter : Enter the sentence to be calculated$'<br />
result db 10,13, 'Number of words : $'<br />
counter db 5,6 dup(0)<br />
sentence db 10,13, 'hello world and me. $' <br />
<br />
.code<br />
<br />
Start:<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ax,seg message1<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ds,ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov dx,offset message1<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ah,09h<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ax,seg sentence<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ds,ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bx,offset sentence<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ax,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mov cx,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov di,2<br />
<br />
check1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov al,[bx+di]<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp al,'.'<br />
&nbsp; &nbsp; &nbsp; &nbsp; je check2<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp al,','<br />
&nbsp; &nbsp; &nbsp; &nbsp; je check2<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp al,' '<br />
&nbsp; &nbsp; &nbsp; &nbsp; je count<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp al,'$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; je done<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp skip<br />
<br />
check2:<br />
&nbsp; &nbsp; &nbsp; &nbsp; inc cx<br />
&nbsp; &nbsp; &nbsp; &nbsp; inc di<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov al,[bx+di]<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp al,' '<br />
&nbsp; &nbsp; &nbsp; &nbsp; je skip<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp check1<br />
<br />
skip:<br />
&nbsp; &nbsp; &nbsp; &nbsp; inc di<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp check1<br />
<br />
count:<br />
&nbsp; &nbsp; &nbsp; &nbsp; inc cx<br />
&nbsp; &nbsp; &nbsp; &nbsp; inc di<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp check1<br />
<br />
done:<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ax,cx<br />
&nbsp; &nbsp; &nbsp; &nbsp; aaa<br />
&nbsp; &nbsp; &nbsp; &nbsp; add ax,3030h<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp ah,30h<br />
&nbsp; &nbsp; &nbsp; &nbsp; je singleNumber<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp doubleNumber<br />
<br />
singleNumber:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bx,offset counter<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov [bx+2],al<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov al,'$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov [bx+3],al<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp print<br />
<br />
doubleNumber:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mov bx,offset counter<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov [bx+2],ah<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov [bx+3],al<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov al,'$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov [bx+4],al<br />
<br />
print:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov dx,offset result<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ah,09h<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov dx,offset counter<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov ah,09h<br />
&nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
<br />
.exit<br />
end start</pre>when i run it, there is a ascii symbol infront of the number of word.<br />
isit something wrong with my coding?<br />
please help.<br />
thank you</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>rayda</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230893.html</guid>
		</item>
		<item>
			<title>need help how about assebly error</title>
			<link>http://www.daniweb.com/forums/thread230870.html</link>
			<pubDate>Sat, 17 Oct 2009 05:24:41 GMT</pubDate>
			<description><![CDATA[i just want to ask how can i add a another value in this code 
this is for educational purpose and im not familiar with asm 
i know java programming but this is far different 
 
mov eax,[000003E8+100] crash my system 
 
honestly i dont know how to add in asm 
any one can help me here 
 
  <div...]]></description>
			<content:encoded><![CDATA[<div>i just want to ask how can i add a another value in this code<br />
this is for educational purpose and im not familiar with asm<br />
i know java programming but this is far different<br />
<br />
mov eax,[000003E8+100] crash my system<br />
<br />
honestly i dont know how to add in asm<br />
any one can help me here<br />
<br />
 <pre style="margin:20px; line-height:13px">d97aede:<br />
add eax,00<br />
alloc(newmem,256)<br />
label(returnhere)<br />
0D97AC8C:<br />
jmp newmem<br />
nop<br />
returnhere:<br />
newmem:<br />
label(empiesa)<br />
label(setea)<br />
label(sigue)<br />
label(resetea)<br />
alloc(Patiniox,4)<br />
jmp empiesa<br />
empiesa:<br />
cmp [Patiniox],00000000<br />
je setea<br />
jmp sigue<br />
setea:<br />
mov [Patiniox],00000001<br />
jmp empiesa<br />
sigue:<br />
inc [Patiniox]<br />
cmp [Patiniox],00000004<br />
je resetea<br />
jmp d97ac92<br />
resetea:<br />
mov [Patiniox],00000000<br />
jmp d97b2e4<br />
alloc(newmem2,128)<br />
label(returnhere2)<br />
label(originalcode2)<br />
label(exit2)<br />
d97afb5:<br />
jmp newmem2<br />
nop<br />
returnhere2:<br />
newmem2: <br />
mov eax,000003E8 <span style="color:Red">&lt;-- this part of the code how am i able to add another 100 value here its 1000 so i want to add 100</span> <br />
mov ecx,000003E8<br />
originalcode2:<br />
add esp,08<br />
mov ecx,[edi+08]<br />
exit2:<br />
jmp returnhere2</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>wilen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230870.html</guid>
		</item>
		<item>
			<title>Overflow with asr opcode</title>
			<link>http://www.daniweb.com/forums/thread230858.html</link>
			<pubDate>Sat, 17 Oct 2009 03:23:11 GMT</pubDate>
			<description>I am learning assembly on a MC68HC12. 
 
Can someone explain to me why the overflow flag, V=1, using the asr instruction on following binary number: 
 
%1111 0100 
the asr shift would be; 
%1111 1010 
V=1 
 
another example</description>
			<content:encoded><![CDATA[<div>I am learning assembly on a MC68HC12.<br />
<br />
Can someone explain to me why the overflow flag, V=1, using the asr instruction on following binary number:<br />
<br />
%1111 0100<br />
the asr shift would be;<br />
%1111 1010<br />
V=1<br />
<br />
another example<br />
%0000 0001<br />
the asr shift would be;<br />
%0000 0000<br />
why does V=1<br />
<br />
I think I understand how overflow works with addition and subtraction but haven't been able to find a good explanation for its implementation with the shift instructions. Any recommended reading?<br />
thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>laguna92651</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230858.html</guid>
		</item>
		<item>
			<title>if statement relative out of range. HELP</title>
			<link>http://www.daniweb.com/forums/thread230688.html</link>
			<pubDate>Fri, 16 Oct 2009 12:19:06 GMT</pubDate>
			<description><![CDATA[.model small 
.stack 64 
.data 
select db"Enter the your desired option$" 
msg1 db "[1]display box and your name$" 
msg2 db "[2]enter your name$" 
msg3 db "[3]display d to l$" 
msg4 db "[4]exit$" 
msg5 db "JOSEPHINE P.VINAS$"]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">.model small<br />
.stack 64<br />
.data<br />
select db&quot;Enter the your desired option$&quot;<br />
msg1 db &quot;&#91;1&#93;display box and your name$&quot;<br />
msg2 db &quot;&#91;2&#93;enter your name$&quot;<br />
msg3 db &quot;&#91;3&#93;display d to l$&quot;<br />
msg4 db &quot;&#91;4&#93;exit$&quot;<br />
msg5 db &quot;JOSEPHINE P.VINAS$&quot;<br />
.code<br />
mov ax,@data<br />
mov ds,ax<br />
<br />
mov ax,0003h<br />
int 10h<br />
<br />
mov ah,02<br />
mov dh,0<br />
mov dl,25<br />
int 10h<br />
<br />
<br />
mov ah, 09h<br />
lea dx, select<br />
int 21h<br />
<br />
mov ah,02<br />
mov dh,3<br />
mov dl,5<br />
int 10h<br />
<br />
mov ah, 09h<br />
lea dx, msg1<br />
int 21h<br />
<br />
mov ah,02<br />
mov dh,4<br />
mov dl,5<br />
int 10h<br />
<br />
mov ah, 09h<br />
lea dx, msg2<br />
int 21h<br />
<br />
mov ah,02<br />
mov dh,5<br />
mov dl,5<br />
int 10h<br />
<br />
<br />
mov ah, 09h<br />
lea dx, msg3<br />
int 21h<br />
<br />
mov ah,02<br />
mov dh,6<br />
mov dl,5<br />
int 10h<br />
<br />
mov ah, 09h<br />
lea dx, msg4<br />
int 21h<br />
<br />
mov ah,02<br />
mov dh,1<br />
mov dl,40<br />
int 10h<br />
<br />
mov ah,0ah<br />
int 21h<br />
<br />
cmp al,'1'<br />
je boxandyourname<br />
<br />
cmp al,'2'<br />
je enteryourname<br />
<br />
cmp al,'3'<br />
je displayDtoL<br />
<br />
<br />
<br />
jmp exit<br />
<br />
<br />
<br />
<br />
;--------------box code------------------------------------…<br />
boxandyourname:<br />
mov ah,02h<br />
mov dh,12<br />
mov dl,30<br />
int 10h<br />
<br />
<br />
mov ah,09h<br />
mov al,'_'<br />
mov bl,1eh<br />
mov cx,10<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,17<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'_'<br />
mov bl,1eh<br />
mov cx,10<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,13<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,14<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,15<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,16<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,17<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,13<br />
mov dl,39<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,14<br />
mov dl,39<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,15<br />
mov dl,39<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,16<br />
mov dl,39<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
mov ah,02h<br />
mov dh,17<br />
mov dl,39<br />
int 10h<br />
<br />
mov ah,09h<br />
mov al,'|'<br />
mov bl,1eh<br />
mov cx,1<br />
int 10h<br />
<br />
<br />
;-------------------name under box-------------------------------------…<br />
<br />
mov ah,02<br />
mov dh,20<br />
mov dl,27<br />
int 10h<br />
<br />
mov ah, 09h<br />
lea dx, msg5<br />
int 21h<br />
jmp exit<br />
;--------------------enter your name------------------------------------…<br />
<br />
enteryourname:<br />
mov ah,02<br />
mov dh,15<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,0ah<br />
int 21h<br />
jmp exit<br />
;----------display d to L----------------------------------<br />
displayDtoL:<br />
<br />
mov ah,02<br />
mov dh,10<br />
mov dl,30<br />
int 10h<br />
<br />
mov ah,02h<br />
mov cx,9<br />
mov dl,'D'<br />
<br />
X:<br />
int 21h<br />
inc dl<br />
loop X<br />
<br />
<br />
exit:<br />
mov ah, 4ch<br />
int 21h ;end of program<br />
end</pre>why I cannot out put this code it says &quot;relative jump out of range&quot;</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>masterjiraya</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230688.html</guid>
		</item>
		<item>
			<title>Big Issue with Assembly Startup</title>
			<link>http://www.daniweb.com/forums/thread230618.html</link>
			<pubDate>Fri, 16 Oct 2009 06:33:19 GMT</pubDate>
			<description><![CDATA[I've written this Hello World Software with much help in assembly using emu8086 emulator, I'm at chapter 5 of "The Art of Assembly" book and before I continue I need to be able to make this program bootable since I can't very well distribute emulated and virtual software. 
 
I haven't used a floppy...]]></description>
			<content:encoded><![CDATA[<div>I've written this Hello World Software with much help in assembly using emu8086 emulator, I'm at chapter 5 of &quot;The Art of Assembly&quot; book and before I continue I need to be able to make this program bootable since I can't very well distribute emulated and virtual software.<br />
<br />
I haven't used a floppy drive since the late 90's and I don't plan to use one since no stores around here have any, Virtual floppy drives have never worked in Windows Vista even under administrator mode not including the fact that my program is most likely going to grow over 2 MB.<br />
<br />
For over 4 day's I have been searching for a way to get this file onto a CD or just an ISO file for that matter. The emulator / compiler generates a bin (binary) file which I don't know how to copy onto the first sector.<br />
<br />
I tried to open is HEX Editor and pad it to 512 bytes with 00 and  the boot signature at the end renamed to .bif but Magic ISO could not import so I tried using IMGburn renamed to .img but it needed it to be 1048 bytes or something like that so after padding some more it said it was formatted wrong, there's got to be an easier way.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>wiseguy12851</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230618.html</guid>
		</item>
		<item>
			<title>mips cpu</title>
			<link>http://www.daniweb.com/forums/thread230505.html</link>
			<pubDate>Thu, 15 Oct 2009 21:05:42 GMT</pubDate>
			<description>anyone got any idea how does the CPU determines which register should receive the result produced   by an instruction? 
 
thanks</description>
			<content:encoded><![CDATA[<div>anyone got any idea how does the CPU determines which register should receive the result produced   by an instruction?<br />
<br />
thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230505.html</guid>
		</item>
		<item>
			<title>forgot how to repeat a character</title>
			<link>http://www.daniweb.com/forums/thread230412.html</link>
			<pubDate>Thu, 15 Oct 2009 14:33:13 GMT</pubDate>
			<description><![CDATA[can someone remind me how to loop a character please. I'm begging you all. 
 
my output must be this: 
 
*********************************************** 
*                                                                                          * 
*                                                  ...]]></description>
			<content:encoded><![CDATA[<div>can someone remind me how to loop a character please. I'm begging you all.<br />
<br />
my output must be this:<br />
<br />
***********************************************<br />
*                                                                                          *<br />
*                                                                                          *<br />
*                                                                                          *<br />
*                                                                                          *<br />
***********************************************<br />
<br />
i know how to set the color attribute for a character, my problem is I for got now on how to repeat the character by looping<br />
<br />
to mke it proven that It's not a copy paste from some where... I have the color palette here, the cursor position and and the repeatition of the color palette expansion<br />
[CODE]<br />
mov ah, 02<br />
mov dh, 03h<br />
mov dl, 01h<br />
int 10h<br />
<br />
mov ah,09h<br />
mov bl,2fh<br />
mov cx, 7<br />
int 10h<br />
[/ICODE]<br />
<br />
can some one tell me to remeber what should be added in looping a character</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>masterjiraya</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230412.html</guid>
		</item>
		<item>
			<title>floating point representation</title>
			<link>http://www.daniweb.com/forums/thread230396.html</link>
			<pubDate>Thu, 15 Oct 2009 13:10:57 GMT</pubDate>
			<description><![CDATA[here is an example of floating point representation ... I am unable to understand whats going on. book isnt much help except that I know the bias part and that the matissa is 23 bit and exponent is 8 bits. however I don't understand how the conversion is being done how the 0 and 1 are being...]]></description>
			<content:encoded><![CDATA[<div>here is an example of floating point representation ... I am unable to understand whats going on. book isnt much help except that I know the bias part and that the matissa is 23 bit and exponent is 8 bits. however I don't understand how the conversion is being done how the 0 and 1 are being generated. can some wise man/woman out there help me understand this... thanks<br />
<br />
Convert 0.1015625 to IEEE 32-bit floating point format.<br />
Converting:<br />
0.1015625	× 2 =	0.203125	0	Generate 0 and continue.<br />
0.203125	× 2 =	0.40625	0	Generate 0 and continue.<br />
0.40625	× 2 =	0.8125	0	Generate 0 and continue.<br />
0.8125	× 2 =	1.625	1	Generate 1 and continue with the rest.<br />
0.625	× 2 =	1.25	1	Generate 1 and continue with the rest.<br />
0.25	× 2 =	0.5	0	Generate 0 and continue.<br />
0.5	× 2 =	1.0	1	Generate 1 and nothing remains.<br />
So 0.101562510 = 0.00011012.<br />
Normalize: 0.00011012 = 1.1012 × 2-4.<br />
Mantissa is 10100000000000000000000, exponent is -4 + 127 = 123 = 011110112, sign bit is 0.<br />
So 0.1015625 is 00111101110100000000000000000000 = 3dd0000016</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230396.html</guid>
		</item>
		<item>
			<title>Help please</title>
			<link>http://www.daniweb.com/forums/thread230654.html</link>
			<pubDate>Thu, 15 Oct 2009 09:15:49 GMT</pubDate>
			<description><![CDATA[I HAVE AN .EXE FILE I WANT TO MESS AUROUND WITH 
BUT WHEN I OPEN IT WITH NOTEPAD ++ IT LOOKS LIKE THIS GARBAGE CRAP  
 
¦ª2'I¶ÛC„ ˆ¶­ÀÕSsÚ4eŒ˜¤ÂÇa1”¹²Ô9& 
Û¤éŽ3H ˜©5 †éØM¤•;L˜!S>@÷¤Æ@féRH @ôÆ8Óÿ‡ŠVÊÚ4‚¬(aÝ0&›Cm‹Ïnš´€Ø¦˜Á „l_IË+M4p¥9”¢lsXãCs[CB0É¶aHž|§&ÞPn­ÛØ...]]></description>
			<content:encoded><![CDATA[<div>I HAVE AN .EXE FILE I WANT TO MESS AUROUND WITH<br />
BUT WHEN I OPEN IT WITH NOTEPAD ++ IT LOOKS LIKE THIS GARBAGE CRAP <br />
<br />
¦ª2'I¶ÛC„ ˆ¶­ÀÕSsÚ4eŒ˜¤ÂÇa1”¹²Ô9&amp;<br />
Û¤éŽ3H ˜©5 †éØM¤•;L˜!S&gt;@÷¤Æ@féRH @ôÆ8Óÿ‡ŠVÊÚ4‚¬(aÝ0&amp;›Cm‹Ïnš´€Ø¦˜Á „l_IË+M4p¥9”¢lsXãCs[CB0É¶aHž|§&amp;ÞPn­ÛØ<br />
<br />
WHAT DO I NEED TO DO TO TRANSFORM IT INTO AN EASY TO READ SCRIPT OR LANGUAGE<br />
<br />
DO I ACTUALLY HAVE TO LEARN THIS LANGUAGE TO MESS AUROUND WITH AN EXE FILE QUITE HONESTLY THIS LANGUAGE IS CRAZY PLEASE REPLY ANY ADVICE WOULD HELP <br />
ALL THE BEST ANNONMISS</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>jedaprick</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230654.html</guid>
		</item>
		<item>
			<title>MIPS Assembly Lanuaguage programming</title>
			<link>http://www.daniweb.com/forums/thread230295.html</link>
			<pubDate>Thu, 15 Oct 2009 05:57:32 GMT</pubDate>
			<description>Can anyone please help me with this assignment.  Its due friday and i have no clue how to do. thanks in advance for your help. 
_____________________________________ 
Question 
Design a MIPS assembly language program to implement the multiplication algorithm of the diagram provided in the link...</description>
			<content:encoded><![CDATA[<div>Can anyone please help me with this assignment.  Its due friday and i have no clue how to do. thanks in advance for your help.<br />
_____________________________________<br />
Question<br />
Design a MIPS assembly language program to implement the multiplication algorithm of the diagram provided in the link below<br />
<br />
<a rel="nofollow" class="t" href="http://www.mediafire.com/imageview.php?quickkey=omz4myzonuq&amp;thumb=5" target="_blank">http://www.mediafire.com/imageview.p...yzonuq&amp;thumb=5</a><br />
<br />
Demo the program or show screenshots of its execution in an IDE.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>aks229</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230295.html</guid>
		</item>
		<item>
			<title>need pointers... anyone??</title>
			<link>http://www.daniweb.com/forums/thread230283.html</link>
			<pubDate>Thu, 15 Oct 2009 04:50:20 GMT</pubDate>
			<description>Write a main program for the MIPS machine that uses syscall to repeatedly prompt the user to enter strings one per line representing valid decimal integers in the range 0 to 999999999999. Use 64 bits for each integer. Valid strings may only contain the characters ‘0’ through ‘9’. All strings other...</description>
			<content:encoded><![CDATA[<div>Write a main program for the MIPS machine that uses syscall to repeatedly prompt the user to enter strings one per line representing valid decimal integers in the range 0 to 999999999999. Use 64 bits for each integer. Valid strings may only contain the characters ‘0’ through ‘9’. All strings other than valid decimal integers should be rejected. The numeric value indicated by each of the decimal strings should be added into a running 64-bit sum until a total of 10 strings have been entered or until the user indicates that there is no more input. The computed 64-bit sum should then be displayed on the console.<br />
<br />
This exercise involves converting between external and internal representation for input and between internal and external representation for output.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230283.html</guid>
		</item>
		<item>
			<title>changing interrupt vectors</title>
			<link>http://www.daniweb.com/forums/thread230278.html</link>
			<pubDate>Thu, 15 Oct 2009 03:56:35 GMT</pubDate>
			<description><![CDATA[Hi. I am trying to change an interrupt vector in assembly language to point to a new routine but can't quite figure out how to do it. I am trying to replace it as such: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>Hi. I am trying to change an interrupt vector in assembly language to point to a new routine but can't quite figure out how to do it. I am trying to replace it as such:<br />
<br />
 <pre style="margin:20px; line-height:13px"><br />
InterruptRoutine:<br />
<br />
&nbsp; mov ah,0x0<br />
&nbsp; int 0x16<br />
&nbsp; iret<br />
<br />
InstallInterrupt:<br />
<br />
&nbsp; mov ax,0x0<br />
&nbsp; mov es,ax<br />
&nbsp; mov di,Vector*4<br />
<br />
&nbsp; push cs<br />
&nbsp; pop ax<br />
&nbsp; stosw<br />
&nbsp; mov ax,InterruptRoutine<br />
&nbsp; stosw<br />
<br />
&nbsp; ret<br />
<br />
Vector dw 80</pre><br />
This is just an example, I'm actually attempting to change interrupt vector 0x1c, the timer. I am writing this as standalone code as i am attempting to write a mini-os, and this code will run at system boot so i cant use dos to do this for me. is this the correct way of doing this? If so, why isn't the timer firing under my new code? I have no clue what is going on here. And is this the right way to find the segment for the routine or is there a better way?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>xixpsychoxix</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230278.html</guid>
		</item>
		<item>
			<title>Could anyone please tell me?</title>
			<link>http://www.daniweb.com/forums/thread230272.html</link>
			<pubDate>Thu, 15 Oct 2009 03:33:38 GMT</pubDate>
			<description><![CDATA[What is a segment selector? 
How is "overflow" defined in assembly programming language? 
 
Thank you very much in advance!]]></description>
			<content:encoded><![CDATA[<div>What is a segment selector?<br />
How is &quot;overflow&quot; defined in assembly programming language?<br />
<br />
Thank you very much in advance!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>punchinello</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230272.html</guid>
		</item>
		<item>
			<title>can someone tell if this output is correct?</title>
			<link>http://www.daniweb.com/forums/thread230218.html</link>
			<pubDate>Wed, 14 Oct 2009 22:41:19 GMT</pubDate>
			<description>so i have this following code which does this simple thing in mips 
 
mult $t0, $t1 
 
$t0 = -763 
$t1 = 29 
 
when I move the values from hi and lo registers to $t2 and $t3 i get following values for each 
$t2 = -1  and $t3 = -22127</description>
			<content:encoded><![CDATA[<div>so i have this following code which does this simple thing in mips<br />
<br />
mult $t0, $t1<br />
<br />
$t0 = -763<br />
$t1 = 29<br />
<br />
when I move the values from hi and lo registers to $t2 and $t3 i get following values for each<br />
$t2 = -1  and $t3 = -22127<br />
<br />
is this correct??? can someone explain me why?<br />
<br />
here is the code<br />
<br />
<br />
 <pre style="margin:20px; line-height:13px"><br />
&nbsp; &nbsp; &nbsp; &nbsp; .text <br />
&nbsp; &nbsp; &nbsp; &nbsp; .globl main<br />
main:<br />
<br />
addi $t0,$zero,-763<br />
move $a0,$t0<br />
li $v0, 1<br />
syscall<br />
<br />
la $a0, plus<br />
li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; #print_string<br />
syscall<br />
<br />
addi $t1,$zero,29<br />
move $a0,$t1<br />
li $v0, 1<br />
syscall<br />
<br />
<br />
mult&nbsp; &nbsp; &nbsp; &nbsp; $t0,$t1<br />
<br />
mfhi $t2<br />
mflo $t3<br />
<br />
la $a0, t0equals<br />
li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; #print_string<br />
syscall<br />
<br />
move $a0,$t0<br />
li $v0, 1<br />
syscall<br />
<br />
<br />
la $a0, t1equals<br />
li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; #print_string<br />
syscall<br />
<br />
<br />
move $a0,$t1<br />
li $v0, 1<br />
syscall<br />
<br />
la $a0, t2equals<br />
li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; #print_string<br />
syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
move $a0,$t2<br />
li $v0, 1<br />
syscall<br />
<br />
la $a0, t3equals<br />
li $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; #print_string<br />
syscall<br />
<br />
move $a0,$t3<br />
li $v0, 1<br />
syscall<br />
<br />
li $v0, 10 # syscall code 10 is for exit.<br />
syscall <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; .data<br />
prompt:&nbsp; &nbsp; &nbsp; &nbsp;  .asciiz &quot;Please enter a (floating point) number: &quot;<br />
plus:&nbsp; &nbsp; &nbsp; &nbsp;  .asciiz &quot; + &quot;<br />
t0equals:&nbsp; &nbsp; &nbsp; &nbsp;  .asciiz &quot;\n t0 = &quot;<br />
t1equals:&nbsp; &nbsp; &nbsp; &nbsp;  .asciiz &quot;\n t1 = &quot;<br />
t3equals:&nbsp; &nbsp; &nbsp; &nbsp;  .asciiz &quot;\n t3 = &quot;<br />
t2equals:&nbsp; &nbsp; &nbsp; &nbsp;  .asciiz &quot;\n t2 = &quot;<br />
# end of add2.asm.</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230218.html</guid>
		</item>
		<item>
			<title>Looking for good Assembler/C++ programmer</title>
			<link>http://www.daniweb.com/forums/thread230196.html</link>
			<pubDate>Wed, 14 Oct 2009 20:17:36 GMT</pubDate>
			<description><![CDATA[Well i am new in this forum so i am not sure which section this topic should be in. 
 
I am running global server of mmorpg, and although the new "fixes" we tried and MHS blocking, they could still find a way to bypass it. 
 
therefor i need someone who knows well in this stuff to prevent it , and...]]></description>
			<content:encoded><![CDATA[<div>Well i am new in this forum so i am not sure which section this topic should be in.<br />
<br />
I am running global server of mmorpg, and although the new &quot;fixes&quot; we tried and MHS blocking, they could still find a way to bypass it.<br />
<br />
therefor i need someone who knows well in this stuff to prevent it , and to make an unhackable client.exe/login.exe for our server.<br />
<br />
he can do it for fun or for money, as he want.<br />
<br />
Please contact me Via messenger.<br />
<br />
<a href="mailto:digobest123@hotmail.com">digobest123@hotmail.com</a><br />
<br />
or send me PM<br />
<br />
Thanks.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Jony23</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230196.html</guid>
		</item>
		<item>
			<title>job</title>
			<link>http://www.daniweb.com/forums/thread230125.html</link>
			<pubDate>Wed, 14 Oct 2009 13:39:39 GMT</pubDate>
			<description>tahir ali</description>
			<content:encoded><![CDATA[<div>tahir ali</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>tahiralikhan</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230125.html</guid>
		</item>
		<item>
			<title>Command-line arguments?</title>
			<link>http://www.daniweb.com/forums/thread230098.html</link>
			<pubDate>Wed, 14 Oct 2009 10:55:17 GMT</pubDate>
			<description>Would anyone know how to get command-line arguments in NASM16? I am on a Windows XP. I have tried a great deal of things and spent much time searching for an answer to this. 
 
What I ment by command line arguments, something simple like this would be enough. 
 
Filename: Hello1 
Params: one two...</description>
			<content:encoded><![CDATA[<div>Would anyone know how to get command-line arguments in NASM16? I am on a Windows XP. I have tried a great deal of things and spent much time searching for an answer to this.<br />
<br />
What I ment by command line arguments, something simple like this would be enough.<br />
<br />
Filename: Hello1<br />
Params: one two three<br />
<br />
So when you type &quot;hello1 one two three&quot;, it would see that you typed &quot;one two three&quot;, and say something along the lines of<br />
<br />
Param 1: One<br />
Param 2: Two<br />
Param 3: Three<br />
<br />
I am really against using C libraries (I prefer to do everything purely in assembly).. So if it is possible to do it without C, I would really appreciate your time to answer.<br />
<br />
Someone may ask &quot;Why would you want to do this? Just use a higher level language.&quot;.. My short answer would be that I enjoy using assembly over a high level language, because of its complexity.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Goalatio</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230098.html</guid>
		</item>
		<item>
			<title>C equivalnet Assembly</title>
			<link>http://www.daniweb.com/forums/thread230008.html</link>
			<pubDate>Wed, 14 Oct 2009 04:39:13 GMT</pubDate>
			<description>Hi, 
 
i am presently working on C but there are some situations i need to know the assembly code of corresponding C program. 
 
if any can provide some general info of c - assembly it would be appreciated. 
 
i have a program called  
 
int main() 
{</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
i am presently working on C but there are some situations i need to know the assembly code of corresponding C program.<br />
<br />
if any can provide some general info of c - assembly it would be appreciated.<br />
<br />
i have a program called <br />
<br />
 <pre style="margin:20px; line-height:13px">int main()<br />
{<br />
&nbsp; &nbsp; &nbsp;  printf(&quot;Hello,Plz Help\n&quot;);<br />
&nbsp; &nbsp; &nbsp;  return 0;<br />
}</pre>if i run this program on Gcc compiler with -S option i could see some assembly instructions.<br />
<br />
this is what it is generating . but i am unable to understand <br />
it.below are few questions.<br />
 <pre style="margin:20px; line-height:13px">.file&nbsp;  &quot;assm-c.c&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section&nbsp; &nbsp; &nbsp; &nbsp; .rodata<br />
.LC0:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .string &quot;Hello, Plz help\n&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; .text<br />
.globl main<br />
&nbsp; &nbsp; &nbsp; &nbsp; .type&nbsp;  main,@function<br />
main:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp;  %ebp<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; %esp, %ebp<br />
&nbsp; &nbsp; &nbsp; &nbsp; subl&nbsp; &nbsp; $8, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; andl&nbsp; &nbsp; $-16, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; $0, %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; subl&nbsp; &nbsp; %eax, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; subl&nbsp; &nbsp; $12, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp;  $.LC0<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; printf<br />
&nbsp; &nbsp; &nbsp; &nbsp; addl&nbsp; &nbsp; $16, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; $0, %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; leave<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<br />
.Lfe1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .size&nbsp;  main,.Lfe1-main<br />
&nbsp; &nbsp; &nbsp; &nbsp; .ident&nbsp; &quot;GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)&quot;</pre><br />
what is .rodata<br />
what is .LC0<br />
and what is the procedure that is written in main:<br />
it may be internal processor dependent what it is generating here.<br />
but i want to know what are the general things that are done when converting to assembly.<br />
<br />
<br />
i have some idea with fucntions<br />
when ever a function is called .<br />
1.push the arguments from right to left into the stack ( meaning allocate memory on stack)<br />
2.push the return address of the function(caller's address)<br />
3.push the base address of functions(caller' s again)<br />
4. allocate memory for the locals.<br />
<br />
and when the function returns clering the contents from the stack(dont have idea what does this mean)<br />
<br />
is the above procedure correct or do i need to make any changes.<br />
<br />
requesting you to guide me in correcting my mistakes and furthur updations.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Gaiety</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230008.html</guid>
		</item>
		<item>
			<title>Auxiliary Carry Flag Help</title>
			<link>http://www.daniweb.com/forums/thread229978.html</link>
			<pubDate>Wed, 14 Oct 2009 01:04:40 GMT</pubDate>
			<description>I am trying to find out if the Auxiliary carry flag only turns on when the 4th bit carries out from the 3rd bit or if it will turn on for the 7th to 8th bit aswell. This is what I did already: 
 
mov ax, 0Fh     ; this is the test for the 3rd to 4th 
add ax, 1          ; AC=1 
 
 
mov ax, 00F0h    ...</description>
			<content:encoded><![CDATA[<div>I am trying to find out if the Auxiliary carry flag only turns on when the 4th bit carries out from the 3rd bit or if it will turn on for the 7th to 8th bit aswell. This is what I did already:<br />
<br />
mov ax, 0Fh     ; this is the test for the 3rd to 4th<br />
add ax, 1          ; AC=1<br />
<br />
<br />
mov ax, 00F0h      ; this is the test for the 7th to 8th<br />
add ax, 0010h      ; not sure if this should set AC=1</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>assembly101</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229978.html</guid>
		</item>
		<item>
			<title>total rookie,pls help me</title>
			<link>http://www.daniweb.com/forums/thread229854.html</link>
			<pubDate>Tue, 13 Oct 2009 15:02:05 GMT</pubDate>
			<description><![CDATA[Hi , i want to write Mips Assembly code to increment the elements of an array. i've written this : 
#AIncrement.s -- A program that increments the elements of an array 
################################## 
main: 
.data 
 
list : .word   0, 1, 2, 3, 4, 5, 6, 7, 8, 9 
.text  
move $t4,$zero 
addi   ...]]></description>
			<content:encoded><![CDATA[<div>Hi , i want to write Mips Assembly code to increment the elements of an array. i've written this :<br />
#AIncrement.s -- A program that increments the elements of an array<br />
##################################<br />
main:<br />
.data<br />
<br />
list : .word   0, 1, 2, 3, 4, 5, 6, 7, 8, 9<br />
.text <br />
move $t4,$zero<br />
addi    $t4,$t4,1<br />
addi    $t4,$t4,1<br />
addi    $t4,$t4,1<br />
addi    $t4,$t4,1<br />
Loop:<br />
<br />
    la $s0, list                # put address of list into $s0<br />
    move $t3,$zero        # loop variable= 0  int i = 0       <br />
    add $t1,$t3,$t3        #Temp reg $t1 = 2 *  i<br />
    add $t1,$t1,$t1        #Temp reg $t1 = 4 *  i<br />
    add $t1,$t1,$s0        #$t1 = address of A[i]<br />
    lw $t0,0($s0)            #Temporary reg $t0 = A[i]<br />
    addi $t0,$t0,1           #incrementing<br />
    sw  $t0,0($s0)<br />
    addi $t3,$t3,1<br />
    bne  $t3,$t4,Loop<br />
   <br />
li  $v0,10<br />
syscall<br />
#end of the program<br />
########################<br />
When i use SPIM simulator the file is successfully loaded, but when i <br />
hit the go button just nothing happens, is there anything wrong with my code ? <br />
<br />
thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>helinix</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229854.html</guid>
		</item>
		<item>
			<title>Array input question in assembly</title>
			<link>http://www.daniweb.com/forums/thread229634.html</link>
			<pubDate>Mon, 12 Oct 2009 21:12:57 GMT</pubDate>
			<description>I would like to be able to have the user input a 1 or 0 and have whatever was inputted into an array. Here is what I have so far. 
 
.model small 
 
.stack 100h 
 
.code 
 
start: 
my_arr db ?</description>
			<content:encoded><![CDATA[<div>I would like to be able to have the user input a 1 or 0 and have whatever was inputted into an array. Here is what I have so far.<br />
<br />
.model small<br />
<br />
.stack 100h<br />
<br />
.code<br />
<br />
start:<br />
my_arr db ?<br />
mov dl, [my_arr]<br />
mov [my_arr], al<br />
add dl, '0' <br />
mov	ah, 2h<br />
int 21h<br />
<br />
end start<br />
<br />
Basically I'm trying to get it to input into the array, then testing if the it worked by outputting the first element in the array. Right now all it outputs is N..which I'm assuming stands for null meaning nothing is being inputted in the array based on this code. Can somebody help me out?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>heat89</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229634.html</guid>
		</item>
		<item>
			<title>floating point syscall</title>
			<link>http://www.daniweb.com/forums/thread229609.html</link>
			<pubDate>Mon, 12 Oct 2009 18:59:33 GMT</pubDate>
			<description>what is READ_FLT? any thoughts on the question? 
 
 
If a program employs a READ_FLT syscall to input the floating point value 999999999999.0, by how much would the value returned by the syscall differ from the actual value typed in? Explain the error, if any.</description>
			<content:encoded><![CDATA[<div>what is READ_FLT? any thoughts on the question?<br />
<br />
<br />
If a program employs a READ_FLT syscall to input the floating point value 999999999999.0, by how much would the value returned by the syscall differ from the actual value typed in? Explain the error, if any.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229609.html</guid>
		</item>
		<item>
			<title>Assembly inside a C++ program</title>
			<link>http://www.daniweb.com/forums/thread229592.html</link>
			<pubDate>Mon, 12 Oct 2009 17:17:25 GMT</pubDate>
			<description><![CDATA[Hello, 
I have a program, let's say foo.cpp . If I do "g++ -S foo.cpp". That generates the file "foo.S" with assembly code. I would like to compare the assembly code foo.S with the assembly code generated if I put foo.S in a c program (even though there should be no difference), but I don't know...]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
I have a program, let's say foo.cpp . If I do &quot;g++ -S foo.cpp&quot;. That generates the file &quot;foo.S&quot; with assembly code. I would like to compare the assembly code foo.S with the assembly code generated if I put foo.S in a c program (even though there should be no difference), but I don't know how to do it. For foo.cpp = <br />
 <pre style="margin:20px; line-height:13px">#include &lt;iostream&gt;<br />
<br />
using namespace std;<br />
int main() {<br />
&nbsp; cout &lt;&lt; &quot;a47&quot; &lt;&lt; endl;<br />
&nbsp; return 0;<br />
}</pre>for example, I get foo.S = <br />
 <pre style="margin:20px; line-height:13px">&nbsp; &nbsp; &nbsp; &nbsp; .mod_init_func<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 2<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; __GLOBAL__I_main<br />
.lcomm __ZSt8__ioinit,1,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .cstring<br />
LC0:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .ascii &quot;a\0&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; .text<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 1,0x90<br />
.globl _main<br />
_main:<br />
LFB1480:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp; &nbsp; &nbsp; &nbsp; %ebp<br />
LCFI0:<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %esp, %ebp<br />
LCFI1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
LCFI2:<br />
&nbsp; &nbsp; &nbsp; &nbsp; subl&nbsp; &nbsp; &nbsp; &nbsp; $20, %esp<br />
LCFI3:<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L3<br />
&quot;L00000000001$pb&quot;:<br />
L3:<br />
&nbsp; &nbsp; &nbsp; &nbsp; popl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
&nbsp; &nbsp; &nbsp; &nbsp; leal&nbsp; &nbsp; &nbsp; &nbsp; LC0-&quot;L00000000001$pb&quot;(%ebx), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, 4(%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; leal&nbsp; &nbsp; &nbsp; &nbsp; L__ZSt4cout$non_lazy_ptr-&quot;L00000000001$pb&quot;(%ebx), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; (%eax), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, (%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc$stub<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, %edx<br />
&nbsp; &nbsp; &nbsp; &nbsp; leal&nbsp; &nbsp; &nbsp; &nbsp; L__ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_$non_lazy_ptr-&quot;L00000000001$pb&quot;(%ebx), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; (%eax), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, 4(%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %edx, (%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L__ZNSolsEPFRSoS_E$stub<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; $0, %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; addl&nbsp; &nbsp; &nbsp; &nbsp; $20, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; popl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
&nbsp; &nbsp; &nbsp; &nbsp; leave<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<br />
LFE1480:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 1,0x90<br />
___tcf_0:<br />
LFB1489:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp; &nbsp; &nbsp; &nbsp; %ebp<br />
LCFI4:<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %esp, %ebp<br />
LCFI5:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
LCFI6:<br />
&nbsp; &nbsp; &nbsp; &nbsp; subl&nbsp; &nbsp; &nbsp; &nbsp; $20, %esp<br />
LCFI7:<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L6<br />
&quot;L00000000002$pb&quot;:<br />
L6:<br />
&nbsp; &nbsp; &nbsp; &nbsp; popl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
&nbsp; &nbsp; &nbsp; &nbsp; leal&nbsp; &nbsp; &nbsp; &nbsp; __ZSt8__ioinit-&quot;L00000000002$pb&quot;(%ebx), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, (%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L__ZNSt8ios_base4InitD1Ev$stub<br />
&nbsp; &nbsp; &nbsp; &nbsp; addl&nbsp; &nbsp; &nbsp; &nbsp; $20, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; popl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
&nbsp; &nbsp; &nbsp; &nbsp; leave<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<br />
LFE1489:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __TEXT,__StaticInit,regular,pure_instructions<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 1<br />
__Z41__static_initialization_and_destruction_0ii:<br />
LFB1488:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp; &nbsp; &nbsp; &nbsp; %ebp<br />
LCFI8:<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %esp, %ebp<br />
LCFI9:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
LCFI10:<br />
&nbsp; &nbsp; &nbsp; &nbsp; subl&nbsp; &nbsp; &nbsp; &nbsp; $36, %esp<br />
LCFI11:<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L12<br />
&quot;L00000000003$pb&quot;:<br />
L12:<br />
&nbsp; &nbsp; &nbsp; &nbsp; popl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, -12(%ebp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %edx, -16(%ebp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmpl&nbsp; &nbsp; &nbsp; &nbsp; $65535, -16(%ebp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; jne&nbsp; &nbsp; &nbsp; &nbsp; L11<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmpl&nbsp; &nbsp; &nbsp; &nbsp; $1, -12(%ebp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; jne&nbsp; &nbsp; &nbsp; &nbsp; L11<br />
&nbsp; &nbsp; &nbsp; &nbsp; leal&nbsp; &nbsp; &nbsp; &nbsp; __ZSt8__ioinit-&quot;L00000000003$pb&quot;(%ebx), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, (%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L__ZNSt8ios_base4InitC1Ev$stub<br />
&nbsp; &nbsp; &nbsp; &nbsp; leal&nbsp; &nbsp; &nbsp; &nbsp; L___dso_handle$non_lazy_ptr-&quot;L00000000003$pb&quot;(%ebx), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; (%eax), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, 8(%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; $0, 4(%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; leal&nbsp; &nbsp; &nbsp; &nbsp; ___tcf_0-&quot;L00000000003$pb&quot;(%ebx), %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %eax, (%esp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; L___cxa_atexit$stub<br />
L11:<br />
&nbsp; &nbsp; &nbsp; &nbsp; addl&nbsp; &nbsp; &nbsp; &nbsp; $36, %esp<br />
&nbsp; &nbsp; &nbsp; &nbsp; popl&nbsp; &nbsp; &nbsp; &nbsp; %ebx<br />
&nbsp; &nbsp; &nbsp; &nbsp; leave<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<br />
LFE1488:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 1<br />
__GLOBAL__I_main:<br />
LFB1490:<br />
&nbsp; &nbsp; &nbsp; &nbsp; pushl&nbsp; &nbsp; &nbsp; &nbsp; %ebp<br />
LCFI12:<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; %esp, %ebp<br />
LCFI13:<br />
&nbsp; &nbsp; &nbsp; &nbsp; subl&nbsp; &nbsp; &nbsp; &nbsp; $8, %esp<br />
LCFI14:<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; $65535, %edx<br />
&nbsp; &nbsp; &nbsp; &nbsp; movl&nbsp; &nbsp; &nbsp; &nbsp; $1, %eax<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; __Z41__static_initialization_and_destruction_0ii<br />
&nbsp; &nbsp; &nbsp; &nbsp; leave<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<br />
LFE1490:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support<br />
EH_frame1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$0,LECIE1-LSCIE1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$0<br />
LSCIE1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; 0x0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .ascii &quot;zPR\0&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x7c<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x8<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x6<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x9b<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; L___gxx_personality_v0$non_lazy_ptr-.<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x10<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xc<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x5<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x88<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 2<br />
LECIE1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .globl _main.eh<br />
_main.eh:<br />
LSFDE1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$1,LEFDE1-LASFDE1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$1<br />
LASFDE1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LASFDE1-EH_frame1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LFB1480-.<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$2,LFE1480-LFB1480<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$2<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$3,LCFI0-LFB1480<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$3<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xe<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x8<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x84<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x2<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$4,LCFI1-LCFI0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xd<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$5,LCFI3-LCFI1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$5<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x83<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x3<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 2<br />
LEFDE1:<br />
___tcf_0.eh:<br />
LSFDE3:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$6,LEFDE3-LASFDE3<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$6<br />
LASFDE3:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LASFDE3-EH_frame1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LFB1489-.<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$7,LFE1489-LFB1489<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$7<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$8,LCFI4-LFB1489<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$8<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xe<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x8<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x84<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x2<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$9,LCFI5-LCFI4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$9<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xd<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$10,LCFI7-LCFI5<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$10<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x83<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x3<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 2<br />
LEFDE3:<br />
__Z41__static_initialization_and_destruction_0ii.eh:<br />
LSFDE5:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$11,LEFDE5-LASFDE5<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$11<br />
LASFDE5:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LASFDE5-EH_frame1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LFB1488-.<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$12,LFE1488-LFB1488<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$12<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$13,LCFI8-LFB1488<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$13<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xe<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x8<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x84<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x2<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$14,LCFI9-LCFI8<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$14<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xd<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$15,LCFI11-LCFI9<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$15<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x83<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x3<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 2<br />
LEFDE5:<br />
__GLOBAL__I_main.eh:<br />
LSFDE7:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$16,LEFDE7-LASFDE7<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$16<br />
LASFDE7:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LASFDE7-EH_frame1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; LFB1490-.<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$17,LFE1490-LFB1490<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$17<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$18,LCFI12-LFB1490<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$18<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xe<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x8<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x84<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x2<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .set L$set$19,LCFI13-LCFI12<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long L$set$19<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0xd<br />
&nbsp; &nbsp; &nbsp; &nbsp; .byte&nbsp; &nbsp; &nbsp; &nbsp; 0x4<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 2<br />
LEFDE7:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5<br />
L___cxa_atexit$stub:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol ___cxa_atexit<br />
&nbsp; &nbsp; &nbsp; &nbsp; hlt ; hlt ; hlt ; hlt ; hlt<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __IMPORT,__pointers,non_lazy_symbol_pointers<br />
L__ZSt4cout$non_lazy_ptr:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol __ZSt4cout<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5<br />
L__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc$stub:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol __ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc<br />
&nbsp; &nbsp; &nbsp; &nbsp; hlt ; hlt ; hlt ; hlt ; hlt<br />
L__ZNSolsEPFRSoS_E$stub:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol __ZNSolsEPFRSoS_E<br />
&nbsp; &nbsp; &nbsp; &nbsp; hlt ; hlt ; hlt ; hlt ; hlt<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __IMPORT,__pointers,non_lazy_symbol_pointers<br />
L__ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_$non_lazy_ptr:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; 0<br />
L___dso_handle$non_lazy_ptr:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol ___dso_handle<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5<br />
L__ZNSt8ios_base4InitD1Ev$stub:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol __ZNSt8ios_base4InitD1Ev<br />
&nbsp; &nbsp; &nbsp; &nbsp; hlt ; hlt ; hlt ; hlt ; hlt<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __IMPORT,__pointers,non_lazy_symbol_pointers<br />
L___gxx_personality_v0$non_lazy_ptr:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol ___gxx_personality_v0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .long&nbsp; &nbsp; &nbsp; &nbsp; 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5<br />
L__ZNSt8ios_base4InitC1Ev$stub:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .indirect_symbol __ZNSt8ios_base4InitC1Ev<br />
&nbsp; &nbsp; &nbsp; &nbsp; hlt ; hlt ; hlt ; hlt ; hlt<br />
&nbsp; &nbsp; &nbsp; &nbsp; .constructor<br />
&nbsp; &nbsp; &nbsp; &nbsp; .destructor<br />
&nbsp; &nbsp; &nbsp; &nbsp; .align 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; .subsections_via_symbols</pre><br />
<br />
I thought this would work, but it doesn't:<br />
<br />
 <pre style="margin:20px; line-height:13px">asm(&quot; ** ALL THE ASSEMBLY CODE ABOVE ** &quot;);</pre>A friend suggested me to use <br />
perl -pi~ -e ’s/\&quot;/\\\&quot;/g; s/(.*)/\&quot;$1\\\n\&quot;/ig’ foo.s<br />
but it didn't work either.<br />
Does anyone know how to do this? Thank you in advance!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>ubuntuubuntu</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229592.html</guid>
		</item>
		<item>
			<title>help with question</title>
			<link>http://www.daniweb.com/forums/thread229553.html</link>
			<pubDate>Mon, 12 Oct 2009 14:09:10 GMT</pubDate>
			<description>hi.. can someone help me with this question 
 
Write down a sequence of instructions that would implement the synthetic instruction addd $t0,$t2 to produce a double precision sum (i.e. 64-bit sum) of two unsigned 64-bit integers. The first 64-bit integer is in the register pair $t0 and $t1, while...</description>
			<content:encoded><![CDATA[<div>hi.. can someone help me with this question<br />
<br />
Write down a sequence of instructions that would implement the synthetic instruction addd $t0,$t2 to produce a double precision sum (i.e. 64-bit sum) of two unsigned 64-bit integers. The first 64-bit integer is in the register pair $t0 and $t1, while the second 64-bit integer is in the register pair $t2 and $t3 (the even numbered register in each pair contains the most significant bits). The result should be left in the $t0,$t1 register pair. Your solution should not modify any registers other than $t0 and $t1 ( and $1 if needed). Nor should your solution involve any type of branch or jump instruction.<br />
<br />
<br />
I understand that synthetic instructions are like<br />
<br />
add $t1,$t0,$a1<br />
<br />
since the question is asking for sum of two unsigned 64 bit integers..  what does that mean? aren't unsigned integers 32 bit?<br />
thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229553.html</guid>
		</item>
		<item>
			<title>Changing Text Colour with NASM Assembly</title>
			<link>http://www.daniweb.com/forums/thread229497.html</link>
			<pubDate>Mon, 12 Oct 2009 10:55:15 GMT</pubDate>
			<description><![CDATA[Does anyone know how to change the colour of strings using x86 NASM Assembler? I've found tutorials like this: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680"...]]></description>
			<content:encoded><![CDATA[<div>Does anyone know how to change the colour of strings using x86 NASM Assembler? I've found tutorials like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">mov&nbsp; ah,&nbsp; 09h <br />
mov&nbsp; al,&nbsp; 97 <br />
mov&nbsp; bx,&nbsp; 100b<br />
mov&nbsp; cx,&nbsp; 01h <br />
int&nbsp; 10h</pre><br />
Which prints the letter &quot;A&quot; once in the colour you choose. This is a handy tutorial, but I would like to be able to print the entire screen text (i.e more than one string) in the same colour. Anyone have any ideas?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>MichaelSammels</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229497.html</guid>
		</item>
		<item>
			<title>CPUID :)</title>
			<link>http://www.daniweb.com/forums/thread229295.html</link>
			<pubDate>Sun, 11 Oct 2009 12:51:44 GMT</pubDate>
			<description><![CDATA[Hi :) 
 
I'm trying to get the vendor ID using the CPUID opcode. Again, this is inline ASM with C; but it's the ASM that I need help with. The C is fine AFAIK. 
 
I'm not sure if it's the way I'm trying to do this, or if my CPU simply doesn't support CPUID... 
char* getCPUID(void) { 
    int...]]></description>
			<content:encoded><![CDATA[<div>Hi :)<br />
<br />
I'm trying to get the vendor ID using the CPUID opcode. Again, this is inline ASM with C; but it's the ASM that I need help with. The C is fine AFAIK.<br />
<br />
I'm not sure if it's the way I'm trying to do this, or if my CPU simply doesn't support CPUID...<br />
 <pre style="margin:20px; line-height:13px">char* getCPUID(void) {<br />
&nbsp; &nbsp; int vendor&#91;3&#93;;<br />
&nbsp; &nbsp; char vstring&#91;12 + 1&#93;;<br />
<br />
&nbsp; &nbsp; /* Get vendor string: */<br />
&nbsp; &nbsp; asm(&quot;mov %0, %%eax\n\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;cpuid\n\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;cmp $3, %%eax\n\t&quot; /* If eax &lt; 3, CPU doesn't support CPUID... */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;jl dont_bother\n\t&quot; /* So we can't CPUID :( */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;mov %%ebx, %0\n\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;mov %%ecx, %1\n\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;mov %%edx, %2\n\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;dont_bother:\n\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;mov $-1, %0&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; :&quot;=r&quot;(vendor&#91;0&#93;), &quot;=r&quot;(vendor&#91;1&#93;), &quot;=r&quot;(vendor&#91;2&#93;)<br />
&nbsp; &nbsp; &nbsp;  );<br />
&nbsp; &nbsp; &nbsp;  <br />
&nbsp;  if (vendor&#91;0&#93; == -1) {<br />
&nbsp; &nbsp; &nbsp;  return &quot;Error: CPU doesn't support CPUID!&quot;;<br />
&nbsp;  }<br />
<br />
&nbsp;  /* Store in vstring; 12 char string results */<br />
&nbsp;  memcpy(&amp;(vstring&#91;0&#93;), &amp;(vendor&#91;0&#93;), sizeof(int));<br />
&nbsp;  memcpy(&amp;(vstring&#91;4&#93;), &amp;(vendor&#91;1&#93;), sizeof(int));<br />
&nbsp;  memcpy(&amp;(vstring&#91;8&#93;), &amp;(vendor&#91;2&#93;), sizeof(int));<br />
<br />
&nbsp;  /* Make sure string is NULL-terminated */<br />
&nbsp;  vstring&#91;12&#93; = '\0';<br />
&nbsp;  <br />
&nbsp;  return getManufacturer(vstring); /* Function simply compares vstring to some<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  known vendor strings. */<br />
}</pre>... but my error message is printed. Is it my ASM, or the CPU?<br />
I'm hoping it's the ASM...<br />
<br />
<div style="margin:20px; margin-top:5px; "> <div class="smallfont" style="margin-bottom:2px">Quote:</div> <table cellpadding="5" cellspacing="0" border="0" width="100%"> <tr> <td class="alt2"> <hr />  $ ./a.out<br />
Manufacturer: Error: CPU doesn't support CPUID!  <hr /> </td> </tr> </table> </div></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>chrisname</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229295.html</guid>
		</item>
		<item>
			<title>NASM Painting Pixels</title>
			<link>http://www.daniweb.com/forums/thread229040.html</link>
			<pubDate>Sat, 10 Oct 2009 06:05:37 GMT</pubDate>
			<description>How do you paint pixels in NASM, could someone tell me about it and mabey give me an example?</description>
			<content:encoded><![CDATA[<div>How do you paint pixels in NASM, could someone tell me about it and mabey give me an example?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>tomtetlaw</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229040.html</guid>
		</item>
		<item>
			<title>Countdown timer</title>
			<link>http://www.daniweb.com/forums/thread228933.html</link>
			<pubDate>Fri, 09 Oct 2009 18:16:07 GMT</pubDate>
			<description><![CDATA[Hi there, I'm kinda new to making asm programs and i was wondering if you could make a countdown timer where the user is asked for the input and it is displayed in countdown, lets say a max of 59 secs. I was only able to make one that counts down from 9 to 0, is there a way to input 59secs and...]]></description>
			<content:encoded><![CDATA[<div>Hi there, I'm kinda new to making asm programs and i was wondering if you could make a countdown timer where the user is asked for the input and it is displayed in countdown, lets say a max of 59 secs. I was only able to make one that counts down from 9 to 0, is there a way to input 59secs and display the countdown? Using A86 assembler btw.<br />
<br />
Here's my code:<br />
<br />
 <pre style="margin:20px; line-height:13px">MAIN:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JMP START<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MSG: DB 0A,0D,'ENTER NUMBER OF SECONDS(0-9): $'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MSG1: DB 0A,0D,'-END- $'<br />
<br />
START:&nbsp; &nbsp; &nbsp; &nbsp; ;USER INPUT<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,09<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV DX,MSG<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
SECIN:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,08<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PUSH AX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,02<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV DL,AL<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,02<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV DL,0AH<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; POP AX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV BL,AL<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV CL,AL<br />
DCOUNT:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CMP BL,30H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JE COUNTEND<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PUSH CX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PUSH BX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,02<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV DL,BL<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; POP BX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DEC BL<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,02<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV DL,0AH<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CALL DELAYT<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; POP CX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LOOP DCOUNT<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 20H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
DELAYT:&nbsp; &nbsp; &nbsp; &nbsp; ;DELAY FUNCTION USING SERVICE 2C OF INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,02CH<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV BH,DH&nbsp; ; DH has current second<br />
TIMEC:&nbsp; &nbsp; &nbsp; ; Loops until the current second is not equal to the last, in BH<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,02CH<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CMP BH,DH&nbsp; ; Here is the comparison to exit the loop continue<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JE TIMEC<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RET<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
COUNTEND:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV AH,09<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV DX,MSG1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 21H<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INT 20H</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>nikolai090</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228933.html</guid>
		</item>
		<item>
			<title>jl and jg?</title>
			<link>http://www.daniweb.com/forums/thread228877.html</link>
			<pubDate>Fri, 09 Oct 2009 14:08:17 GMT</pubDate>
			<description>ok i have this problem in mind i wanted to try but i cant figure out whats wrong with my code..the program lets you input a string of integers then press another input as target..The target is then cmp to the string..the output should place lesser values on the string based on the specifed target...</description>
			<content:encoded><![CDATA[<div>ok i have this problem in mind i wanted to try but i cant figure out whats wrong with my code..the program lets you input a string of integers then press another input as target..The target is then cmp to the string..the output should place lesser values on the string based on the specifed target ex.<br />
string: 12456<br />
target: 2<br />
output: 1<br />
 <pre style="margin:20px; line-height:13px">.model small<br />
.stack<br />
.data<br />
.code<br />
start:<br />
push 0ah ; push linefeed indication of stack<br />
start1:<br />
mov ah,1<br />
int 21h<br />
push ax&nbsp; &nbsp; &nbsp; ; data place at stack<br />
cmp al,0dh&nbsp;  <br />
je out1&nbsp; &nbsp; &nbsp;  ; will jump if equal to cmp al,0dh<br />
jne start1 ; will jump if not equal to cmp al,0dh<br />
out1:<br />
mov ah,2<br />
mov dl,0ah ;linefeed<br />
int 21h<br />
<br />
target:<br />
pop bx<br />
mov ah,1<br />
int 21h<br />
tests:<br />
cmp al,bl<br />
jl out2<br />
out2:<br />
pop bx<br />
mov ah,2<br />
mov dl,al<br />
int 21h<br />
cmp al,0ah<br />
jne tests<br />
je fin<br />
fin:<br />
mov ah,4ch<br />
int 21h<br />
end start</pre>need help...im just wondering how come it wont workout the way i wanted it to workout..</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>jingo1126</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228877.html</guid>
		</item>
		<item>
			<title>Question</title>
			<link>http://www.daniweb.com/forums/thread228717.html</link>
			<pubDate>Fri, 09 Oct 2009 01:42:54 GMT</pubDate>
			<description><![CDATA[I need to write a program in assembly that will read a file using the irvine library.  My question is if I read in 50 bytes into a buffer, I can't figure out how to get the second 50 bytes and so on?  Does anyone have an idea on how to do this. 
 
Thanks]]></description>
			<content:encoded><![CDATA[<div>I need to write a program in assembly that will read a file using the irvine library.  My question is if I read in 50 bytes into a buffer, I can't figure out how to get the second 50 bytes and so on?  Does anyone have an idea on how to do this.<br />
<br />
Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>evant8950</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228717.html</guid>
		</item>
		<item>
			<title><![CDATA[the address offset's time of system]]></title>
			<link>http://www.daniweb.com/forums/thread228299.html</link>
			<pubDate>Wed, 07 Oct 2009 11:15:19 GMT</pubDate>
			<description><![CDATA[hi, who can give me the address offset's time of system]]></description>
			<content:encoded><![CDATA[<div>hi, who can give me the address offset's time of system</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>c+++</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228299.html</guid>
		</item>
		<item>
			<title>my first program</title>
			<link>http://www.daniweb.com/forums/thread228263.html</link>
			<pubDate>Wed, 07 Oct 2009 08:12:00 GMT</pubDate>
			<description><![CDATA[I am trying to make a program that prompts the user for input then outputs it to them(back to the good old days :D). It all works, except it doesn't output what the user inputs, it outputs a bunch of crazy numbers, can someone help me? 
 
Btw I am using NASM. 
 
Test Run: 
  <div class="codeblock">...]]></description>
			<content:encoded><![CDATA[<div>I am trying to make a program that prompts the user for input then outputs it to them(back to the good old days :D). It all works, except it doesn't output what the user inputs, it outputs a bunch of crazy numbers, can someone help me?<br />
<br />
Btw I am using NASM.<br />
<br />
Test Run:<br />
 <pre style="margin:20px; line-height:13px">Please enter something(max 255 chars): tom<br />
You entered: 7</pre><br />
 <pre style="margin:20px; line-height:13px">&#91;section .data&#93;<br />
&nbsp; &nbsp; &nbsp; &nbsp; choice:&nbsp; db &quot;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fmt1:&nbsp; &nbsp; db &quot;%s&quot;,10,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; output:&nbsp; db &quot;Please enter something(max 255 chars): &quot;,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; output2: db &quot;You entered: %s&quot;,0<br />
&#91;section .text&#93;<br />
&nbsp; &nbsp; &nbsp; &nbsp; global _main <br />
&nbsp; &nbsp; &nbsp; &nbsp; extern _printf, _scanf <br />
_main:<br />
&nbsp; &nbsp; &nbsp; &nbsp; push output<br />
&nbsp; &nbsp; &nbsp; &nbsp; call _printf<br />
&nbsp; &nbsp; &nbsp; &nbsp; add esp, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; push choice<br />
&nbsp; &nbsp; &nbsp; &nbsp; push fmt1<br />
&nbsp; &nbsp; &nbsp; &nbsp; call _scanf<br />
&nbsp; &nbsp; &nbsp; &nbsp; add esp, 8<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; push dword&#91;choice&#93;<br />
&nbsp; &nbsp; &nbsp; &nbsp; push output2<br />
&nbsp; &nbsp; &nbsp; &nbsp; call _printf<br />
&nbsp; &nbsp; &nbsp; &nbsp; add esp, 8<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mov eax, 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>tomtetlaw</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228263.html</guid>
		</item>
		<item>
			<title>MIPS Checking if Integer/Letter</title>
			<link>http://www.daniweb.com/forums/thread228206.html</link>
			<pubDate>Wed, 07 Oct 2009 04:31:10 GMT</pubDate>
			<description><![CDATA[I'm having trouble with my program. I believe I've figured out most of it, but there's one thing that I still have no clue about. That's how to go through a string and check whether it's a digit or letter. 
 
I figured I could do something like this to remove whitespace (although I haven't tested...]]></description>
			<content:encoded><![CDATA[<div>I'm having trouble with my program. I believe I've figured out most of it, but there's one thing that I still have no clue about. That's how to go through a string and check whether it's a digit or letter.<br />
<br />
I figured I could do something like this to remove whitespace (although I haven't tested it out yet... just saw this while searching other topics here):<br />
<br />
 <pre style="margin:20px; line-height:13px">li $t0, 32&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  # store a whitespace into temp variable<br />
bne $t1, $t0, remove&nbsp; &nbsp;  # if not a whitespace branch to remove</pre><br />
Assuming $t1 is a character I want to check (and remove is defined later in the code).<br />
<br />
But that doesn't handle symbols or anything. I'm thinking it may be easier to just check if the character IS a digit/letter instead of checking if it isn't. But I don't know how to do that either.<br />
<br />
One more thing. Is there any way to take a input file as a argument? I realize I can prompt the user for input like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .data<br />
prompt:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .asciiz &quot;Input: &quot;<br />
buf:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  .space 100<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .text<br />
main:<br />
li&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $v0, 4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  # system call code for print_string<br />
la&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $a0, prompt<br />
syscall<br />
<br />
li&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $v0, 8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # system call code for read_string<br />
la&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $a0, buf<br />
li&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $a1, 100<br />
syscall</pre><br />
But can I actually read input from a file given as a argument?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>gauntex</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228206.html</guid>
		</item>
		<item>
			<title>initialize a serial port  in protected mode</title>
			<link>http://www.daniweb.com/forums/thread228188.html</link>
			<pubDate>Wed, 07 Oct 2009 02:48:37 GMT</pubDate>
			<description><![CDATA[i have been trying to do any interrupts in protected mode and i have been using msdos interrupts so it makes sense that they are not working i have been working through the threads so as not duplicate this but i haven't found any and i figured i would just ask 
 
im kind of new to assembly  but im...]]></description>
			<content:encoded><![CDATA[<div>i have been trying to do any interrupts in protected mode and i have been using msdos interrupts so it makes sense that they are not working i have been working through the threads so as not duplicate this but i haven't found any and i figured i would just ask<br />
<br />
im kind of new to assembly  but im doing alright so far<br />
<br />
openfile hasn't worked and just calling int 21h or int 14h hasn't worked<br />
<br />
<br />
in fact if i just call sti to prepare the assembler for interrupts i get a problem not to mention trying actuall interrupts<br />
<br />
i need to open a serial port in assembly using protected mode.... <br />
<br />
as well as set the baud rate <br />
<br />
any ideas<br />
<br />
<br />
<br />
thanks ahead of time and whatever i need to read i will... <br />
<br />
thom</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>therstonsplace</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228188.html</guid>
		</item>
		<item>
			<title>mips recursive</title>
			<link>http://www.daniweb.com/forums/thread228145.html</link>
			<pubDate>Tue, 06 Oct 2009 22:59:55 GMT</pubDate>
			<description><![CDATA[I am trying to do towers of hanoi recursively below is the code. my problem is that i am not getting out of the cycle at the right time so code keeps on running... can someone tell me what I may be doing wrong? 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right;...]]></description>
			<content:encoded><![CDATA[<div>I am trying to do towers of hanoi recursively below is the code. my problem is that i am not getting out of the cycle at the right time so code keeps on running... can someone tell me what I may be doing wrong?<br />
<br />
 <pre style="margin:20px; line-height:13px">.data<br />
msg0: .asciiz &quot;Enter number of disks:&quot;<br />
msg1: .asciiz &quot;Move disk 1 from TOWER &quot;<br />
msg2: .asciiz &quot;Move disk &quot;<br />
msg3: .asciiz &quot; from TOWER &quot;<br />
msg4: .asciiz &quot; to TOWER &quot;<br />
msg5: .asciiz &quot;\n&quot;<br />
<br />
.text<br />
.globl main<br />
main:&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
<br />
la $a0,msg0&nbsp; &nbsp; &nbsp; &nbsp; #Print &quot;Enter number of disks:&quot;<br />
li $v0,4<br />
syscall<br />
<br />
li $v0,5&nbsp; &nbsp; &nbsp; &nbsp;  #cin, $v0=input value<br />
syscall<br />
<br />
addi $t0,$zero,6&nbsp; &nbsp; &nbsp; &nbsp; #$t0=6<br />
move $a2,$v0&nbsp; &nbsp; &nbsp; &nbsp; #$a2=number of disc,initialized by input value<br />
addi $t7,$zero,1&nbsp; &nbsp; &nbsp; &nbsp; #$t7=from,initialize to 1<br />
addi $a1,$zero,3&nbsp; &nbsp; &nbsp; &nbsp; #$a1=to,initialize to 3<br />
move $t1,$t0&nbsp; &nbsp; &nbsp; &nbsp; #$t1=temp,initialize to $t1=6<br />
<br />
addi $sp,$sp,-20&nbsp; &nbsp; &nbsp; &nbsp;  #create a stack with 5 boxes<br />
sw $ra,16($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$ra |retun address|<br />
sw $t7,12($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t7 |from |<br />
sw $a1,8($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a1 |to |<br />
sw $a2,4($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a2 |numberof disc|<br />
sw $t1,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t1 |temp |&lt;---$sp<br />
<br />
jal hanoi # call hanoi<br />
<br />
#lw $ra,16($sp)&nbsp; &nbsp; &nbsp; &nbsp;  # -----------------(*)<br />
<br />
lw $ra,16($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$ra |retun address|<br />
lw $t7,12($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t7 |from |<br />
lw $a1,8($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a1 |to |<br />
lw $a2,4($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a2 |numberof disc|<br />
lw $t1,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t1 |temp |&lt;---$sp<br />
<br />
addi $sp,$sp,20<br />
#jr $ra<br />
<br />
<br />
hanoi:<br />
<br />
<br />
sub $t1,$t0,$t7<br />
sub $t1,$t1,$a1&nbsp; &nbsp; &nbsp; &nbsp;  #temp = 6-from-to<br />
<br />
<br />
<br />
addi $sp,$sp,-20&nbsp; &nbsp; &nbsp; &nbsp;  #create a stack with 5 boxes<br />
<br />
sw $ra,16($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$ra |retun address|<br />
sw $t7,12($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t7 |from |<br />
sw $a1,8($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a1 |to |<br />
sw $a2,4($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a2 |numberof disc|<br />
sw $t1,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t1 |temp |&lt;---$sp<br />
<br />
bne $a2,1,recurse # if (n =/= 1) recurse<br />
<br />
li $v0,4<br />
la $a0,msg1<br />
syscall<br />
li $v0,1<br />
move $a0,$t7<br />
syscall<br />
li $v0,4<br />
la $a0,msg4<br />
syscall<br />
li $v0,1<br />
move $a0,$a1<br />
syscall<br />
li $v0,4<br />
la $a0,msg5<br />
syscall<br />
<br />
endcase: # exit code<br />
<br />
addi $sp,$sp,20&nbsp; &nbsp; &nbsp; &nbsp;  #delete a stack with 5 boxes<br />
<br />
lw $ra,16($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$ra |retun address|<br />
lw $t7,12($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t7 |from |<br />
lw $a1,8($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a1 |to |<br />
lw $a2,4($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a2 |numberof disc|<br />
lw $t1,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t1 |temp |&lt;---$sp<br />
<br />
jr $ra # return<br />
<br />
recurse:<br />
<br />
addi $a2,$a2,-1<br />
<br />
move $a1,$t1<br />
<br />
jal hanoi # call hanoi<br />
<br />
li $v0,4&nbsp; &nbsp; &nbsp; &nbsp; #--------------------(**)<br />
la $a0,msg2<br />
syscall<br />
li $v0,1<br />
move $a0,$a2<br />
syscall<br />
li $v0,4<br />
la $a0,msg3<br />
syscall<br />
li $v0,1<br />
move $a0,$t7<br />
syscall<br />
li $v0,4<br />
la $a0,msg4<br />
syscall<br />
li $v0,1<br />
move $a0,$a1<br />
syscall<br />
li $v0,4<br />
la $a0,msg5<br />
syscall<br />
<br />
lw $ra,16($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$ra |retun address|<br />
lw $t7,12($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t7 |from |<br />
lw $a1,8($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a1 |to |<br />
lw $a2,4($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$a2 |numberof disc|<br />
lw $t1,0($sp)&nbsp; &nbsp; &nbsp; &nbsp;  #$t1 |temp |&lt;---$sp<br />
addi $sp,$sp,20&nbsp; &nbsp; &nbsp; &nbsp;  #delete a stack with 5 boxes<br />
<br />
addi $a2,$a2,-1<br />
<br />
move $t7,$t1<br />
<br />
<br />
jal hanoi # call hanoi<br />
<br />
j endcase # goto exit code (return)---------------------(***)</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228145.html</guid>
		</item>
		<item>
			<title>help understand code</title>
			<link>http://www.daniweb.com/forums/thread227864.html</link>
			<pubDate>Mon, 05 Oct 2009 18:39:59 GMT</pubDate>
			<description>I have following code which reverses any input provided using recursion. I am trying to understand what each line of code does. so I can have a better understanding. 
 
so I have some questions, wondering if someone can help me understand whats happening in the code. I have commented each line...</description>
			<content:encoded><![CDATA[<div>I have following code which reverses any input provided using recursion. I am trying to understand what each line of code does. so I can have a better understanding.<br />
<br />
so I have some questions, wondering if someone can help me understand whats happening in the code. I have commented each line where I am a question. any help will be greatly appreciated.<br />
<br />
I don't understand anything under the label notend. please share any thoughts you might have .. thanks<br />
<br />
<br />
	.data<br />
<br />
mess1: .asciiz &quot;Enter string: &quot;<br />
mess2: .asciiz &quot;Reversed string: &quot;<br />
input: .space 128<br />
newln: .asciiz &quot;\n\n&quot;<br />
output: .space 2<br />
	.text<br />
	.align 2<br />
<br />
main:<br />
	li $v0, 4 #print string<br />
	la $a0, mess1<br />
	syscall<br />
	<br />
	li $v0, 8 #read string<br />
	la $a0, input #pointing to 128(bytes) of space reserved by input<br />
	la $a1, 127 #read upto 127 characters<br />
	syscall<br />
	<br />
	li $v0, 4 #print string<br />
	la $a0, newln<br />
	syscall<br />
	<br />
	li $v0, 4 #print string<br />
	la $a0, mess2<br />
	syscall<br />
	<br />
	la $a0, output #output will be single character<br />
	addi $a0,$a0,1 -- whats in a0 at this point and why are we adding??<br />
	add $a1,$zero,$zero -- whats happening here?? why we setting $a1 to zero?<br />
	<br />
	sb $a1, 0($a0) #set null at the end of output -- dont undertand ??<br />
	la $a0, input #prepare for proc call ??<br />
	li $a1, 0     # $a1 contains index ??<br />
	jal rev<br />
<br />
<br />
<br />
rev:<br />
	add $t1,$a1,$a0<br />
	<br />
	lbu $t0, 0($t1) #load cur chacter -- what does 0($t1) mean?<br />
	bne $t0, 0xa, notend # what is 0xa ??<br />
	<br />
	jr $ra # which line is this jumping to ?? line 33 sb $a1, 0($a0) ??<br />
<br />
	<br />
notend:<br />
<br />
	addi $sp, $sp, -8 # whats happening here? why substract 8 from stack pointer?<br />
     <br />
     sw $ra, 4($sp)  # save return address -- why?<br />
<br />
      sw $t0, 0($sp)  # save cur char <br />
<br />
      addi $a1, $a1, 1  # increase index<br />
<br />
      jal rev <br />
 <br />
<br />
      la $a0, output  # stuff the cur char into the 'output'<br />
<br />
      lw $a1, 0($sp)<br />
<br />
      sb $a1, 0($a0) <br />
<br />
      li $v0, 4   # print current char<br />
<br />
      la $a0, output<br />
<br />
      syscall  <br />
      lw $ra, 4($sp)  # restore caller state<br />
<br />
      addi $sp, $sp, 8  # free up the stack space used<br />
<br />
      jr $ra</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227864.html</guid>
		</item>
		<item>
			<title>Tables and sorting</title>
			<link>http://www.daniweb.com/forums/thread227846.html</link>
			<pubDate>Mon, 05 Oct 2009 17:25:46 GMT</pubDate>
			<description><![CDATA[so i need to input 10 ints into a table then use insertion sort but i dont know how to step through the table like you would and array in c++ since i have found out i cant go tbl[length-1] for example because i get an error saying "cant add relative quantities". 
 
in short how do i go from number...]]></description>
			<content:encoded><![CDATA[<div>so i need to input 10 ints into a table then use insertion sort but i dont know how to step through the table like you would and array in c++ since i have found out i cant go tbl[length-1] for example because i get an error saying &quot;cant add relative quantities&quot;.<br />
<br />
in short how do i go from number to number in the table to step through it</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>tyczj</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227846.html</guid>
		</item>
		<item>
			<title>Creating a floppy image</title>
			<link>http://www.daniweb.com/forums/thread227746.html</link>
			<pubDate>Mon, 05 Oct 2009 09:46:03 GMT</pubDate>
			<description><![CDATA[Ok so i have this floppy image that just prints a message now the problem that i am running into is that i have to jump to memory location 0x1000 and then jump back to the original place but have no clue how to do it this is what mbr looks like on the floppy: (i am using nasm) 
 
  <div...]]></description>
			<content:encoded><![CDATA[<div>Ok so i have this floppy image that just prints a message now the problem that i am running into is that i have to jump to memory location 0x1000 and then jump back to the original place but have no clue how to do it this is what mbr looks like on the floppy: (i am using nasm)<br />
<br />
 <pre style="margin:20px; line-height:13px">org 0x7c00<br />
xor ax,ax<br />
mov es,ax<br />
mov ah,0<br />
mov al,3<br />
int 10h<br />
<br />
mov ah,13h<br />
mov al,1<br />
mov bh,0<br />
mov bl,0ah<br />
mov cx,mlen<br />
mov dh,0<br />
mov dl,0<br />
mov bp, msg<br />
int 10h<br />
<br />
<span style="font-weight:bold"><span style="color:Red">;jump to 0x1000 here<br />
;print '$' here</span></span><br />
<br />
mov dh,1<br />
msg db &quot;This is a message&quot;<br />
mlen equ $-msg<br />
times 512-($-$$)-2 db 0<br />
dw 0AA55h</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>makaveli0129</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227746.html</guid>
		</item>
		<item>
			<title>Problem with MIPS</title>
			<link>http://www.daniweb.com/forums/thread227703.html</link>
			<pubDate>Mon, 05 Oct 2009 06:14:53 GMT</pubDate>
			<description><![CDATA[Hi everyone, 
 
We are learning MIPS at one of my classes and in the book there are some exercises, but I'm having problem with one of them. It is a buggy code and we are supposed to find the cause of an exception. 
 
 
# This code is supposed to calculate A*X + B 
# for N values of X 
 
# A and B...]]></description>
			<content:encoded><![CDATA[<div>Hi everyone,<br />
<br />
We are learning MIPS at one of my classes and in the book there are some exercises, but I'm having problem with one of them. It is a buggy code and we are supposed to find the cause of an exception.<br />
<br />
 <pre style="margin:20px; line-height:13px"># This code is supposed to calculate A*X + B<br />
# for N values of X<br />
<br />
# A and B are in $a1 and $a2, respectively<br />
# the X values and N are in the data segment<br />
#<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; .text<br />
main:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; li $a1, 3<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $a2, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t0, N<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $t1, X<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $t2, 0($t0)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; xor $t3, $t3, $t3<br />
&nbsp; &nbsp; &nbsp; &nbsp; xor $t4, $t4, $t4<br />
<br />
loop:&nbsp; &nbsp; &nbsp; &nbsp; addi $t2, $t2, -1<br />
&nbsp; &nbsp; &nbsp; &nbsp; blez $t2, exit<br />
&nbsp; &nbsp; &nbsp; &nbsp; lw $t3, 0($t1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; mul $t3, $a1, $t3<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t3, $a2, $t3<br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, outputMsg<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $a0, $0, $t3<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
&nbsp; &nbsp; &nbsp; &nbsp; li $v0, 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; la $a0, newln<br />
&nbsp; &nbsp; &nbsp; &nbsp; syscall<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; add $t1, $t1, 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; j loop<br />
<br />
exit:&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; jr $ra<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; .data<br />
<br />
N:&nbsp; &nbsp; &nbsp; &nbsp; .word 4<br />
X:&nbsp; &nbsp; &nbsp; &nbsp; .word 12, 14, 16, 18<br />
&nbsp; &nbsp; &nbsp; &nbsp;  <br />
outputMsg:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .asciiz&nbsp; &nbsp; &nbsp; &nbsp; &quot;\n Result = &quot;<br />
newln:<br />
&nbsp; &nbsp; &nbsp; &nbsp; .asciiz &quot;\n\n&quot;</pre><br />
<br />
I tried single stepping the code, and the exception seems to happen always when executing this instruction after the first loop.<br />
<br />
	lw $t3, 0($t1)<br />
<br />
Whats wrong with $t1?<br />
<br />
<br />
Thanks for the help.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>ripineros</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227703.html</guid>
		</item>
		<item>
			<title>Program help required</title>
			<link>http://www.daniweb.com/forums/thread227690.html</link>
			<pubDate>Mon, 05 Oct 2009 04:46:08 GMT</pubDate>
			<description>Please can anyone help me in the making of this program : 
 
We have to Enter a string of capital letters like 
 
WJKTYNHJHIJKLMNOPASC 
 
THE LONGEST CONSECUTIVELY INCREASING STRING IS 
 
HIJKLMNOP</description>
			<content:encoded><![CDATA[<div>Please can anyone help me in the making of this program :<br />
<br />
We have to Enter a string of capital letters like<br />
<br />
WJKTYNHJHIJKLMNOPASC<br />
<br />
THE LONGEST CONSECUTIVELY INCREASING STRING IS<br />
<br />
HIJKLMNOP<br />
<br />
.<br />
.<br />
.<br />
<br />
Help me Please , Thanks !!!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>bilalqasim</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227690.html</guid>
		</item>
		<item>
			<title>question?</title>
			<link>http://www.daniweb.com/forums/thread227558.html</link>
			<pubDate>Sun, 04 Oct 2009 11:12:25 GMT</pubDate>
			<description>guys?is it even possible that once i created a file already with my program then execute that program again wont create a file anymore?.. like q.txt then its created..but when i execute my program again and type a string to create a file like w.txt..it doesnt create the file..theres a screenshot of...</description>
			<content:encoded><![CDATA[<div>guys?is it even possible that once i created a file already with my program then execute that program again wont create a file anymore?.. like q.txt then its created..but when i execute my program again and type a string to create a file like w.txt..it doesnt create the file..theres a screenshot of what ive done with my sample codes..it kept bugging making me crazy to figure out whats wrong..<br />
heres my code if there is something wrong please help me:<br />
 <pre style="margin:20px; line-height:13px">.model small<br />
.stack 100h<br />
.data<br />
buff db 10,?,10 dup(' ')<br />
handle dw ?<br />
.code<br />
start:<br />
mov ax,seg buff<br />
mov ds,ax<br />
mov dx,offset buff<br />
mov ah,0ah&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; string input<br />
int 21h<br />
push ax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; string placed to stack<br />
je print<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xor bx, bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov bl, buff[1]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov buff[bx+2], '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dx, offset buff + 2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 9<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
mov ah,3ch&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; create file attribute<br />
mov cx,0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; normal attribute<br />
pop bx&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; get data from stack<br />
mov ah,3ch&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; create file with file name from stack<br />
int 21h<br />
mov handle,ax<br />
finish:<br />
mov ah,4ch&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; terminate program<br />
int 21h<br />
end start</pre></div>  <br /> <div style="padding:5px">    <fieldset class="fieldset"> <legend>Attached Images</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/jpg.gif" alt="File Type: jpg" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=11941&amp;d=1254654435" target="_blank">Capture.JPG</a> (71.9 KB)</td> </tr> </table> </fieldset>   </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>jingo1126</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227558.html</guid>
		</item>
		<item>
			<title>working or not?need help</title>
			<link>http://www.daniweb.com/forums/thread227501.html</link>
			<pubDate>Sat, 03 Oct 2009 22:53:50 GMT</pubDate>
			<description>first things first..i still have my exe file that the program works.. 
i was just putting labels to my program then the next thing happens it does not work anymore except for the terminate program.. 
if some of you guys have time please recomplie it and test it in your tasm.. these are all my...</description>
			<content:encoded><![CDATA[<div>first things first..i still have my exe file that the program works..<br />
i was just putting labels to my program then the next thing happens it does not work anymore except for the terminate program..<br />
if some of you guys have time please recomplie it and test it in your tasm.. these are all my codes.. please help me<br />
 <pre style="margin:20px; line-height:13px">;Jingo Rodriguez<br />
;Project Partial File Manager Creates File, Directory and Deletes<br />
;has better interface except no int on keyboard and and mouse int whch are 16 and 33<br />
;ints use are 10h and 21h<br />
;one flaw in program is you have to execute it again when an error is made..like wrong spelling and wrong input of data at the beginning..just like the one your experiencing in wrong or false use of program<br />
.model small<br />
.stack 100h<br />
.data<br />
buffer db 10,?, 10 dup(' ')<br />
handle dw ?<br />
.code<br />
start:<br />
call clear&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;call clear procedure call is placed when theres a certain procedure to be called<br />
started:<br />
mov ah,1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;service 1h is character input with echo<br />
int 21h<br />
push ax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;stores value at ax for further use<br />
<br />
pop bx&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;gets the value from stack for usage now the stack is emptied...<br />
<br />
cmp al,&quot;F&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;checks if the desired character has been input if not proceeds to then next line till it gets the desired input then jumps to a procedure or label<br />
je file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;use je instead of call why?because call may run the procedures leaving other procedures useless.<br />
<br />
cmp al,&quot;o&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;&quot; &quot;<br />
je folder<br />
<br />
cmp al,&quot;D&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;&quot; &quot;<br />
je deletes<br />
<br />
cmp al,&quot;x&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;jumps to finishs&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
je finishs<br />
<br />
file proc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dl,0ah&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; linefeed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah,2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; service 2h character output<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ax,seg buffer&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ds,ax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dx, offset buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 0ah&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; string input is what ive learned most in this program then storing it at stack<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push ax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; string stored at stack&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jmp print<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; print what is been inputed maybe need or may not be needed at all.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xor bx, bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov bl, buffer[1]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov buffer[bx+2], '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dx, offset buffer + 2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 9&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; service 9h is for string output<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
crtfle:<br />
mov ah,3ch<br />
mov cx,0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;&nbsp; is best use to check if the 3ch service is working..change maybe done if neccessary for the program<br />
&nbsp;;mov cx, 0&nbsp; &nbsp; &nbsp;  ;&nbsp; normal - no attributes. <br />
&nbsp;;mov cx, 1&nbsp; &nbsp; &nbsp;  ;&nbsp; read-only. <br />
&nbsp;;mov cx, 2&nbsp; &nbsp; &nbsp;  ;&nbsp; hidden. <br />
&nbsp;;mov cx, 4&nbsp; &nbsp; &nbsp;  ;&nbsp; system <br />
&nbsp;;mov cx, 7&nbsp; &nbsp; &nbsp;  ;&nbsp; hidden, system and read-only! <br />
&nbsp;;mov cx, 16&nbsp; &nbsp; &nbsp; ;&nbsp; archive <br />
pop bx&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
mov ah,3ch<br />
int 21h<br />
mov handle, ax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
jmp finish<br />
file endp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
folder proc<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dl,0ah&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;linefeed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah,2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;service 2h character output<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ax,seg buffer&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ds,ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dx, offset buffer&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 0ah&nbsp; &nbsp; &nbsp; &nbsp;  ;service use are 0ah of int 21h: is use to input string<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push ax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;after input string will be push to register ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jmp print1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print1:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;code is to print the string after input<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xor bx, bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov bl, buffer[1]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov buffer[bx+2], '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dx, offset buffer + 2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 9<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pop bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah,39h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;create folder at current directory<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jmp finish<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; finishs:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;this jumps are made due to the fact they can't jump a long jump that exceeds at 128 bytes..<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jmp finish&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;short jmps are but will make it a bit slower due to some sources i found on the net<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deletes:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;this jump will jump from one another till it goes to the desired procedure or label.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jmp delete<br />
folder endp<br />
delete proc<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dl,0ah&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;linefeed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah,2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;service 2h character output<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ax,seg buffer&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ds,ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lea dx, buffer&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 0ah&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;service use are 0ah of int 21h: is use to input string<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push ax&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;after input string will be push to register ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jmp print2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print2:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;code is to print the string after input<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xor bx, bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov bl, buffer[1] <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov buffer[bx+2], '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dx, offset buffer + 2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah, 9<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pop bx<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ah,41h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ;delete file at current directory<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int 21h<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp finish<br />
delete endp<br />
Clear proc ;only a design for better viewing..UI(User interface)<br />
;learning putting color at specific places at screen is nice, screen of dos has only 80 pixels width<br />
;ok i can understand almost everyline except for the two line below <br />
;which means i guess they might come in handy for some reasons maybe trying to remove something place at stack so that when procedure is being called it has a clean data to throw in the process.<br />
; set es (just in case): <br />
push&nbsp; &nbsp; cs<br />
pop&nbsp; &nbsp;  es<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, tmsg&nbsp; ; offset. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute. <br />
mov&nbsp; &nbsp;  cx, 80&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 0&nbsp; &nbsp; ; col. <br />
mov&nbsp; &nbsp;  dh, 0&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 1&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, msg&nbsp; ; offset. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute. <br />
mov&nbsp; &nbsp;  cx, 80&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 0&nbsp; &nbsp; ; col. <br />
mov&nbsp; &nbsp;  dh, 1&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 1&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, cmsg ; offset of string with attributes. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute (not used when al=3). <br />
mov&nbsp; &nbsp;  cx, 80&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 0&nbsp; &nbsp; ; col. <br />
mov&nbsp; &nbsp;  dh, 2&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 1&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, opt1 ; offset of string with attributes. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute (not used when al=3). <br />
mov&nbsp; &nbsp;  cx, 8&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 22&nbsp; &nbsp; ; col. <br />
mov&nbsp; &nbsp;  dh, 3&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 3&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, opt2 ; offset of string with attributes. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute (not used when al=3). <br />
mov&nbsp; &nbsp;  cx, 9&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 30&nbsp;  ; col. <br />
mov&nbsp; &nbsp;  dh, 3&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 3&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, opt3 ; offset of string with attributes. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute (not used when al=3). <br />
mov&nbsp; &nbsp;  cx, 8&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 37&nbsp; &nbsp; ; col. <br />
mov&nbsp; &nbsp;  dh, 3&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 3&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, opt4 ; offset of string with attributes. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute (not used when al=3). <br />
mov&nbsp; &nbsp;  cx, 8&nbsp; &nbsp; ; char number. <br />
mov&nbsp; &nbsp;  dl, 45&nbsp;  ; col. <br />
mov&nbsp; &nbsp;  dh, 3&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 3&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, left ; offset of string with attributes. <br />
mov&nbsp; &nbsp;  bl, 011h ; default attribute (not used when al=3). <br />
mov&nbsp; &nbsp;  cx, 22&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 0&nbsp; &nbsp; ; col. <br />
mov&nbsp; &nbsp;  dh, 3&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 1&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, right ; offset of string with attributes. <br />
mov&nbsp; &nbsp;  bl, 011h ; default attribute (not used when al=3). <br />
mov&nbsp; &nbsp;  cx, 27&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 53&nbsp;  ; col. <br />
mov&nbsp; &nbsp;  dh, 3&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 1&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
<br />
mov&nbsp; &nbsp;  bh, 0&nbsp; &nbsp; ; page. <br />
lea&nbsp; &nbsp;  bp, inst&nbsp; ; offset. <br />
mov&nbsp; &nbsp;  bl, 01fh ; default attribute. <br />
mov&nbsp; &nbsp;  cx, 80&nbsp;  ; char number. <br />
mov&nbsp; &nbsp;  dl, 0&nbsp; &nbsp; ; col. <br />
mov&nbsp; &nbsp;  dh, 4&nbsp; &nbsp; ; row. <br />
mov&nbsp; &nbsp;  ah, 13h&nbsp; ; function. <br />
mov&nbsp; &nbsp;  al, 1&nbsp; &nbsp; ; sub-function. <br />
int&nbsp; &nbsp;  10h<br />
ret&nbsp; ; return control to the operating system<br />
tmsg db '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ' ;design top most of the screen<br />
<br />
&nbsp;msg db 'Rodriguez File Manager Version 0.1.1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ' ;design second to the top followed by the rest<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
cmsg db&nbsp; '__________________________C h o o s e&nbsp; a n&nbsp; O p t i o n__________________________'<br />
&nbsp; &nbsp;  <br />
opt1&nbsp; db ' ',01fh, 'F',003h, 'i',030h, 'l',030h, 'e',030h, ' ',01fh, ' ',01fh ,' ',01fh<br />
opt2&nbsp; db 'F',030h, 'o',003h, 'l',030h, 'd',030h, 'e',030h, 'r',030h ,' ',01fh ,' ',01fh<br />
opt3&nbsp; db ' ',01fh, ' ',01fh, 'D',003h, 'e',030h, 'l',030h, 'e',030h, 't',030h, 'e',030h <br />
opt4&nbsp; db ' ',01fh, ' ',01fh, ' ',01fh, 'E',030h, 'x',003h, 'i',030h, 't',030h, ' ',01fh<br />
left&nbsp; db '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  '<br />
right db '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  '<br />
inst&nbsp; db 'Preess the letter if the letter is capital, press shift and the letter&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  '<br />
Clear endp<br />
finish:<br />
mov ah,4ch ; terminate program<br />
int 21h<br />
end start</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>jingo1126</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227501.html</guid>
		</item>
		<item>
			<title>anyone know how to encrypt?</title>
			<link>http://www.daniweb.com/forums/thread227160.html</link>
			<pubDate>Fri, 02 Oct 2009 06:27:55 GMT</pubDate>
			<description><![CDATA[guys wondering how come the code doesnt work.. 
im using tasm as u might know..im checking on things work and want to see what its output be..thanks hope you can help me with this one. i tried converting it tasm but say argument needs to be override. 
  <div class="codeblock"> <div class="spaced">...]]></description>
			<content:encoded><![CDATA[<div>guys wondering how come the code doesnt work..<br />
im using tasm as u might know..im checking on things work and want to see what its output be..thanks hope you can help me with this one. i tried converting it tasm but say argument needs to be override.<br />
 <pre style="margin:20px; line-height:13px">.model small<br />
.stack 100h<br />
.data<br />
; string has '$' in the end: <br />
string1 db 'hello world!', 0Dh,0Ah, '$'<br />
;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  'abcdefghijklmnopqrstvuwxyz' <br />
table1 db 97 dup (' '), 'klmnxyzabcopqrstvuwdefghij'<br />
table2 db 97 dup (' '), 'hijtuvwxyzabcdklmnoprqsefg'<br />
.code<br />
start:<br />
; encrypt: <br />
lea bx, table1<br />
lea si, string1<br />
call parse<br />
; show result: <br />
lea dx, string1<br />
; output of a string at ds:dx <br />
mov ah, 9<br />
int 21h<br />
; decrypt: <br />
lea bx, table2<br />
lea si, string1<br />
call parse<br />
; show result: <br />
lea dx, string1<br />
; output of a string at ds:dx <br />
mov ah, 09<br />
int 21h<br />
ret&nbsp;  ; exit to operating system. <br />
<br />
; subroutine to encrypt/decrypt <br />
; parameters:&nbsp; <br />
;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  si - address of string to encrypt <br />
;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  bx - table to use. <br />
parse proc near<br />
<br />
next_char:<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp [si], '$'<br />
&nbsp; &nbsp; &nbsp; &nbsp; je end_of_string<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov al, [si]<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp al, 'a'<br />
&nbsp; &nbsp; &nbsp; &nbsp; jb&nbsp; skip<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmp al, 'z'<br />
&nbsp; &nbsp; &nbsp; &nbsp; ja&nbsp; skip<br />
&nbsp; &nbsp; &nbsp; &nbsp; ; xlat algorithm: al = ds:[bx + unsigned al]&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; xlatb&nbsp; &nbsp;  ; encrypt using table2.&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; mov [si], al<br />
skip:<br />
&nbsp; &nbsp; &nbsp; &nbsp; inc si<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp next_char<br />
end_of_string:<br />
ret<br />
parse endp<br />
end start</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>jingo1126</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227160.html</guid>
		</item>
		<item>
			<title>printing a digit (as a character)</title>
			<link>http://www.daniweb.com/forums/thread227092.html</link>
			<pubDate>Thu, 01 Oct 2009 19:51:55 GMT</pubDate>
			<description><![CDATA[Hello! 
I'm kind of new in assembly programming and I've been struggling with the following problem today: 
How to print an integer, using BIOS interrupt *10h*, with its *0Eh* in AH register, as its function to print a character to the screen... 
 
For example, how to print the last digit of 2005....]]></description>
			<content:encoded><![CDATA[<div>Hello!<br />
I'm kind of new in assembly programming and I've been struggling with the following problem today:<br />
How to print an integer, using BIOS interrupt <span style="font-weight:bold">10h</span>, with its <span style="font-weight:bold">0Eh</span> in AH register, as its function to print a character to the screen...<br />
<br />
For example, how to print the last digit of 2005.<br />
here's what I've tried, using division by 10:<br />
 <pre style="margin:20px; line-height:13px">mov ax, 2005<br />
mov cx, 10<br />
div cx&nbsp; &nbsp;  ; now, AH should contain the remainder (5) and AL = 200<br />
mov al, ah ; because AL should contain the character to print<br />
add al, 48 ; because ASCII code for 5 is 53 (decimal).<br />
mov ah, 0Eh; the function for the 10h interrupt<br />
int 10h</pre>I can't understand why 0 is printed to the screen instead of 5. If i change the line<br />
 <pre style="margin:20px; line-height:13px">add al, 48<br />
to<br />
add al, 49</pre>it prints out 1.<br />
... am I missing something? is it because I use decimal format for integers instead of the hexadecimal one?<br />
<br />
Thank you in advance!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>andreib</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227092.html</guid>
		</item>
		<item>
			<title><![CDATA[Unsure of AT&T syntax and segfault]]></title>
			<link>http://www.daniweb.com/forums/thread227090.html</link>
			<pubDate>Thu, 01 Oct 2009 19:47:49 GMT</pubDate>
			<description><![CDATA[I'm actually writing this code as inline ASM but I feel it is more relevant to ASM than it is to C... 
 
Basically all I want to do for now is print the alphabet. However I'm having some trouble getting used to AT&T syntax (I would rather learn it than keep just using Intel syntax) and I'm also...]]></description>
			<content:encoded><![CDATA[<div>I'm actually writing this code as inline ASM but I feel it is more relevant to ASM than it is to C...<br />
<br />
Basically all I want to do for now is print the alphabet. However I'm having some trouble getting used to AT&amp;T syntax (I would rather learn it than keep just using Intel syntax) and I'm also unsure as to how to solve this segfault I'm getting:<br />
<br />
 <pre style="margin:20px; line-height:13px">#include &lt;stdio.h&gt;<br />
<br />
int main() {<br />
&nbsp; &nbsp; // code<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; asm volatile(&quot;movb %ah, 0x4C\n&quot; /* BIOS interrupt call for output */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;movb $'A', %AL\n&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* Place &quot;A&quot; in AL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;jmp start\n&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;start:\n\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;add $1, %AL\n\t&quot;&nbsp;  /* Add 1 to 'A' to move on to 'B', etc. */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;print:\n\t\t&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;int $0x21\n\t&quot; /* Print contents of AL */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #if 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;hlt\n&quot;&nbsp; &nbsp; &nbsp;  /* Halt the machine (commented out because I think I need ring 0 access to use hlt) */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : &quot; %ax&quot;, &quot;%bx&quot; /* List of registers used (commented out because GCC complained of the comma)&nbsp; &nbsp; &nbsp;  */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #endif<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; // code<br />
&nbsp; &nbsp; return 0;<br />
}</pre><br />
I have tried without the &quot;volatile&quot; keyword. I did nothing, as I expected...<br />
<br />
Thank you :)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>chrisname</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227090.html</guid>
		</item>
		<item>
			<title>String to integer</title>
			<link>http://www.daniweb.com/forums/thread226912.html</link>
			<pubDate>Thu, 01 Oct 2009 02:42:07 GMT</pubDate>
			<description><![CDATA[So when I take an argument off the stack it seems that is in the form of a string, is there a way i can convert it to a integer so i can "cmp" it with another argument which i also wish to convert to an int? I am a newbie to ASM but i do realize this isn't going to be as easy as it is in higher...]]></description>
			<content:encoded><![CDATA[<div>So when I take an argument off the stack it seems that is in the form of a string, is there a way i can convert it to a integer so i can &quot;cmp&quot; it with another argument which i also wish to convert to an int? I am a newbie to ASM but i do realize this isn't going to be as easy as it is in higher level languages. Any help?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>ov3rcl0ck</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread226912.html</guid>
		</item>
		<item>
			<title>read and evaluate string in spim/mips</title>
			<link>http://www.daniweb.com/forums/thread226829.html</link>
			<pubDate>Wed, 30 Sep 2009 17:49:40 GMT</pubDate>
			<description>I believe I can read string using 
 
	li $v0, 8	 
	syscall 
 
how can I take what was read and check if it was a specific value.  
 
e.g.  
 if input was Y then jump to loop label. if it was N then jump to exit label.</description>
			<content:encoded><![CDATA[<div>I believe I can read string using<br />
<br />
	li $v0, 8	<br />
	syscall<br />
<br />
how can I take what was read and check if it was a specific value. <br />
<br />
e.g. <br />
 if input was Y then jump to loop label. if it was N then jump to exit label.<br />
<br />
thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>shahab03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread226829.html</guid>
		</item>
		<item>
			<title>Font color code</title>
			<link>http://www.daniweb.com/forums/thread226792.html</link>
			<pubDate>Wed, 30 Sep 2009 13:14:38 GMT</pubDate>
			<description><![CDATA[Is there a code to set the font color for all outputted text in a86? I have to combine the following two programs, using the background from SIEGE and the content of FTCONV. My problem is that I'm working on a limited timeframe and I'd really like to know if there's something that can speed up my...]]></description>
			<content:encoded><![CDATA[<div>Is there a code to set the font color for all outputted text in a86? I have to combine the following two programs, using the background from SIEGE and the content of FTCONV. My problem is that I'm working on a limited timeframe and I'd really like to know if there's something that can speed up my job, which is to make all the text in FTCONV white when I combine it with SIEGE.<br />
<br />
Any ideas? Files attached below for perusal.</div>  <br /> <div style="padding:5px">     <fieldset class="fieldset"> <legend>Attached Files</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/txt.gif" alt="File Type: txt" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=11864&amp;d=1254316388">SIEGE.txt</a> (19.0 KB)</td> </tr><tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/txt.gif" alt="File Type: txt" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=11865&amp;d=1254316413">ftconv.txt</a> (13.7 KB)</td> </tr> </table> </fieldset>  </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>geno93n0</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread226792.html</guid>
		</item>
		<item>
			<title>Code Snippet Passive TSR Hello World</title>
			<link>http://www.daniweb.com/code/snippet226609.html</link>
			<pubDate>Tue, 29 Sep 2009 19:21:10 GMT</pubDate>
			<description>Assembles under NASM 16-bit,  
invoke INT 0x65 to display message.</description>
			<content:encoded><![CDATA[<div>Assembles under NASM 16-bit, <br />
invoke INT 0x65 to display message.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>NotNull</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread226609.html</guid>
		</item>
		<item>
			<title>OS dev: Procedure that ends a task.</title>
			<link>http://www.daniweb.com/forums/thread226513.html</link>
			<pubDate>Tue, 29 Sep 2009 09:49:37 GMT</pubDate>
			<description><![CDATA[Hello. 
I have an assignment to make a procedure that will end a task. The manual from the university isn't quite clear about how this works. So mainly i have this problem: How does a procedure end a working task? 
1) Does the bios call the procedure  ? or, 
2) Will my current operating system call...]]></description>
			<content:encoded><![CDATA[<div>Hello.<br />
I have an assignment to make a procedure that will end a task. The manual from the university isn't quite clear about how this works. So mainly i have this problem: How does a procedure end a working task?<br />
1) Does the bios call the procedure  ? or,<br />
2) Will my current operating system call my procedure? or,<br />
3) I must make myself an os  that boots, launches a task, and then after an amount of time calls the procedure to end the task and bail out.<br />
I have no idea!<br />
The manual does give some sort of code(which should be changed by me to work properly) that shows how it should look like. But once i don't understand the way it works, how can i know what to change?<br />
The code with comments (translated by me) from the manual:<br />
 <pre style="margin:20px; line-height:13px">PROC&nbsp; &nbsp; &nbsp; &nbsp; newint20h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; int 20h<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; _di<br />
<br />
;keeping back any interruptions so that the task may not be launched when the processor is taken away (me: what does &quot;taken away&quot; mean????)<br />
&nbsp; &nbsp; &nbsp; &nbsp;  pop&nbsp; &nbsp; &nbsp; &nbsp; ax<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop&nbsp; &nbsp; &nbsp; &nbsp; ax&nbsp; &nbsp; &nbsp; &nbsp; ;Extracting from stiva (me: I don't know the true translation of stiva. But one thing for sure: it's a FILO type memory acces)<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop&nbsp; &nbsp; &nbsp; &nbsp; ax<br />
<br />
;extracting the leftovers that are left from the execution of int 20h (we don't need the CS,IP indicators any more) (me: What int 20h? Are they talking about THIS procedure or the system's one.)<br />
&nbsp; &nbsp; &nbsp; &nbsp; push&nbsp; &nbsp; &nbsp; &nbsp;  cs<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop&nbsp; &nbsp; &nbsp; &nbsp; ds<br />
&nbsp; &nbsp; &nbsp; &nbsp; lea&nbsp; &nbsp; &nbsp; &nbsp; di,&#91;cs:firsttask&#93;&nbsp; &nbsp; &nbsp; &nbsp; ; DI = Offset of TASK<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; al,&#91;cs:numtask&#93;&nbsp; &nbsp; &nbsp; &nbsp; ; AL = Task's ID<br />
&nbsp; &nbsp; &nbsp; &nbsp; xor&nbsp; &nbsp; &nbsp; &nbsp; ah,ah&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; AX = Task's ID<br />
&nbsp; &nbsp; &nbsp; &nbsp; push&nbsp; &nbsp; &nbsp; &nbsp;  dx<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dx,515<br />
&nbsp; &nbsp; &nbsp; &nbsp; mul&nbsp; &nbsp; &nbsp; &nbsp; dx&nbsp; &nbsp; &nbsp; &nbsp; ; AX = the starting index of firsttask<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop&nbsp; &nbsp; &nbsp; &nbsp; dx<br />
&nbsp; &nbsp; &nbsp; &nbsp; add&nbsp; &nbsp; &nbsp; &nbsp; di,ax&nbsp; &nbsp; &nbsp; &nbsp; ; DI = putting the top of the stiva in di<br />
<br />
;Putting a 255 value into task's ID , marking it as non-loaded.<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; &#91;Byte Ptr cs:di&#93;,255<br />
&nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; &nbsp; &nbsp; dx,&#91;cs:di+3&#93;<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; FreeMemory<br />
&nbsp; &nbsp; &nbsp; &nbsp; call&nbsp; &nbsp; &nbsp; &nbsp; _ei<br />
&nbsp; &nbsp; &nbsp; &nbsp; jmp&nbsp; &nbsp; &nbsp; &nbsp; int08new<br />
; Freeing the memory, and beginning the execution of int 8;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ENDP&nbsp; &nbsp; &nbsp; &nbsp; newint20</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum125.html">Assembly</category>
			<dc:creator>Alex_</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread226513.html</guid>
		</item>
	</channel>
</rss>
