Results 1 to 6 of 6

Thread: Help Calcolatori Assembler

  1. #1
    Ensign Hardcore's Avatar
    Join Date
    Sep 2006
    Location
    Modena
    Posts
    3.550

    Default Help Calcolatori Assembler

    Alcune domandine che nn ci riesco a saltare fuori

    Allora presi i registri AX BX

    e preso Ds= A0000

    presi Ds:Ax e Ds:B

    e faccio...

    mov Bx,2

    ? vuol dire... che in Bx inserisco 0002? quindi la base partirebbe da 0002 ?

    fatto questo

    se faccio mov Ax,[Bx] Sposto in Ax il contenuto di BX

    ma se faccio mov Ax, Bx che succede ?


  2. #2
    Lieutenant Commander Alkabar's Avatar
    Join Date
    Feb 2004
    Location
    Netherlands.
    Posts
    19.975

    Default

    http://www.csn.ul.ie/~darkstar/assembler/tut3.html

    edit: sob viene fuori scasinata...


    The MOV Instruction

    The MOV instruction is the instruction which will appear more than any other in an assembler program. All that is does is it copies a piece of data from one location to another. It is similar in concept to the MOVE operator in the COBOL language, but it is used far more frequently. Here are a few examples of MOV instructions.
    MOV BX,AX
    MOV CH,DH
    MOV BH,DL
    MOV AH,12
    MOV AH,0Ch

    MOV DL,"*"
    MOV DL,42 ; This copies the contents of the AX register into the BX register.
    ; This copies the top byte of the DX register into the top byte of the CX register.
    ; This copies the bottom byte of the DX register into the top byte of BX.
    ; This puts the value 12 decimal into the top half of the AX register.
    ; This does the same as the above except that the number is given in hexadecimal.
    ; Hexadecimal numbers MUST begin with a digit and end with a "h".
    ; This puts the character "*" into DL (lower half of DX).
    ; This does the same thing, as characters are stored as numbers. ( ASCII char 42 = "*" )

    The above are all prefectly legal assembler statements ( notice that comments are preceded by a ";". This is the same as "//" in C++ or "*" in COBOL). In fact you could type the above statements into a text file and it would assemble with A86. (If you do try to do this, do NOT run the .com file generated as it will not terminate!). There are a number of things that you cannot do with the MOV instruction:
    MOV AX,BH
    MOV CH,BX
    MOV 12,DL

    MOV DL,AL,CL
    MOV AH ; Invalid operation, as you cannot move an 8 bit quantity to a 16 bit one.
    ; Similar to above, you cannot put a 16 bit quantity into an 8 bit one.
    ; You cannot put a value into the number 12. If you see this is a program what
    ; is probably meant is MOV DL,12 - put 12 into DL.
    ; You cannot have 3 operands!
    ; Neither can you have only 1! You must have exactly 2: destination and source

  3. #3
    Ensign Hardcore's Avatar
    Join Date
    Sep 2006
    Location
    Modena
    Posts
    3.550

    Default

    si queste cose le so, ma rimane cmq il dubbio :

    se mov Ax,Bx copia il contenuto di di Bx in Ax, allora

    mov Ax,[Bx] cosa fa? copia l'indrizzo di Bx in Ax?, assegna ad Ax lo stesso indirizzo di Bx?


  4. #4
    Lieutenant Commander Kith's Avatar
    Join Date
    Apr 2004
    Location
    Milano
    Posts
    22.142

    Default

    mette in Ax l'indirizzo di Bx
    featuring new Uber Computer: i7-950(turbo on 3,2ghz) with 6 GB XMS Corsair RAM , Nvidia Geforce 460 GTX @ 700mhz , on Gigabyte X58A UD3R rev 2.0, HD Seagate 1TB, Ali Corsair Modular 650w, Thermaltake V9 BLACCKX.

  5. #5
    Lieutenant Commander Alkabar's Avatar
    Join Date
    Feb 2004
    Location
    Netherlands.
    Posts
    19.975

    Default

    Quote Originally Posted by Hardcore View Post
    si queste cose le so, ma rimane cmq il dubbio :
    se mov Ax,Bx copia il contenuto di di Bx in Ax, allora
    mov Ax,[Bx] cosa fa? copia l'indrizzo di Bx in Ax?, assegna ad Ax lo stesso indirizzo di Bx?
    l'unica plausibile e' che ci metta l'indirizzo del registro.

    Devi guardare che fanno le parentesi quadre comunque...

    edit:

    gigacagata

    add [bx],ax ;add value in ax to memory _word_ pointed to by bx

    quelle parentesi quadre significano tipo -> piglia la word in memoria puntata dal registro bx .

    Quindi quel mov prende la word puntata da bx e la mette in ax.
    Last edited by Alkabar; 25th October 2007 at 01:30.

  6. #6
    Lieutenant Commander Kith's Avatar
    Join Date
    Apr 2004
    Location
    Milano
    Posts
    22.142

    Default

    ah gia ha ragione alka

    vabbè sono 5 anni che non tocco assembler :/
    featuring new Uber Computer: i7-950(turbo on 3,2ghz) with 6 GB XMS Corsair RAM , Nvidia Geforce 460 GTX @ 700mhz , on Gigabyte X58A UD3R rev 2.0, HD Seagate 1TB, Ali Corsair Modular 650w, Thermaltake V9 BLACCKX.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[Output: 57.74 Kb. compressed to 48.78 Kb. by saving 8.95 Kb. (15.51%)]