home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 3 / FreeSoftwareCollection3pd199x-jp.img / ms_dos / cmos / cmos.asm next >
Assembly Source File  |  1980-01-02  |  3KB  |  198 lines

  1.     page    90, 126
  2.     title    'FM series CMOS ram display'
  3.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.     ;    FM series CMOS ram display
  5.     ;     cmos ram display utility
  6.     ;
  7.     ;file name:    CMOS.EXE
  8.     ;machine:    FM-TOWNS & FM-R series
  9.     ;cpu:        8086, 80186, 80286, 80386
  10.     ;other file:    none
  11.     ;asm:        masm ver5.1
  12.     ;tab:        8
  13.     ;price:        none
  14.     ;copy:        free
  15.     ;copyright:    (C) YACHT 1989.
  16.     ;date:        Tue, 23 Mar 1989 V1.0A
  17.     ;        Wed,  4 Oct 1989 V1.00B
  18.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19.  
  20.     .8086            ; for 8086
  21.  
  22.     assume    cs: CODE, ss: STACK
  23.  
  24. CODE    segment    para public
  25.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26.     ;    main
  27.     ;in:    ds = PSP seg
  28.     ;out:    none
  29.     ;dest:    ?
  30.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  31. main    proc    far
  32.     jmp    main2
  33.  
  34. main2:    mov    ax, ds
  35.     mov    es, ax
  36.  
  37.     mov    ax, DATA
  38.     mov    ds, ax
  39.         assume    ds: DATA
  40.     mov    cx, 800h
  41.     mov    dx, 3000h
  42.     mov    bx, offset cmos
  43. @@:    in    al, dx
  44.     mov    [ bx ], al
  45.     inc    bx
  46.     add    dx, 0002
  47.     loop    short @b
  48.  
  49.     mov    dx, offset msg
  50.     mov    ah, 9
  51.     int    21h
  52.  
  53.     mov    si, offset cmos
  54.     xor    bx, bx
  55.  
  56.     mov    dx, 0080h
  57.  
  58. mainlp:    call    prtbx
  59.     call    prnts
  60.  
  61.     mov    cx, 0010h
  62.     push    bx
  63. @@:    mov    al, [ si + bx ]
  64.     inc    bx
  65.     call    prthx
  66.     call    prnts
  67.     loop    short @b
  68.     pop    bx
  69.     mov    al, ':'
  70.     call    prnt
  71.     mov    cx, 0010h
  72. sublp:    mov    al, [ si + bx ]
  73.     inc    bx
  74.     cmp    al, ' '
  75.     jnc    short @f
  76.     mov    al, ' '
  77. @@:    cmp    al, 7fh
  78.     jc    short @f
  79.     mov    al, ' '
  80. @@:    call    prnt
  81.     loop    short sublp
  82.     call    letnl
  83.     dec    dx
  84.     jnz    short mainlp
  85.  
  86.     mov    ax, 4c00h
  87.     int    21h
  88. main    endp
  89.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  90.     ;    prnts
  91.     ;in:    none
  92.     ;out:    none
  93.     ;dest:    ax, flags
  94.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  95. prnts    proc    near
  96.     mov    al, ' '
  97.     jmp    short    prnt
  98. prnts    endp
  99.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  100.     ;    prnt
  101.     ;in:    al = char
  102.     ;out:    none
  103.     ;dest:    flags
  104.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  105. prnt    proc    near
  106.     push    ax
  107.     push    dx
  108.     mov    ah, 2
  109.     mov    dl, al
  110.     int    21h
  111.     pop    dx
  112.     pop    ax
  113.     ret
  114. prnt    endp
  115.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  116.     ;    letnl
  117.     ;in:    none
  118.     ;out:    none
  119.     ;dest:    flags
  120.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  121. letnl    proc    near
  122.     push    ax
  123.     push    dx
  124.     mov    ah, 9
  125.     mov    dx, offset crlf
  126.     int    21h
  127.     pop    dx
  128.     pop    ax
  129.     ret
  130. letnl    endp
  131.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  132.     ;    prthx
  133.     ;in:    al = data
  134.     ;out:    none
  135.     ;dest:    ax, flags
  136.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  137. prthx    proc    near
  138.     push    ax
  139.     shr    al, 1            ; shr al, 4
  140.     shr    al, 1
  141.     shr    al, 1
  142.     shr    al, 1
  143.     call    asc
  144.     pop    ax
  145.     and    al, 0fh
  146.     call    asc
  147.     ret
  148. prthx    endp
  149.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  150.     ;    asc
  151.     ;in:    al = data
  152.     ;out:    none
  153.     ;dest:    al, flags
  154.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  155. asc    proc    near
  156.     add    al, '0'
  157.     cmp    al, '9' + 1
  158.     jc    @f
  159.     add    al, 7
  160. @@:    call    prnt
  161.     ret
  162. asc    endp
  163.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  164.     ;    prtbx
  165.     ;in:    bx = data
  166.     ;out:    none
  167.     ;dest:    al, flags
  168.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  169. prtbx    proc    near
  170.     mov    al, bh
  171.     call    prthx
  172.     mov    al, bl
  173.     call    prthx
  174.     ret
  175. prtbx    endp
  176. CODE    ends
  177. ;==========================================================
  178. ;    data segment
  179. ;==========================================================
  180.  
  181. DATA    segment    para public
  182.  
  183. cmos    equ    $
  184.     db    1000h dup (?)
  185.  
  186. msg    db    'FM Series C-MOS data display Version 1.00B'
  187. crlf    db    13, 10, '$'
  188. DATA    ends
  189. ;==========================================================
  190. ;    stack segment
  191. ;==========================================================
  192. STACK    segment    para public
  193.     dw    128 dup(?)
  194. spoint    equ    $
  195. STACK    ends
  196.  
  197.     end    main
  198.