home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / crossasm / ps68a12.zip / EXAMPLE.ASM < prev    next >
Assembly Source File  |  1986-11-30  |  2KB  |  53 lines

  1. ; To become familiar with the segment feature you
  2. ; should assemble this file with and without the
  3. ; single object module swicth enabled.
  4. ;
  5. ;   a68  -o example         ;three object module files
  6.                             ;     code.seg
  7.                             ;     memory.seg
  8.                             ;     rom2.seg
  9. ;
  10. ;   a68  example            ;one object module file example.obj
  11.  
  12.  
  13.          .db h'00,o'77,h'77,d'77,77,077
  14.          .org  h'20         ;start assembly at location 20 hex.
  15.          .segment .memory   ;declare a new segmemt for ram memory
  16.                             ;allocation
  17.          .memory            ;select segment .memory as active(locaton counter)
  18.                             ;for the .code segment(created by the assembler) is
  19.                             ;saved for when we switch back.
  20.          .org  h'8000       ;Ram starts at 8000 hex.
  21. var1:    .rs 1              ;variable 1
  22. var16:   .rs 2              ;16 bit variable
  23. array:   .rs 100*2          ;100 16 bit word array
  24.          .eject             ;lets start on a fresh page of paper.
  25.                             ;notice that an page eject does not print!
  26.                             ;test list off
  27.          .command -l        ;this should not print
  28.          .db "this is a .db test (fcc on some oem assemblers)"
  29.          .command +l        ;this also should not print
  30.                             ;this line should print
  31.          .code              ;switch back to code segment
  32.                             ; origin is where we left off.
  33. loop:    .dw loop,loop2
  34.          .drw loop,loop2
  35.          .equ cr,13         ;equated idienifiers are constant.
  36.          .equ htab,9
  37.          .set temp,23       ;set identifiers may be re-set.
  38.          .set temp,24
  39.          .set temp,25
  40.          .db  1,2,3,4,5,'p'
  41.          .db  6,7,"this is a test\r\n\0"
  42.          .dw  1,h'1234
  43.          .drw 1,h'1234
  44.          .page              ;start on a new 256 byte boundary.
  45. loop2:   .db loop2 >> 3
  46.          .segment .rom2,-x'800  ;my programmer only likes 0..n addresses
  47.          .rom2
  48.          .org h'800
  49.          .db  "this is possibly an external rom programmed seperately."
  50.          .code
  51.          .end loop          ;end of assembly, specifying start address.
  52.  
  53.