source: buchla-68k/orig/IOLIB/VPUTA.S@ 7bf3856

Last change on this file since 7bf3856 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 1.6 KB
RevLine 
[3ae31e9]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* ------------------------------------------------------------------------------
14 .text
15*
16 .xdef _vputa
17*
18SBASE .equ 8 * LONG - 'sbase'
19ROW .equ 12 * WORD - 'row'
20COL .equ 14 * WORD - 'col'
21ATTR .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*
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*
48 .end
Note: See TracBrowser for help on using the repository browser.