all repos — xyw @ 7080189bfbe1142ee142ec78c35df1b34184a68a

A minimal virtual machine and assembler for terminals.

examples/lib/lowcase.xyw

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
; Convert a string to lowercase 
; a16 ->
.label lowcase
  ; store index
  POPxw
  .label lowcase.loop
    LDBxw $00 EQU lowcase.end JCNw
    ; check if an uppercase letter
    LDBxw $40 GTH
    LDBxw $5B LTH
    AND lowcase.change JCNw
    ; continue
    INCxw lowcase.loop JMPw
    .label lowcase.change
      ; convert to lowercase  
      LDBxw $20 ADD STBxw
      ; continue 
      INCxw lowcase.loop JMPw
    .label lowcase.end
      RTS