View Full Version : Help Calcolatori Assembler
Hardcore
24th October 2007, 18:39
Alcune domandine che nn ci riesco a saltare fuori :shocked:
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 :look:?
fatto questo
se faccio mov Ax,[Bx] Sposto in Ax il contenuto di BX
ma se faccio mov Ax, Bx che succede ? :afraid:
Alkabar
24th October 2007, 18:53
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
Hardcore
24th October 2007, 19:10
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?
Kith
24th October 2007, 21:19
mette in Ax l'indirizzo di Bx
Alkabar
25th October 2007, 00:03
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.
Kith
25th October 2007, 10:27
ah gia ha ragione alka :sneer:
vabbè sono 5 anni che non tocco assembler :/
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.