Changeset 4f508e6 in buchla-68k for vlib/vputcv.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/vputcv.s

    rf40a309 r4f508e6  
    1 * ------------------------------------------------------------------------------
    2 * vputcv.s -- store a character and attributes in video RAM
    3 * Version 1 -- 1988-10-05 -- D.N. Lynx Crowe
    4 * (c) Copyright 1988 -- D.N. Lynx Crowe
    5 * ------------------------------------------------------------------------------
    6 *
    7 *       vputcv(adr, row, col, chr, atr, cols)
    8 *       unsigned int *adr, row, col, chr, atr, cols;
    9 *
    10 *               Stores character 'chr' at ('row', 'col') in the
    11 *               full attribute text object at 'adr' with
    12 *               attribute value 'atr' using a line length of 'len'.
    13 * ------------------------------------------------------------------------------
    14 *
     1| ------------------------------------------------------------------------------
     2| vputcv.s -- store a character and attributes in video RAM
     3| Version 1 -- 1988-10-05 -- D.N. Lynx Crowe
     4| (c) Copyright 1988 -- D.N. Lynx Crowe
     5| ------------------------------------------------------------------------------
     6
     7|       vputcv(adr, row, col, chr, atr, cols)
     8|       unsigned int |adr, row, col, chr, atr, cols;
     9
     10|               Stores character 'chr' at ('row', 'col') in the
     11|               full attribute text object at 'adr' with
     12|               attribute value 'atr' using a line length of 'len'.
     13| ------------------------------------------------------------------------------
     14
    1515                .text
    16 *
     16
    1717                .xdef   _vputcv
    18 *
    19 P_ADR           .equ    8
    20 P_ROW           .equ    12
    21 P_COL           .equ    14
    22 P_CHR           .equ    16
    23 P_ATR           .equ    18
    24 P_LEN           .equ    20
    25 *
     18
     19P_ADR           =       8
     20P_ROW           =       12
     21P_COL           =       14
     22P_CHR           =       16
     23P_ATR           =       18
     24P_LEN           =       20
     25
    2626                .page
    27 *
    28 _vputcv:        link    a6,#0           * Link stack frame pointer
    29                 move.w  P_ROW(a6),d0    * Get row
    30                 mulu    P_LEN(a6),d0    * Multiply by len
    31                 clr.l   d1              * Clear out d1
    32                 move.w  P_COL(a6),d1    * Get col
    33                 add.l   d1,d0           * Add col into d0 to get char. #
    34                 move.l  d0,d1           * Develop cw = (cn/2)*6 in d1
    35                 andi.l  #$FFFFFFFE,d1   * ...
    36                 move.l  d1,d2           * ...
    37                 add.l   d1,d1           * ...
    38                 add.l   d2,d1           * ...
    39                 add.l   P_ADR(a6),d1    * Add sbase to cw
    40                 movea.l d1,a0           * a0 points at the word with the char.
    41                 btst.l  #0,d0           * Odd char. location ?
    42                 bne     vputcv1         * Jump if so
    43 *
    44                 move.w  P_CHR(a6),d0    * Get chr
    45                 andi.w  #$00FF,d0       * Mask off garbage bits
    46                 move.w  (a0),d1         * Get word from video RAM
    47                 andi.w  #$FF00,d1       * Mask off old even character
    48                 or.w    d0,d1           * OR in the new character
    49                 move.w  d1,(a0)+        * Store the updated word in video RAM
    50                 bra     vputcvx         * Done -- go return to caller
    51 *
    52 vputcv1:        move.w  P_CHR(a6),d0    * Get chr
    53                 lsl.w   #8,d0           * Shift to high (odd) byte
    54                 move.w  (a0),d1         * Get word from video RAM
    55                 andi.w  #$00FF,d1       * Mask off old odd character
    56                 or.w    d0,d1           * OR in the new character
    57                 move.w  d1,(a0)+        * Store the updated word in video RAM
    58                 addq.l  #2,a0           * Point at the attribute word
    59 *
    60 vputcvx:        move.w  P_ATR(a6),(a0)  * Store new attributes in video RAM
    61                 unlk    a6              * Unlink the stack frame
    62                 rts                     * Return to caller
    63 *
     27
     28_vputcv:        link    a6,#0           | Link stack frame pointer
     29                move.w  P_ROW(a6),d0    | Get row
     30                mulu    P_LEN(a6),d0    | Multiply by len
     31                clr.l   d1              | Clear out d1
     32                move.w  P_COL(a6),d1    | Get col
     33                add.l   d1,d0           | Add col into d0 to get char. #
     34                move.l  d0,d1           | Develop cw = (cn/2)|6 in d1
     35                andi.l  #0xFFFFFFFE,d1  | ...
     36                move.l  d1,d2           | ...
     37                add.l   d1,d1           | ...
     38                add.l   d2,d1           | ...
     39                add.l   P_ADR(a6),d1    | Add sbase to cw
     40                movea.l d1,a0           | a0 points at the word with the char.
     41                btst.l  #0,d0           | Odd char. location ?
     42                bne     vputcv1         | Jump if so
     43
     44                move.w  P_CHR(a6),d0    | Get chr
     45                andi.w  #0x00FF,d0      | Mask off garbage bits
     46                move.w  (a0),d1         | Get word from video RAM
     47                andi.w  #0xFF00,d1      | Mask off old even character
     48                or.w    d0,d1           | OR in the new character
     49                move.w  d1,(a0)+        | Store the updated word in video RAM
     50                bra     vputcvx         | Done -- go return to caller
     51
     52vputcv1:        move.w  P_CHR(a6),d0    | Get chr
     53                lsl.w   #8,d0           | Shift to high (odd) byte
     54                move.w  (a0),d1         | Get word from video RAM
     55                andi.w  #0x00FF,d1      | Mask off old odd character
     56                or.w    d0,d1           | OR in the new character
     57                move.w  d1,(a0)+        | Store the updated word in video RAM
     58                addq.l  #2,a0           | Point at the attribute word
     59
     60vputcvx:        move.w  P_ATR(a6),(a0)  | Store new attributes in video RAM
     61                unlk    a6              | Unlink the stack frame
     62                rts                     | Return to caller
     63
    6464                .end
Note: See TracChangeset for help on using the changeset viewer.