⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matrix.asm

📁 介绍用Java解析网络数据的三种特殊方法
💻 ASM
字号:
; Matrix transpose sample
; (reverse rows with columns).


#make_COM#

ORG 100h

jmp start

; To view matrix select
; "Variables" from "View"
; menu of the emulator
; and set [Elements] property
; to "3" for these items:
;   MATRIX
;   ROW1
;   ROW2

matrix_size EQU 3

; ----- matrix ------
matrix     db 1,2,3
row1       db 4,5,6
row2       db 7,8,9
;--------------------

i dw ?
j dw ?

start:

mov i, 0
next_i:

	; j = i + 1
	mov cx, i
	inc cx
	mov j, cx
	next_j:
	
		MOV SI, i
		MOV BX, j
	
		MOV AL, matrix_size
		MOV CX, SI
		MUL CL
		MOV SI, AX	
		MOV DL, matrix[SI][BX]
		
		MOV SI, i
		MOV AL, matrix_size
		MUL BL
		MOV BX, AX
		XCHG matrix[BX][SI], DL
		
		MOV BX, j
		MOV AL, matrix_size
		MOV CX, SI
		MUL CL
		MOV SI, AX
		MOV matrix[SI][BX], DL
	
	INC j
	CMP j, matrix_size
	JB next_j	
INC i
CMP i, matrix_size/2
JBE next_i

ret

end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -