My_strings.asm

URL: https://mirkwood.cs.edinboro.edu/~bennett/class/cmsc3100/spring2026/notes/functions/code/hw/My_strings.asm
 
global My_isupper

; this function takes one parameter, so that will be in rdi
; it returns one value, in rax
;    0 if rdi contains a non-upper case letter
;    1 if rdi contains an upper case letter
My_isupper:

   ; if (rsi < 'A') return false
   cmp dil, 41h
   jl not

   ; if (rsi > 'Z') return false
   cmp dil, 5Ah
   jg not

   ; return true
   mov rax, 1
   jmp done

not:
   mov rax, 0
  
done:

   ret