Skip to content

Instantly share code, notes, and snippets.

@Yousif-FJ
Last active June 30, 2022 13:52
Show Gist options
  • Save Yousif-FJ/5f6559baefc7ff16e2f913cdece6a106 to your computer and use it in GitHub Desktop.
Save Yousif-FJ/5f6559baefc7ff16e2f913cdece6a106 to your computer and use it in GitHub Desktop.
Q/Print the largest ASCII value character from a string inputted by user using 86 assembly
org 100h
.DATA
STR DB 30 DUP(' ')
LEN DW 0
CHAR DB ?
.CODE
LEA DI,STR
Input:
MOV AH,1
INT 21H
CMP AL,0DH
JE StopInput
MOV [DI],AL
INC DI
INC LEN
JMP Input
StopInput:
MOV [DI],'$'
MOV CX,LEN
LEA DI,STR
MOV AL,[DI]
INC DI
CompValues:
CMP [DI],AL
JL SkipValue
MOV AL,[DI]
SkipValue:
INC DI
LOOP CompValues
MOV CHAR,AL
MOV AX,0003H
INT 10H
MOV DL,CHAR
MOV AH,2
INT 21H
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment