
Instruction Set
4-79
JA
JA
Examples
This example converts a zero-terminated string to uppercase and replaces the
original string.
Tips
If you need to jump to an instruction at
farlabel that is more than 128 bytes away, use the
following sequence of statements:
JNA nearlabel
; This does the equivalent of a long jump
JMP farlabel
; based on the JA condition.
nearlabel:
Related Instructions
If you want to
See
Compare two components using subtraction and set the flags accordingly
CMP
Jump if the result of a previous
unsigned
comparison was
below or equal
JBE
Jump if the result of a previous
integer
comparison was
greater
JG
Jump unconditionally
JMP
Set the flags according to whether particular bits of a component are set to 1
TEST
astring dup30db (?)
; set DS:[SI] and ES:[DI] to both point to astring
PUSH
DS
; save DS and ES
PUSH
ES
MOV
AX, SEG astring
MOV
DS,AX
MOV ES,AX
MOV
DI,offset astring
MOV
SI,offset astring
LCONVERT_START:
LODSB
AL,[SI]
; get the character in AL
CMP
AL,’a’
; compare against ’a’
JB
LWRITE_IT
; not in range, don’t convert
CMP
AL,’z’
; compare against ’z’
JA
LWRITE_IT
; not in range, don’t convert
ADD
AL,’A’-’a’
; convert
LWRITE_IT:
STOSB
; write it out
CMP
AL,0
; are we done?
JNE
LCONVERT_START
; not done so loop
POP
ES
; restore original DS and ES values
POP
DS
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...