1.若两个数中有一个是奇数,一个是偶数,则将它们互换储存地址 2.若两个数都是奇数,则分别加一 3.若两个数都是偶数,则不变 DATA SEGMENT A DB 12H B DB 25H DATA ENDS STACK SEGMENT STACK ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA,SS:STACK START: MOV AX,DATA MOV DS,AX MOV AL,0 MOV BL,A TEST BL,01H JZ ADD_TIME_1 ONE…
已知整数m,n,p,q适合(m-p)|(mn+pq)证明:(m-p)|(mq+np) 证明: 令(mn+pq)—(mq+np) =mn-np+pq-mq =n(m-p)+q(p-m) =(n-q)(m-p) 所以,ma+np一定可以被m-p整除.…
学好算法很重要,然后要学好算法,大量的练习是必不可少的,LeetCode是我经常去的一个刷题网站,上面的题目非常详细,各个标签的题目都有,可以整体练习,本公众号后续会带大家做一做上面的算法题. 官方链接:https://leetcode-cn.com/problemset/all/ 一.题意 难度:中等 https://leetcode-cn.com/problems/integer-to-roman/ 罗马数字包含以下七种字符:I, V, X, L,C,D 和 M. 字符 数值 I 1 V 5…
DATA SEGMENT X DB 10 Y DB 20 Z DB 00 DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV AL,X ADD AL,Y MOV CL,3 SHL AL,CL SUB AL,X MOV CL,2 SHR AL,CL MOV AH,4CH INT 21H CODE ENDS END START…
DATA SEGMENT INFO DB 'HOW ARE YOU!$' DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX LEA DX,INFO MOV AH,09H INT 21H MOV AH,4CH INT 21H CODE ENDS END START…
DATA SEGMENT DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV CX,8 MOV AH,02H MOV DL,40H SIGN: INC DL INT 21H LOOP SIGN MOV AH,4CH INT 21H CODE ENDS END START…
DATA SEGMENT ORG 1000H INFO DB 1,2,3,4,5,70H,71H,72H,80H,92H MAX DB 00H DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV CX,10 MOV BX,1000H DEC BX SIGN: INC BX MOV DL,BYTE PTR [BX] CMP DL,MAX JA CHANGE NEXT: LOOP SIGN MO…
DATA SEGMENT ORG 2000H INFO DB 1,2,3,4,5,70H,71H,72H,80H,92H N_NUMS DB 00H P_NUMS DB 00H DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV CX,10 MOV BX,2000H DEC BX SIGN: INC BX TEST BYTE PTR [BX],80H JNZ NEG_NUM INC P_NU…