Changeset 4f508e6 in buchla-68k for vlib/vputa.s


Ignore:
Timestamp:
07/01/2017 02:34:46 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
08e1da1
Parents:
f40a309
Message:

Converted assembly language files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlib/vputa.s

    rf40a309 r4f508e6  
    1 * ------------------------------------------------------------------------------
    2 * vputa.s -- store character attributes in video RAM
    3 * Version 1 -- 1988-03-14 -- D.N. Lynx Crowe
    4 * (c) Copyright 1988 -- D.N. Lynx Crowe
    5 * ------------------------------------------------------------------------------
    6 *
    7 *       vputa(sbase, row, col, attrib)
    8 *       unsigned int *sbase, row, col, attrib;
    9 *
    10 *               Stores attribute value 'attrib' for the character
    11 *               located at ('row','col') in VSDD RAM starting at 'sbase'.
    12 *               Assumes a 64 character line and full character attributes.
    13 * ------------------------------------------------------------------------------
     1| ------------------------------------------------------------------------------
     2| vputa.s -- store character attributes in video RAM
     3| Version 1 -- 1988-03-14 -- D.N. Lynx Crowe
     4| (c) Copyright 1988 -- D.N. Lynx Crowe
     5| ------------------------------------------------------------------------------
     6
     7|       vputa(sbase, row, col, attrib)
     8|       unsigned int |sbase, row, col, attrib;
     9
     10|               Stores attribute value 'attrib' for the character
     11|               located at ('row','col') in VSDD RAM starting at 'sbase'.
     12|               Assumes a 64 character line and full character attributes.
     13| ------------------------------------------------------------------------------
    1414                .text
    15 *
     15
    1616                .xdef   _vputa
    17 *
    18 SBASE           .equ    8               * LONG - 'sbase'
    19 ROW             .equ    12              * WORD - 'row'
    20 COL             .equ    14              * WORD - 'col'
    21 ATTR            .equ    16              * WORD - 'attrib'
    22 *
    23 _vputa:         link    a6,#0           * Link stack frame pointer
    24                 clr.l   d0              * Clear out d0
    25                 move.w  ROW(a6),d0      * Get row
    26                 lsl.l   #6,d0           * Multiply by 64  (shift left 6)
    27                 move.w  COL(a6),d1      * Get col
    28                 andi.l  #$0000003F,d1   * Mask down to 6 bits
    29                 or.l    d1,d0           * OR into d0 to get char. #
    30                 move.w  d0,d1           * Develop cw = (cn/2)*6 in d1
    31                 andi.l  #$FFFFFFFE,d1   * ...
    32                 move.l  d1,d2           * ...
    33                 add.l   d1,d1           * ...
    34                 add.l   d2,d1           * ...
    35                 add.l   SBASE(a6),d1    * Add sbase to cw
    36                 movea.l d1,a0           * a0 points at the word with the char.
    37                 btst.l  #0,d0           * Odd char. location ?
    38                 bne     vputa1          * Jump if so
    39 *
    40                 move.w  ATTR(a6),2(a0)  * Store new attribute word in video RAM
    41 *
    42 vputax:         unlk    a6              * Unlink the stack frame
    43                 rts                     * Done -- return to caller
    44 *
    45 vputa1:         move.w  ATTR(a6),4(a0)  * Store new attribute word in video RAM
    46                 bra     vputax          * Done -- go return to caller
    47 *
     17
     18SBASE           =       8               | LONG - 'sbase'
     19ROW             =       12              | WORD - 'row'
     20COL             =       14              | WORD - 'col'
     21ATTR            =       16              | WORD - 'attrib'
     22
     23_vputa:         link    a6,#0           | Link stack frame pointer
     24                clr.l   d0              | Clear out d0
     25                move.w  ROW(a6),d0      | Get row
     26                lsl.l   #6,d0           | Multiply by 64  (shift left 6)
     27                move.w  COL(a6),d1      | Get col
     28                andi.l  #0x0000003F,d1  | Mask down to 6 bits
     29                or.l    d1,d0           | OR into d0 to get char. #
     30                move.w  d0,d1           | Develop cw = (cn/2)|6 in d1
     31                andi.l  #0xFFFFFFFE,d1  | ...
     32                move.l  d1,d2           | ...
     33                add.l   d1,d1           | ...
     34                add.l   d2,d1           | ...
     35                add.l   SBASE(a6),d1    | Add sbase to cw
     36                movea.l d1,a0           | a0 points at the word with the char.
     37                btst.l  #0,d0           | Odd char. location ?
     38                bne     vputa1          | Jump if so
     39
     40                move.w  ATTR(a6),2(a0)  | Store new attribute word in video RAM
     41
     42vputax:         unlk    a6              | Unlink the stack frame
     43                rts                     | Done -- return to caller
     44
     45vputa1:         move.w  ATTR(a6),4(a0)  | Store new attribute word in video RAM
     46                bra     vputax          | Done -- go return to caller
     47
    4848                .end
Note: See TracChangeset for help on using the changeset viewer.