home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1995 / ARCHIVE95.iso / discs / shareware / share_46 / sasm / Examples / Immed < prev    next >
Text File  |  1993-03-20  |  1KB  |  37 lines

  1. ;--> Immed
  2.  
  3. ; Just a piece of nonsense to illustrate the 
  4. ; enhanced second operator using SAsm
  5. ; ⌐ D.J.Holden 1992
  6.  
  7.  
  8.  
  9.  
  10. # org  &8000          ;assemble code to run at &8000
  11.  
  12. # type &FF8             ; 'Absolute' application to be loaded at &8000
  13.  
  14. # size &400             ; Allocate 1K for assembled code
  15.  
  16.  
  17.         mov r0,"A"             ;load ascii 'A' into r0
  18.         swi "OS_WriteC"        ;and print it
  19.  
  20.         mov r0,"B"             ;load ascii 'B' into r0
  21.         teq r0,"A"             ;see if the contents of r0 = ascii 'B'
  22.         swine "OS_WriteC"      ;print it only if they're not
  23.  
  24.         mov r0,042             ;load &42 into r0 = ascii 'B'
  25.         cmp r0,"C"             ;compare with ascii 'C'
  26.         addne r0,r0,#1         ;if r0 doesn't = 'C' add one
  27.         swi "OS_WriteC"        ;print whatever's in r0
  28.  
  29.         swi "OS_NewLine"
  30.  
  31.         swi "OS_Exit"          ;quit
  32.  
  33.  
  34. ; Note that this file doesn't have an #END directive so a 
  35. ; warning will be given but it will be assembled OK
  36.  
  37.