Muphet's Profile User Rating: -----

Reputation: 0 Apprentice
Active Posts:
18 (0.02 per day)
01-May 12
Profile Views:
Last Active:
User is offline Apr 20 2013 04:35 AM

Previous Fields

Dream Kudos:
Icon   Muphet has not set their status

Posts I've Made

  1. In Topic: [php/jq] Live search problem

    Posted 20 Apr 2013

    oh wow, it actually works. Thanks mate, I really appreciate this
  2. In Topic: display navigation menu

    Posted 27 Dec 2012

    i posted exact error genius.
    "Warning: Invalid argument supplied for foreach() in E:\tools\WebServ\httpd\core.php on line 33"
    which is "foreach($type as $key => $value)"

    I wanted to display key within value of different array, thats why I used $type[$key].

    error in this line: foreach($type as $key => $value){ //Invalid argument supplied for foreach()
  3. In Topic: Write data into text file

    Posted 10 Dec 2012

    So for now, program works exactly as I wanted but theres is small thing that i want to know. Writing bits to the file. Dunno why it's required but it actually is. I found, that writing data to file is moving byte number to CX register. It's working for 1 byte, but when I try to write more (for example same two digit number), it saves only one number and one ascii code. This works with every next byte. Problem is also in writing. It causes to save only the last character instead from left to right.
    This is my code, writing to file is located at the end.
    .model small
    .stack 200H
       msg1 DB 10,13,'Enter the first no: $'
       msg2 DB 10,13,'Enter the second no: $'
       msg3 DB 10,13,'sum = $'
       newline DB 10,13, ' $'
       file DB 'results.txt',00
       sum DW ?
       print MACRO msg ;macro definition
       PUSH AX
       PUSH DX
       MOV AH,09H
       MOV DX,offset msg
       INT 21H
       POP DX
       POP AX
       print msg1
       CALL readnumtoAX
       MOV CX,AX
       print newline
       print msg2
       CALL readnumtoAX
       print newline
       print msg3
       ADD ax,cX
       CALL displayAX
       CALL saveAX
    readnumtoAX PROC NEAR
       PUSH BX
       PUSH CX
       MOV CX,10
       MOV BX,00
       MOV AH,01H
       INT 21H
       CMP AL,'0'
       JB skip
       CMP AL,'9'
       JA skip
       SUB AL,'0'
       PUSH AX
       MOV AX,BX
       MUL CX
       MOV BX,AX
       POP AX
       MOV AH,00
       ADD BX,AX
       JMP back
       MOV AX,BX
       POP CX
       POP BX
    readnumtoAX ENDP
    displayAX PROC NEAR
       PUSH DX
       PUSH CX
       PUSH BX
       PUSH AX
       MOV CX,0
       MOV BX,10
       MOV DX,0
       DIV BX
       PUSH DX
       INC CX
       OR AX,AX
       JNZ back1
       POP DX
       ADD DL,30H
       MOV AH,02H
       INT 21H
       	MOV sum,ax
       LOOP back2
       POP AX
       POP BX
       POP CX
       POP DX
      displayAX ENDP
      saveAX PROC NEAR
    	MOV AH,3CH
    	MOV CX,0
    	LEA DX,file
    	INT 21H
    	MOV BX,AX
    	MOV AH,40H
    	MOV DX,offset sum
    	MOV CX,1
    	INT 21H
    	MOV AH,04CH
    	INT 21H
      saveAX ENDP

    How to write more bytes to file which depends on addition result?
    (for those who don't know what's going on, this is simple program to sum two user input digits and then save result to txt file)

My Information

Member Title:
New D.I.C Head
Age Unknown
Birthday Unknown

Contact Information



Muphet hasn't added any friends yet.


Muphet has no profile comments yet. Why not say hello?