Home > other >  programming
programming

Time:05-15

Which bosses can you help me to change my program, don't use the stack, the SS with DS
Enter a string from the keyboard, ends with a '$' character to mark, the length of the string is less than 255 square root. The statistical string programming [0 ~ 9] the number of square root,
And will result in the LENTH unit square root, in the form of (decimal) on the screen shows the number of digit symbol, asked to statistics symbols by subroutine to complete,
The STACK SEGMENT STACK
DW 0 FFH DUP (?)
TOP LABEL WORD
STACK ENDS
CODE SEGMENT
ASSUME CS: CODE, SS: STACK
MOV AX, STACK
MOV SS, AX
LEA SP, TOP
XOR BX, BX
L1: MOV AH, 1
INT 21 h
CMP AL, 24 h; To judge whether the '$', is the end of the
JZ LENTH
CMP AL, 30 h; Determine whether greater than zero, or determine the next character
JB L1
CMP AL, 39 h; Determine if less than 9, or determine the next character
JZ L1
CMP AL, 30 h; Determine whether greater than zero, is go makes BX since 1
JA GESHU
CMP AL, 39 h; Determine if less than 9, is go makes BX since 1
JB GESHU
JMP L1
GESHU: INC BX
JMP L1
LENTH, MOV AH, 4 ch
INT 21 h
CODE ENDS
END L1

CodePudding user response:

Don't use the stack way? You define a stack, and that's just not explicitly using stack?