Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Write a program that is able to generate a multiplication table (10x10) and store it
- DIM EQU 10
- .MODEL small
- .STACK
- .DATA
- matr DB DIM*DIM DUP (?)
- .CODE
- .STARTUP
- MOV DI,0
- MOV BX,0
- MOV CH,1
- ciclo1:
- MOV CL,1
- ciclo2: ;into this cycle, CL change untile DIM, while CH is kept fixed
- MOV AL,CH
- MUL CL
- MOV WORD PTR matr[BX][DI],AX
- ;o scrivo MOV matr[BX][DI],AL
- INC DI
- INC CL
- CMP DI,DIM
- JNE ciclo2
- MOV DI,0
- INC BX
- INC CH ;It's as if CH flows in vertical on the rows and CL in horizontal on the columns
- ;i.e. is as if CH flows together with BX, and CL together with DI
- CMP BX,DIM
- JNE ciclo1
- MOV AH,2
- MOV DX,0
- MOV BX,0
- MOV SI,0
- print1:
- print2:
- MOV DL,matr[BX][SI]
- ADD DL,'0'
- INT 21h
- INC SI
- CMP SI,DIM
- JNE print2
- INC BX
- MOV SI,0
- CMP BX,DIM
- JNE print1
- .EXIT
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement